mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
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 <jonas@kwiboo.se>
This commit is contained in:
parent
09245e094f
commit
34c1ab534c
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user