mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #5720 from kjbracey-arm/STM32F7_DMB
Add memory barriers to STM32F7xx Ethernetpull/5682/head
commit
dd5bd73a88
|
@ -717,6 +717,8 @@ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameL
|
||||||
heth->TxDesc->Status |=ETH_DMATXDESC_FS|ETH_DMATXDESC_LS;
|
heth->TxDesc->Status |=ETH_DMATXDESC_FS|ETH_DMATXDESC_LS;
|
||||||
/* Set frame size */
|
/* Set frame size */
|
||||||
heth->TxDesc->ControlBufferSize = (FrameLength & ETH_DMATXDESC_TBS1);
|
heth->TxDesc->ControlBufferSize = (FrameLength & ETH_DMATXDESC_TBS1);
|
||||||
|
/* Ensure rest of descriptor is written to RAM before the OWN bit */
|
||||||
|
__DMB();
|
||||||
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
||||||
heth->TxDesc->Status |= ETH_DMATXDESC_OWN;
|
heth->TxDesc->Status |= ETH_DMATXDESC_OWN;
|
||||||
/* Point to next descriptor */
|
/* Point to next descriptor */
|
||||||
|
@ -746,6 +748,8 @@ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameL
|
||||||
heth->TxDesc->ControlBufferSize = (size & ETH_DMATXDESC_TBS1);
|
heth->TxDesc->ControlBufferSize = (size & ETH_DMATXDESC_TBS1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ensure rest of descriptor is written to RAM before the OWN bit */
|
||||||
|
__DMB();
|
||||||
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
||||||
heth->TxDesc->Status |= ETH_DMATXDESC_OWN;
|
heth->TxDesc->Status |= ETH_DMATXDESC_OWN;
|
||||||
/* point to next descriptor */
|
/* point to next descriptor */
|
||||||
|
@ -753,6 +757,9 @@ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ensure all descriptors are written to RAM before checking transmitter status */
|
||||||
|
__DMB();
|
||||||
|
|
||||||
/* When Tx Buffer unavailable flag is set: clear it and resume transmission */
|
/* When Tx Buffer unavailable flag is set: clear it and resume transmission */
|
||||||
if (((heth->Instance)->DMASR & ETH_DMASR_TBUS) != (uint32_t)RESET)
|
if (((heth->Instance)->DMASR & ETH_DMASR_TBUS) != (uint32_t)RESET)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue