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
This commit is contained in:
Tom Rini
2025-03-03 07:49:07 -06:00
4 changed files with 41 additions and 34 deletions

View File

@@ -166,10 +166,9 @@ void board_init_f(ulong dummy)
get_clocks(); get_clocks();
#if defined(CONFIG_DEEP_SLEEP) if (CONFIG_IS_ENABLED(DEEP_SLEEP))
if (is_warm_boot()) if (is_warm_boot())
fsl_dp_disable_console(); fsl_dp_disable_console();
#endif
preloader_console_init(); preloader_console_init();
@@ -187,10 +186,12 @@ void board_init_f(ulong dummy)
* it from SD since it has already been reserved in memory * it from SD since it has already been reserved in memory
* in last boot. * in last boot.
*/ */
if (CONFIG_IS_ENABLED(DEEP_SLEEP)) {
if (is_warm_boot()) { if (is_warm_boot()) {
second_uboot = (void (*)(void))CONFIG_TEXT_BASE; second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
second_uboot(); second_uboot();
} }
}
board_init_r(NULL, 0); board_init_r(NULL, 0);
} }

View File

@@ -417,10 +417,9 @@ void board_init_f(ulong dummy)
get_clocks(); get_clocks();
#if defined(CONFIG_DEEP_SLEEP) if (CONFIG_IS_ENABLED(DEEP_SLEEP))
if (is_warm_boot()) if (is_warm_boot())
fsl_dp_disable_console(); fsl_dp_disable_console();
#endif
preloader_console_init(); preloader_console_init();
@@ -438,10 +437,12 @@ void board_init_f(ulong dummy)
* it from SD since it has already been reserved in memeory * it from SD since it has already been reserved in memeory
* in last boot. * in last boot.
*/ */
if (CONFIG_IS_ENABLED(DEEP_SLEEP)) {
if (is_warm_boot()) { if (is_warm_boot()) {
second_uboot = (void (*)(void))CONFIG_TEXT_BASE; second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
second_uboot(); second_uboot();
} }
}
board_init_r(NULL, 0); board_init_r(NULL, 0);
} }

View File

@@ -183,6 +183,7 @@ int caam_hash(const unsigned char *pbuf, unsigned int buf_len,
{ {
int ret = 0; int ret = 0;
uint32_t *desc; uint32_t *desc;
unsigned long pbuf_aligned;
unsigned int size; unsigned int size;
desc = malloc_cache_aligned(sizeof(int) * MAX_CAAM_DESCSIZE); 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; return -ENOMEM;
} }
size = ALIGN(buf_len, ARCH_DMA_MINALIGN); pbuf_aligned = ALIGN_DOWN((unsigned long)pbuf, ARCH_DMA_MINALIGN);
flush_dcache_range((unsigned long)pbuf, (unsigned long)pbuf + size); 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, inline_cnstr_jobdesc_hash(desc, pbuf, buf_len, pout,
driver_hash[algo].alg_type, driver_hash[algo].alg_type,

View File

@@ -278,6 +278,24 @@ static int tsec_send(struct udevice *dev, void *packet, int length)
return result; 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) static int tsec_recv(struct udevice *dev, int flags, uchar **packetp)
{ {
struct tsec_private *priv = (struct tsec_private *)dev_get_priv(dev); 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; ret = length - 4;
} else { } else {
printf("Got error %x\n", (status & RXBD_STATS)); 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; 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) static void tsec_halt(struct udevice *dev)
{ {
struct tsec_private *priv; struct tsec_private *priv;