This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

u-boot cpsw ethernet driver vs the davinci one

I can't get ethernet to work in u-boot on my (custom) board. I get link, and the cpsw driver appears to go thru the motion of sending packets, but nothing happend behind that, the TX_EN pin on the PHY stays low, and there's zero debugging ability in that driver...

I already notices that one of the 'magic' value to setup the ethernet is to write 0x4 in RMII_REFCLK_SRC, corresponding to the audio PLL *AND* the SATA 50Mhz clock (that I don't have on my board) -- but disabling the SATA clock source didn't help...

I don't use a 'second stage' u-boot, I rolled ethernet (and removes a lot of bit of) into the first stage...

One thing I notices is that the TI8168 uses a totally different board support bootloader, and in particular, uses the (much simpler) davinci_emac driver for ethernet, and NOT the cpsw one... The DM814X datasheet EMAC chapter is /very/ similar to what that driver is trying to do..

Does anyone has an idea on how to debug the cpsw driver, OR, replace it with the davinci one?

I have to say, the more I dig into that stuff, the more amazed I am at the status of the code for these parts. 

  • Michael

    There is no magic value required for setup the ethernet. You can the description in TI814x TRM in the following section

    2.9.1.147 RMII_REFCLK_SRC Register (offset = 2E8h) [reset = 0h]

    And EMAC in TI816x is a different IP as compared in TI814x so you cannot use EMAC driver for TI814x Ethernet Switch.

    Can you provide some detailed information on the phy mode and clock which you are looking to source from?

    Regards
    Mugunthan V N

  • As mentioned in another topic, we can talk to the PHY in RGMII, and I can get a link, but there no packets gets transmitted or received. The problem is similar in linux.

    The PHY is a "Micrel KSZ9021 Gigabit". I used it before with another CPU and it works fine. 

    I patched linux so it recognizes that PHY properly, and linux, ethtool etc recognize it just fine.. still no packets. Strangely I see nothing on the RGMIIx_TXEN strobe either.

    Behaviour is the same in u-boot and in linux. I made sure to configure the SATA serdes to use the built in clock, and not the 100mhz (non existing, on my board) clock too..

    So, give that the cpsw drive is more or less "fire and forget" DMA engine with no debug points, I have no clue on how to debug that... But apparently I'm not alone in that...