STM32 F7 Ethernet: With these last changes, the STM32 F7 Ethernet driver is functional

This commit is contained in:
Gregory Nutt 2015-07-20 10:57:06 -06:00
parent d406163a66
commit 9737c6a0bc

View File

@ -1601,17 +1601,18 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv)
*/ */
rxdesc = priv->rxhead; rxdesc = priv->rxhead;
/* Forces the first RX descriptor to be re-read from physical memory */
arch_invalidate_dcache((uintptr_t)rxdesc,
(uintptr_t)rxdesc + sizeof(struct eth_rxdesc_s));
for (i = 0; for (i = 0;
(rxdesc->rdes0 & ETH_RDES0_OWN) == 0 && (rxdesc->rdes0 & ETH_RDES0_OWN) == 0 &&
i < CONFIG_STM32F7_ETH_NRXDESC && i < CONFIG_STM32F7_ETH_NRXDESC &&
priv->inflight < CONFIG_STM32F7_ETH_NTXDESC; priv->inflight < CONFIG_STM32F7_ETH_NTXDESC;
i++) i++)
{ {
/* Forces the descriptor to be re-read from physical memory */
arch_invalidate_dcache((uintptr_t)rxdesc,
(uintptr_t)rxdesc + sizeof(struct eth_rxdesc_s));
/* Check if this is the first segment in the frame */ /* Check if this is the first segment in the frame */
if ((rxdesc->rdes0 & ETH_RDES0_FS) != 0 && if ((rxdesc->rdes0 & ETH_RDES0_FS) != 0 &&
@ -1720,7 +1721,12 @@ static int stm32_recvframe(struct stm32_ethmac_s *priv)
/* Try the next descriptor */ /* Try the next descriptor */
rxdesc = (struct eth_rxdesc_s *)rxdesc->rdes3; rxdesc = (struct eth_rxdesc_s *)rxdesc->rdes3;
}
/* Force the next RX descriptor to be re-read from physical memory */
arch_invalidate_dcache((uintptr_t)rxdesc,
(uintptr_t)rxdesc + sizeof(struct eth_rxdesc_s));
}
/* We get here after all of the descriptors have been scanned or when rxdesc points /* We get here after all of the descriptors have been scanned or when rxdesc points
* to the first descriptor owned by the DMA. Remember where we left off. * to the first descriptor owned by the DMA. Remember where we left off.
@ -3051,7 +3057,7 @@ static void stm32_rxdescinit(struct stm32_ethmac_s *priv,
/* Set Buffer1 address pointer */ /* Set Buffer1 address pointer */
rxdesc->rdes2 = (uint32_t)rxbuffer[i * ALIGNED_BUFSIZE]; rxdesc->rdes2 = (uint32_t)&rxbuffer[i * ALIGNED_BUFSIZE];
/* Initialize the next descriptor with the Next Descriptor Polling Enable */ /* Initialize the next descriptor with the Next Descriptor Polling Enable */