AnsweredAssumed Answered

Vybrid DMA0, ENET0 vs DMA1, ENET1 and CA5 vs CM4

Question asked by SCOTT THOMPSON on Jul 13, 2016
Latest reply on Aug 3, 2016 by Timesys Support



We are running Linux 3.13.9 on CA5 core and MQX 4.2.x on CM4 core.  Originally, we allowed Linux to take ETH0 and DMA0 (and DMAMUX0/1) and left ETH1 and DMA1 to CM4.  We are using an external 7-port Ethernet switch configured as dual-RMII PHY and using the two RMII connections on the Vybrid to connect to this switch.  MDC/MDIO is connected to RMII0 only.


In response to AN4947 (in addition to the Vybrid RM), to reduce latency the CM4 core should be assigned ETH0 and DMA0 and the CA5 should take ETH1 and DMA1.  I was able to swap the DMA channels okay, and even got ETH1 to boot properly in Linux (but a few errors saying the MAC was invalid--but am able to ping and communicate).


In the device tree, I disabled ETH0 but maintained the IOMUXC assignments since they are being used with weak pull-ups to configure the RCON registers for booting.  I also disabled the MDC/MDIO IOMUXC in the device tree because I plan on using MQX to manage the switch now...  Although Linux boots and appears to operate properly using ETH1, MQX hangs on the first access to ETH0 in the MAC driver, as shown below.





/* wait until the initialization cycle completes */

while ((macnet_ptr->ECR & ENET_ECR_RESET_MASK) && (timeout<MACNET_RESET_TIMEOUT)){





The macnet_ptr variable points to 0x400D0000 which is ETH0.  DS-5 and DSTREAM report in the debugger that the registers in the ENET_MemMapPtr are "unavailable" but I'm not sure if that's just a cache issue while drilling into the BSP with caches still turned on with DSTREAM...  The ETH0 driver is configured for direct connection to the switch.


My goal is to try and get Linux to work with ETH1 and MQX to work with ETH0 as well as MDC/MDIO connected to RMII0 but controlled by MQX.


In the configuration that "works", Linux is driving ETH0/DMA1 but MDC/MDIO is still connected to RMII0.


Has anyone been able to get Linux to use (only) ETH1 and MQX to use ETH0?  We've generally had to completely split our peripheral assignments as we found that when Linux takes ahold of a device, MQX hangs when trying to access the peripheral's memory region.  I'm guessing that Linux somehow still has control of ETH0 even though it's been configured to use ETH1.


At the end of the day, Linux = ETH1/DMA1 and MQX = ETH0/DMA0.  So far, I am able to get the DMA swapped out okay.  BTW our Vybrid SoMs have the PHYs removed.