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/AM5726: MDIO probe failed with DP83867

Part Number: AM5726

Tool/software: Linux

Hi,

We are using a custom board based on AM5726 GP EVM, with SDK version 5.0.0.15. We have brought up all modified hw except the MDIO which we replaced Micrel with DP83867. I checked the default config and confirmed DP83867 is enabled in kernel build, but when the board boot, it fails at probing:

[ 3.123460] libphy: Fixed MDIO Bus: probed
[ 3.191602] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
[ 3.199302] libphy: 48485000.mdio: probed
[ 3.204563] davinci_mdio: probe of 48485000.mdio failed with error -5
[ 3.211805] cpsw 48484000.ethernet: Detected MACID = c4:f3:12:03:72:68
[ 3.218453] cpsw 48484000.ethernet: initialized cpsw ale version 1.4
[ 3.224839] cpsw 48484000.ethernet: ALE Table size 1024
[ 3.230102] cpsw 48484000.ethernet: device node lookup for pps timer failed
[ 3.237138] cpsw 48484000.ethernet: cpts: overflow check period 500 (jiffies)
[ 3.245496] cpsw 48484000.ethernet: cpsw: Detected MACID = c4:f3:12:03:72:69

I didn't change dts file regarding the MDIO from the original EVM settings. Is it that I missed some settings for DP83867?

As a side note, the emac interface with DP83867 is working for both 100M or 1G mode when I use fixed phy settings to force to these mode. So the only problem I have is with the MDIO.

Thanks for any advice!

Jan

  • Hi,

    This might be a solution for you.  Below is a post describing an issue very close to what you are reporting.

    Link to e2e post about missing resistor on PHY reset line.

    Good job BTW on using fixed phy settings to isolate the PHY. Did you do that in your DTS file?

    Best Regards,

    Schuyler

  • Hi Schuyler,

    Thank you for the suggestion! (yes I isolated the problem using fixed phy by changing the dts file on emac.) However after further debugging, I'm convinced that our issue is different than the reset issue. Although our RESET_N is only controlled by POR but not by a GPIO, I think the POR should be sufficient. During kernel boot, when I probed the MDC and MDIO lines, there were activities.

    Ch1 is MDC and Ch2 is MDIO. My questions:

    (1) Why the MDC = 125K? On kernel log it says bus freq 1M. Did I miss anything in the dts file?

    [    3.191524] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000

    (2) The MDIO line looks like a voltage level not going to ground, is this a hw problem? Perhaps this is the reason the mdio probe failed?

    Thanks again!

    Jan

  • Hi Jan,

    Sorry to hear the e2e post didn't fix the issue. Thanks for posting the scope capture that will help with discussions. Your HW suggestion as the root cause might be correct, I need to involve another team here for additional assistance.

    Best Regards,
    Schuyler
  • Hi Schuyler,

    After realizing my phy address is 0, I fixed my dts file and got mdio probe working:

    [    3.199264] libphy: 48485000.mdio: probed
    [    3.215875] davinci_mdio 48485000.mdio: phy[0]: device 48485000.mdio:00, driver TI DP83867
    [    3.225374] cpsw 48484000.ethernet: Detected MACID = c4:f3:12:03:72:68
    [    3.232025] cpsw 48484000.ethernet: initialized cpsw ale version 1.4

    However eth0 init still failed:

    [    9.971988] net eth0: initializing cpsw version 1.15 (0)
    [   10.007637] net eth0: phy "/ocp/ethernet@48484000/mdio@48485000/ethernet-phy@0" not found on slave 0
    [   10.090256] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

    Not sure what else I'm missing. Here is my dts related to eth0:

    &davinci_mdio {
     phy0: ethernet-phy@0 {
      reg = <0>;
     };
    };

    &cpsw_emac0 {
     phy-handle = <&phy0>;
     phy-mode = "rgmii";
     dual_emac_res_vlan = <1>;

    };

    Thanks,

    Jan

  • Hi Jan,

    A mid level voltage from the DP83867 is characteristic of improper strapping on GPIO_0.  If GPIO_0 is placed into mode 2 or mode 4, MDIO will become unresponsive and pull to mid rail.

    If you have this GPIO connected to your processor, the processor may drive a voltage, or have an internal pull resistor that is causing this improper strapping.

    Please try isolating GPIO_0, or pulling it down strongly to ground to go into mode 1.

    Best Regards,

  • Thank you Bob for the suggestion!

    After double checking the schematic, we realized that MDIO line was pulled up only to 1V rather than the I/O supply 1.8V. Now we fixed the pull up to 1.8V and the MDIO signal looks much better. However the eth0 init still fails.

    [   10.302100] net eth0: initializing cpsw version 1.15 (0)
    [   10.353590] net eth0: phy "/ocp/ethernet@48484000/mdio@48485000/ethernet-phy@0" not found on slave 0

    The GPIO_0 is connected to the gate of a mosfet to drive an LED. We probed it and it was at 0 at RESET. I see MDIO read response on scope, but not sure why the init still fails. Could I be missing something in the software configuration or device tree?

  • Hi Jan,

    If you are seeing clean MDIO responses, then I believe it is a SW configuration issue. I will return this thread to our Linux experts.

    Best,
  • After further debugging, I found my failure is in dp83867_of_init() , "phy-mode = "rgmii" in my dts may not be a supported mode for DP83867. Is that so?
  • Hi Jan,
    RGMII should be supported, I need to review the TI EVMs to see if this PHY is on one of them. Some of the PHYs use a mode of rgmii-id or rgmii-txid to indicate a delay is required to meeting timing between the PHY and the MAC.

    Earlier in the post you mentioned that you have both 100M and 1G working with the fixed PHY approach. To me this indicates that the data connection to the PHY is working. But that said, if you are able to try "ethtool -S eth0" are there any errors indicated such as CRC for example?

    The boot log is complaining about not find finding the PHY. Sometimes this message occurs early in the boot sequence and clears up later. Based on the error this command will probably not indicate a link since no PHY, what does "ethtool eth0" indicate?

    Best Regards,
    Schuyler
  • Hi Schuyler,

    After I copied some settings from another file (for a different target board) that uses rgmii-id mode, then function dp83867_of_init() returns success and fixed the error.

    &davinci_mdio {
     phy0: ethernet-phy@0 {
      reg = <0>;
      ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
      ti,tx-internal-delay = <DP83867_RGMIIDCTL_250_PS>;
      ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_8_B_NIB>;
      ti,min-output-impedance;
      ti,dp83867-rxctrl-strap-quirk;
     };
    };

    &mac {
     status = "okay";
     dual_emac;
    };

    &cpsw_emac0 {
     phy-handle = <&phy0>;
     phy-mode = "rgmii-id";
     dual_emac_res_vlan = <1>;
     }; */

    };

    My original plain simple rgmii version just cannot get past the "dp83867_of_init" function successfully.

    &davinci_mdio {
     phy0: ethernet-phy@0 {
      reg = <0>;
     };
    };

    &cpsw_emac0 {
     phy-handle = <&phy0>;
     phy-mode = "rgmii";
     dual_emac_res_vlan = <1>;

    };

    Why is that?

    I didn't plan to use the rgmii-id mode because we used strap pins and took care of the tx delay = 0 and rx delay = 2ns, which is why my fix-phy was working fine. Now it seems that I have no choice but to set the delays in dts, then are the settings in dts in effect or the hw strap pins?

    Thanks,

    Jan

  • Hi Jan,

    Per the earlier question, about support of rgmii mode. In your DTS file the DP83867 the PHY mode should be rgmii-id. Please take a look at this file in the TI SDK arch/arm/boot/dts/dra76-evm.dts for an example of how TI used the PHY on one of the EVMS.

    Looking again at your emac node definition and comparing with the dts file mentioned in this post could you please try setting up the definition like the example DTS? The issue to me looks like the issue could be the emac driver doesn't know where to connect with the PHY, the "&davinci_mdio" looks to be missing. The MDIO driver is seeing and correctly identifying PHY and the associated driver.

    Best Regards,
    Schuyler
  • Hi Jan,
    I didn't refresh before sending my previous answer. I missed seeing your response.

    Why fixed mode worked without those timing variables was a question I was thinking about.

    Concerning which overides which on the PHY HW strapping or the DTS setting we will have to ask Rob on the PHY support team this question. I will contact him.

    Is the network performing as expected now?

    Best Regards,
    Schuyler
  • Hi Schuyler, thank you so much for helping me work through the various hw/sw issues, now my phy and eth0 works fine, see below. I also realized that what I was missing in the dts file was the "fifo-depth", rather than the delay parameters. Now that I see tx/rx delay can be easily set in dts, there is no need to use the strap pins to set the delays. Please confirm after checking with Rob if the sw settings overrides the HW strap pins.

    root@am57xx-evm:~# ethtool -S eth0
    NIC statistics:
    Good Rx Frames: 183
    Broadcast Rx Frames: 79
    Multicast Rx Frames: 42
    Pause Rx Frames: 0
    Rx CRC Errors: 0
    Rx Align/Code Errors: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 25780
    Good Tx Frames: 204
    Broadcast Tx Frames: 33
    Multicast Tx Frames: 95
    Pause Tx Frames: 0
    Deferred Tx Frames: 0
    Collisions: 0
    Single Collision Tx Frames: 0
    Multiple Collision Tx Frames: 0
    Excessive Collisions: 0
    Late Collisions: 0
    Tx Underrun: 0
    Carrier Sense Errors: 0
    Tx Octets: 26594
    Rx + Tx 64 Octet Frames: 9
    Rx + Tx 65-127 Octet Frames: 290
    Rx + Tx 128-255 Octet Frames: 43
    Rx + Tx 256-511 Octet Frames: 45
    Rx + Tx 512-1023 Octet Frames: 0
    Rx + Tx 1024-Up Octet Frames: 0
    Net Octets: 52374
    Rx Start of Frame Overruns: 0
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 0
    Rx DMA chan 0: head_enqueue: 1
    Rx DMA chan 0: tail_enqueue: 270
    Rx DMA chan 0: pad_enqueue: 0
    Rx DMA chan 0: misqueued: 0
    Rx DMA chan 0: desc_alloc_fail: 0
    Rx DMA chan 0: pad_alloc_fail: 0
    Rx DMA chan 0: runt_receive_buf: 0
    Rx DMA chan 0: runt_transmit_bu: 0
    Rx DMA chan 0: empty_dequeue: 0
    Rx DMA chan 0: busy_dequeue: 143
    Rx DMA chan 0: good_dequeue: 143
    Rx DMA chan 0: requeue: 0
    Rx DMA chan 0: teardown_dequeue: 0
    Tx DMA chan 0: head_enqueue: 204
    Tx DMA chan 0: tail_enqueue: 0
    Tx DMA chan 0: pad_enqueue: 0
    Tx DMA chan 0: misqueued: 0
    Tx DMA chan 0: desc_alloc_fail: 0
    Tx DMA chan 0: pad_alloc_fail: 0
    Tx DMA chan 0: runt_receive_buf: 0
    Tx DMA chan 0: runt_transmit_bu: 13
    Tx DMA chan 0: empty_dequeue: 204
    Tx DMA chan 0: busy_dequeue: 0
    Tx DMA chan 0: good_dequeue: 204
    Tx DMA chan 0: requeue: 0
    Tx DMA chan 0: teardown_dequeue: 0
  • Hi Jan,
    I discussed the HW override question with Rob and he says that the HW strapping does not override the SW settings. The strapping is latched on power up and a reset, but SW will override the HW settings.

    Glad the interface is working and that we were able to help with debug.

    Best Regards,
    Schuyler