summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJonas Karlman <[email protected]>2026-01-29 21:01:50 +0000
committerJerome Forissier <[email protected]>2026-02-06 16:42:45 +0100
commit34c1ab534c69366d6eeb3d693a9afd37bd14aba5 (patch)
tree7602156856c3071f63ebc951e21e8c5e9c22fe4d /drivers
parent09245e094fe95c92bee0764f31b771b4a07a89c1 (diff)
net: dwc_eth_qos: Initialize the transmit tail pointer in eqos_start()
The DesignWare Cores Ethernet Quality-of-Service databook state that descriptors up to one location less than the one indicated by the descriptor tail pointer are owned by the DMA. The DMA continues to process the descriptors until the following condition occurs: Current Descriptor Pointer == Descriptor Tail Pointer The DMA goes into suspend mode when this condition occurs, and updating the tail pointer resume the DMA processing. Configure the transmit tail pointer to the first (current) descriptor pointer so that the tail pointer is a valid address instead of being initialized to NULL when transmit DMA is started. Also update the receive tail pointer comment to state that by pointing to the last descriptor we are actually implying that all receive descriptors are owned by and can be processed by the DMA. Signed-off-by: Jonas Karlman <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/dwc_eth_qos.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
index 74cdaa27644..08332210afb 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -1011,12 +1011,17 @@ static int eqos_start(struct udevice *dev)
setbits_le32(&eqos->mac_regs->configuration,
EQOS_MAC_CONFIGURATION_TE | EQOS_MAC_CONFIGURATION_RE);
- /* TX tail pointer not written until we need to TX a packet */
/*
- * Point RX tail pointer at last descriptor. Ideally, we'd point at the
- * first descriptor, implying all descriptors were available. However,
- * that's not distinguishable from none of the descriptors being
- * available.
+ * Point TX tail pointer at the first descriptor, implying no descriptor
+ * are owned by the DMA. We advance the tail pointer when we need to TX
+ * a packet in eqos_send().
+ */
+ addr64 = (ulong)eqos_get_desc(eqos, 0, false);
+ writel(lower_32_bits(addr64), &eqos->dma_regs->ch0_txdesc_tail_pointer);
+
+ /*
+ * Point RX tail pointer at the last descriptor, implying all
+ * descriptors are owned by the DMA.
*/
addr64 = (ulong)eqos_get_desc(eqos, EQOS_DESCRIPTORS_RX - 1, true);
writel(lower_32_bits(addr64), &eqos->dma_regs->ch0_rxdesc_tail_pointer);