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.

Linux/AM3352: MDIO activation

Part Number: AM3352

Tool/software: Linux

Hi,

I have a board based on the beagle bone black except that instead of PHY I have an ethernet switch.

In the DTS I changed to (fixed link)

&cpsw_emac0 {
//phy_id = <&davinci_mdio>, <0>;
fixed-link = <1 1 100 0 0>;
phy-mode = "mii";
};

The network is working, but the MDIO is not working:

When I read 0x4a101004 I get 0x8100007C

That mean the the MDIO is idle and not enabled

What should I do (I assume in the dts file) in order to make the MDIO work?

Thanks

Avner

  • Hi,

    Sorry, but EMAC-to-external switch is an use case that is not supported by TI. We cannot help on this.
  • Hi,

    I don't think the mdio bus matter what in the other side, I am just asking how to make it works in the Sitara side!

    Avoid the part that I shared that I am using switch

    I just want to be able to do mdio transactions in userspace!

    Thanks

    Avner

  • Hi,

    Since you have set fixed link for the MAC interface it is not going to use the MDIO bus to determine link status as the link is always on. The only suggestion I have for you is to setup and enable with a status=play a davinci_mdio node , (look in the TI DTS files for how to do this). But, I have no idea or be able to support how this will work from user space as this would be setting up outside the usual and intended use which is pairing a PHY with an ethernet MAC.

    Best Regards,
    Schuyler
  • Userspace can use ioctrl messages SIOCGMIIREG and SIOCSMIIREG.
  • Hi Norman,

    I am not sure these ioctls work without having an Ethernet interface associated with a PHY. Do you have an example of accessing the PHY registers that doesn't require an ethernet mac association?

    There may be a path that I am unaware of but it looks like the processing path goes first through the CPSW ethtool ioctl interface based of the defined ethernet interface before going into the phy ioctl code.

    Best Regards,
    Schuyler
  • My experience is SIOCGMIIREG and SIOCSMIIREG was on another processor. Support for those ioctl messages are apparently not universal. Drivers that do support those messages intercept the messages at the MAC level before calling the PHY level. Or the MDIO driver is called directly. I suspect the DSA drivers must do that. Utilities like ethtools cannot work without support for those ioctl messages. So...ignore my suggestion.
  • Hi Norman,
    Thank you for the response, I think that is good explanation (better than mine) of the ioctl message processing.

    Hi Avner,
    Unfortunately TI cannot support directly what you are asking for so I am going to close the thread. As a starting suggestion that you might try, but we won't be able to help with since this usage is beyond what TI supports, is write your own ioctl message processor to the davinci_mdio driver. The big caveat is that beware if you are using the davinci_mdio driver for other ethernet interfaces.

    Best Regards,
    Schuyler