summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-03-03 07:49:07 -0600
committerTom Rini <trini@konsulko.com>2025-03-03 07:49:07 -0600
commitcf6354ab23bfc3337b1087d243e6be4af48abe84 (patch)
tree383ca8e26490b92723307dffac4ab6dcdd17d014
parentd4e428856cfa701ae6ad012c150c3f5c8e19c044 (diff)
parentef0e979e14332e37421eb3ebe5b88c2409a8803a (diff)
Merge tag 'fsl-qoriq-2025-3-3' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq
CI: https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/pipelines/24933 Fixes: - Re-arm packet buffer in error case in tsec driver - Fix LS1021a build - Fix flush dcache alignment in caam_hash
-rw-r--r--board/freescale/ls1021atsn/ls1021atsn.c15
-rw-r--r--board/freescale/ls1021atwr/ls1021atwr.c15
-rw-r--r--drivers/crypto/fsl/fsl_hash.c6
-rw-r--r--drivers/net/tsec.c39
4 files changed, 41 insertions, 34 deletions
diff --git a/board/freescale/ls1021atsn/ls1021atsn.c b/board/freescale/ls1021atsn/ls1021atsn.c
index d1acccec110..c92430c0896 100644
--- a/board/freescale/ls1021atsn/ls1021atsn.c
+++ b/board/freescale/ls1021atsn/ls1021atsn.c
@@ -166,10 +166,9 @@ void board_init_f(ulong dummy)
get_clocks();
-#if defined(CONFIG_DEEP_SLEEP)
- if (is_warm_boot())
- fsl_dp_disable_console();
-#endif
+ if (CONFIG_IS_ENABLED(DEEP_SLEEP))
+ if (is_warm_boot())
+ fsl_dp_disable_console();
preloader_console_init();
@@ -187,9 +186,11 @@ void board_init_f(ulong dummy)
* it from SD since it has already been reserved in memory
* in last boot.
*/
- if (is_warm_boot()) {
- second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
- second_uboot();
+ if (CONFIG_IS_ENABLED(DEEP_SLEEP)) {
+ if (is_warm_boot()) {
+ second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
+ second_uboot();
+ }
}
board_init_r(NULL, 0);
diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c
index cc9665c0410..0758e5eae25 100644
--- a/board/freescale/ls1021atwr/ls1021atwr.c
+++ b/board/freescale/ls1021atwr/ls1021atwr.c
@@ -417,10 +417,9 @@ void board_init_f(ulong dummy)
get_clocks();
-#if defined(CONFIG_DEEP_SLEEP)
- if (is_warm_boot())
- fsl_dp_disable_console();
-#endif
+ if (CONFIG_IS_ENABLED(DEEP_SLEEP))
+ if (is_warm_boot())
+ fsl_dp_disable_console();
preloader_console_init();
@@ -438,9 +437,11 @@ void board_init_f(ulong dummy)
* it from SD since it has already been reserved in memeory
* in last boot.
*/
- if (is_warm_boot()) {
- second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
- second_uboot();
+ if (CONFIG_IS_ENABLED(DEEP_SLEEP)) {
+ if (is_warm_boot()) {
+ second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
+ second_uboot();
+ }
}
board_init_r(NULL, 0);
diff --git a/drivers/crypto/fsl/fsl_hash.c b/drivers/crypto/fsl/fsl_hash.c
index 79b32e2627c..b721c866095 100644
--- a/drivers/crypto/fsl/fsl_hash.c
+++ b/drivers/crypto/fsl/fsl_hash.c
@@ -183,6 +183,7 @@ int caam_hash(const unsigned char *pbuf, unsigned int buf_len,
{
int ret = 0;
uint32_t *desc;
+ unsigned long pbuf_aligned;
unsigned int size;
desc = malloc_cache_aligned(sizeof(int) * MAX_CAAM_DESCSIZE);
@@ -191,8 +192,9 @@ int caam_hash(const unsigned char *pbuf, unsigned int buf_len,
return -ENOMEM;
}
- size = ALIGN(buf_len, ARCH_DMA_MINALIGN);
- flush_dcache_range((unsigned long)pbuf, (unsigned long)pbuf + size);
+ pbuf_aligned = ALIGN_DOWN((unsigned long)pbuf, ARCH_DMA_MINALIGN);
+ size = ALIGN(buf_len + ((unsigned long)pbuf - pbuf_aligned), ARCH_DMA_MINALIGN);
+ flush_dcache_range(pbuf_aligned, pbuf_aligned + size);
inline_cnstr_jobdesc_hash(desc, pbuf, buf_len, pout,
driver_hash[algo].alg_type,
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index 6481ee24a60..bd4ebdd745a 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -278,6 +278,24 @@ static int tsec_send(struct udevice *dev, void *packet, int length)
return result;
}
+static int tsec_free_pkt(struct udevice *dev, uchar *packet, int length)
+{
+ struct tsec_private *priv = (struct tsec_private *)dev_get_priv(dev);
+ u16 status;
+
+ out_be16(&priv->rxbd[priv->rx_idx].length, 0);
+
+ status = RXBD_EMPTY;
+ /* Set the wrap bit if this is the last element in the list */
+ if ((priv->rx_idx + 1) == PKTBUFSRX)
+ status |= RXBD_WRAP;
+ out_be16(&priv->rxbd[priv->rx_idx].status, status);
+
+ priv->rx_idx = (priv->rx_idx + 1) % PKTBUFSRX;
+
+ return 0;
+}
+
static int tsec_recv(struct udevice *dev, int flags, uchar **packetp)
{
struct tsec_private *priv = (struct tsec_private *)dev_get_priv(dev);
@@ -296,6 +314,9 @@ static int tsec_recv(struct udevice *dev, int flags, uchar **packetp)
ret = length - 4;
} else {
printf("Got error %x\n", (status & RXBD_STATS));
+
+ /* Rearm the packet buffer */
+ tsec_free_pkt(dev, NULL, 0);
}
}
@@ -307,24 +328,6 @@ static int tsec_recv(struct udevice *dev, int flags, uchar **packetp)
return ret;
}
-static int tsec_free_pkt(struct udevice *dev, uchar *packet, int length)
-{
- struct tsec_private *priv = (struct tsec_private *)dev_get_priv(dev);
- u16 status;
-
- out_be16(&priv->rxbd[priv->rx_idx].length, 0);
-
- status = RXBD_EMPTY;
- /* Set the wrap bit if this is the last element in the list */
- if ((priv->rx_idx + 1) == PKTBUFSRX)
- status |= RXBD_WRAP;
- out_be16(&priv->rxbd[priv->rx_idx].status, status);
-
- priv->rx_idx = (priv->rx_idx + 1) % PKTBUFSRX;
-
- return 0;
-}
-
static void tsec_halt(struct udevice *dev)
{
struct tsec_private *priv;