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.

AM335X devicetree and fixed phy

Hello again,

I'm finally getting the hang of this devicetree concept, however, a new conundrum has occured: the addition of a mdio-less phy. On our board we have an RMII connection to an FPGA acting as PHY, however, the MDIO bus is not connected. In the previous SDK i'd enable the fixed link option in the kernel and add a fixed link in our board description, however, from SDK 7.00 we use device trees.

Now, how can I add these virtual mdio devices in my device tree? Or, should I add these virtuals in my init code like I used to do in the previous SDK?

Kind regards,

Arend

  • Hi Arend,

    I've asked the factory team to help with your question.

    Best regards,
    Miroslav

  • Allright, thanks!

    I've already came up with the following infomation: apparantly someone at free electrons has included the DT bindings for fixed links in kernel 3.16. 

    edit: an older propert for "fixed-link" already exists in 3.12. I'm looking more into this property to find out how it works and if it works.

    Kind regards,

    Arend

  • Looking through the 3.12 cpsw driver in the 7.0 SDK there does not appear to be fixed-phy support. The cpsw driver is tightly coupled with the mdio driver.  I will investigate a little further to see if something is missing here.

    Which part are you using?

  • Hello and thank you for your efforts!

    In the previous SDK (without DT support ) I used the fixed-phy driver, which just gave me a simple function to add a fixed phy (this is because we have an FPGA that acts as a PHY, but withouth an MDIO bus...I think it's easier to think about it as if it were a switch instead, since these chips don't have an mdio either ). This seemed to work without a problem, as the MDIO commands are related to the actual used PHY and not the CPSW ( since there are not standard registers/commands to change the mode, speed or (half-)duplex setting ). This led me to believe that this should in fact be possible, without a real addition to your driver.

    In my search I did find a fixed link property, but is is not described very well ( to me at least ), I'll give you the link of the current implementation, perhaps we can solve it together this way:-)

    https://dev.openwrt.org/browser/trunk/target/linux/mvebu/patches-3.10/0080-of-provide-a-binding-for-the-fixed-link-property.patch?rev=39565

    This is the previous version, in the new version ( included in kernel 3.16 ), created by free electrons:

    http://lxr.free-electrons.com/source/drivers/of/of_mdio.c

    both providing the same functionality, only a different syntax...however, I don't really understand how to use it...

    Kind regards,

    Arend

  • Hello,

    I didn't find a solution myself, are there any updates on your side?

    Kind regards,

    Arend

  • Hello,

    I also have the same problem.

    Is there someone at TI's who can help with this?

    Kind regards,

    Pascal

  • Hi Pascal,

    I patched the driver so that it can work with the fixed phy driver, and it does work. However, last week I send the patch to TI for revision, so if everything is OK ( or at least after I've fixed the patch ) I guess I can post it here for you.

    Hope this gives you some comfort knowing that a solution is almost present :-)

    Kind regards,

    Arend Lapere

  • Hi Arend,

    thank you for this very quick answer.

    And yes: It gives me a lot of comfort,knowing that there is something in progress with this.  

    Thanks in advance.

    Pascal

  • Hi Arand,

    could you send me the actual Version of your Patch?

    Maybe I could fix it by myself.

    I need the fixed-link behaviour very soon for testing purposes.

    If you don't want to post it here, please use my mail adress: ti [ at ] iktek.de

    Thanks in advance

    Pascal Speck

  • Hello Pascal,

    I'll post it here, for others to use if they like. I didn't receive any notice yet from TI that it is bad.... absence of news is absence of problems I guess. 

    Anyway, if you have any problems or improvements, I'd be more than happy to help you :-)

    7181.fixed-phy-fix.rar

    The usage in the DT tree is IMHO actually very easy:

    &cpsw_emac1 {
                    phy_id = <&davinci_mdio>, <2>;
                    phy-mode = "rmii";
                    fixed-link = <1 100 0 0>;
    };
    
    1 is full duplex
    100 is 100 mbit ( may be 10 or 1000 )
    0 is pause
    0 is async pause
    

    Kind regards,

    Arend

  • Hello Arend,
    Hello everybody.

    Thank You Arend. Your answer is really helpful to bring up phyless interface. I'm using linux kernel 3.19.
    My desired settings were RGMII and 1000/full, I made the fixed phy registration as well as You. But obtained RGMII at speed 10 Mb/s - txclk frequency only 2.5 Mhz instead of 250Mhz.
    Now the processor's RGMII is not connected to any device, but I don't think it is the problem to try transmission.
    Registers:
    MAC_CONTROL 2 (0x4a100dc4): 0xA1, tried 0x200A1 - GIG_FORCE GIG GMII_EN FULLDUPLEX
    GMII_SEL (0x44E10650): 0x8 - Port2 RGMII Mode
    MACSTATUS (0x4A100DC8) 0x80000000 IDLE

    RGMII_CTL (0x4a101288): 0x0 RGMII2 link is down, SPEED_10Mbps - that's truth, but why the am335x' cpsw is so cruel?

    Thank You for any suggestions.