diff options
author | Tom Rini <trini@konsulko.com> | 2025-03-03 07:49:07 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-03-03 07:49:07 -0600 |
commit | cf6354ab23bfc3337b1087d243e6be4af48abe84 (patch) | |
tree | 383ca8e26490b92723307dffac4ab6dcdd17d014 /drivers/net/tsec.c | |
parent | d4e428856cfa701ae6ad012c150c3f5c8e19c044 (diff) | |
parent | ef0e979e14332e37421eb3ebe5b88c2409a8803a (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
Diffstat (limited to 'drivers/net/tsec.c')
-rw-r--r-- | drivers/net/tsec.c | 39 |
1 files changed, 21 insertions, 18 deletions
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; |