STM32 F7 Ethernet: Fix typo in header; Add memory sync barrier between writing to DMA TX descriptor and restarting DMA TX. Avoid calling work_queue on pollwork if it's already queued, just skip a poll cycle instead. Nucleo-144: Fix RMII TXD1 signal, connected to PB13 not to PG14.
This commit is contained in:
parent
ac543648b8
commit
1b27dd32af
@ -47,7 +47,7 @@
|
||||
* families
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_STM32F7_STM32F74XX) || defined(CONFIG_STM32F7_STM32F75XX) \
|
||||
#if defined(CONFIG_STM32F7_STM32F74XX) || defined(CONFIG_STM32F7_STM32F75XX) || \
|
||||
defined(CONFIG_STM32F7_STM32F76XX) || defined(CONFIG_STM32F7_STM32F77XX)
|
||||
|
||||
/****************************************************************************************************
|
||||
|
@ -82,6 +82,11 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Memory synchronization */
|
||||
|
||||
#define MEMORY_SYNC() do { ARM_DSB(); ARM_ISB(); } while (0)
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
/* See configs/stm3240g-eval/README.txt for an explanation of the configuration
|
||||
* settings.
|
||||
@ -1219,6 +1224,8 @@ static int stm32_transmit(struct stm32_ethmac_s *priv)
|
||||
|
||||
/* Check if the TX Buffer unavailable flag is set */
|
||||
|
||||
MEMORY_SYNC();
|
||||
|
||||
if ((stm32_getreg(STM32_ETH_DMASR) & ETH_DMAINT_TBUI) != 0)
|
||||
{
|
||||
/* Clear TX Buffer unavailable flag */
|
||||
@ -2210,6 +2217,8 @@ static int stm32_interrupt(int irq, void *context, FAR void *arg)
|
||||
wd_cancel(priv->txtimeout);
|
||||
}
|
||||
|
||||
DEBUGASSERT(work_available(&priv->irqwork));
|
||||
|
||||
/* Schedule to perform the interrupt processing on the worker thread. */
|
||||
|
||||
work_queue(ETHWORK, &priv->irqwork, stm32_interrupt_work, priv, 0);
|
||||
@ -2287,6 +2296,8 @@ static void stm32_txtimeout_expiry(int argc, uint32_t arg, ...)
|
||||
|
||||
/* Schedule to perform the TX timeout processing on the worker thread. */
|
||||
|
||||
DEBUGASSERT(work_available(&priv->irqwork));
|
||||
|
||||
work_queue(ETHWORK, &priv->irqwork, stm32_txtimeout_work, priv, 0);
|
||||
}
|
||||
|
||||
@ -2386,7 +2397,14 @@ static void stm32_poll_expiry(int argc, uint32_t arg, ...)
|
||||
|
||||
/* Schedule to perform the interrupt processing on the worker thread. */
|
||||
|
||||
work_queue(ETHWORK, &priv->pollwork, stm32_poll_work, priv, 0);
|
||||
if (work_available(&priv->pollwork))
|
||||
{
|
||||
work_queue(ETHWORK, &priv->pollwork, stm32_poll_work, priv, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
(void)wd_start(priv->txpoll, STM32_WDDELAY, stm32_poll_expiry, 1, priv);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -449,7 +449,7 @@
|
||||
* -------- ------------ -------------
|
||||
* PG11 RMII_TX_EN TXEN
|
||||
* PG13 RMII_TXD0 TXD0
|
||||
* PG14 RMII_TXD1 TXD1
|
||||
* PB13 RMII_TXD1 TXD1
|
||||
* PC4 RMII_RXD0 RXD0/MODE0
|
||||
* PC5 RMII_RXD1 RXD1/MODE1
|
||||
* PG2 RMII_RXER RXER/PHYAD0 -- Not used
|
||||
@ -466,7 +466,7 @@
|
||||
|
||||
#define GPIO_ETH_RMII_TX_EN GPIO_ETH_RMII_TX_EN_2
|
||||
#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2
|
||||
#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2
|
||||
#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_1
|
||||
|
||||
/************************************************************************************
|
||||
* Public Data
|
||||
|
Loading…
Reference in New Issue
Block a user