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.

AM5708: Linux/AM5708 Custom Board : Ethernet bring up issue

Part Number: AM5708
Other Parts Discussed in Thread: BEAGLEBOARD-X15, AM5728

Hi all,

we are facing issues while bringing up Ethernet on custom board am5708.

currently we are trying with fixed link.

Could anyone please let me know what is going wrong?

SDK version: PROCESSOR-SDK-LINUX-AM57X  06_03_00_106

Part number:KSZ9031RN

Gigabit Ethernet PHY0 Address   PHYAD[2:0]=0x00
Gigabit Ethernet PHY1 Address   PHYAD[2:0]=0x01

we have enabled phy reset gpios for both the phys.

miii tool output in uboot-

=> mii dump 0 0
Error reading from the PHY addr=00 reg=00

phytool output as follows:

root@am57xx-evm:~# phytool print eth0/0                                                                                                     
ieee-phy: id:00000000

   ieee-phy: reg:BMCR(0x00) val:0x0140
      flags:          -reset -loopback -aneg-enable -power-down -isolate -aneg-restart -collision-test
      speed:          1000-full

   ieee-phy: reg:BMSR(0x01) val:0x012c
      capabilities:   -100-b4 -100-f -100-h -10-f -10-h -100-t2-f -100-t2-h
      flags:          +ext-status +aneg-complete -remote-fault +aneg-capable +link -jabber -ext-register

ethtool output is as follow:

Settings for eth0:
        Supported ports: [ TP AUI BNC MII FIBRE ]
        Supported link modes:   1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Half 1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)
                               
        Link detected: yes

Settings for eth1:
        Supported ports: [ TP AUI BNC MII FIBRE ]
        Supported link modes:   1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Half 1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)
                               
        Link detected: yes

Error logs from kernel:

root@am57xx-evm:~# dmesg | grep mdio
[    2.844419] mdio_bus fixed-0: GPIO lookup for consumer reset
[    2.844426] mdio_bus fixed-0: using lookup tables for GPIO lookup
[    2.844434] mdio_bus fixed-0: No GPIO consumer reset found
[    2.891805] mdio_bus 48485000.mdio: GPIO lookup for consumer reset
[    2.891812] mdio_bus 48485000.mdio: using device tree for GPIO lookup
[    2.891830] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/ethernet@48484000/mdio@48485000[0]'
[    2.891844] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/ethernet@48484000/mdio@48485000[0]'
[    2.891853] mdio_bus 48485000.mdio: using lookup tables for GPIO lookup
[    2.891860] mdio_bus 48485000.mdio: No GPIO consumer reset found
[    2.951643] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    2.959337] libphy: 48485000.mdio: probed
[    2.964472] mdio_bus 48485000.mdio: MDIO device at address 0 is missing.
[    2.972292] mdio_bus 48485000.mdio: MDIO device at address 1 is missing.
[    3.619854] mdio_bus 48485000.mdio: GPIO lookup for consumer reset
[    3.619861] mdio_bus 48485000.mdio: using device tree for GPIO lookup
[    3.619877] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/ethernet@48484000/mdio@48485000[0]'
[    3.619891] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/ethernet@48484000/mdio@48485000[0]'
[    3.619900] mdio_bus 48485000.mdio: using lookup tables for GPIO lookup
[    3.619907] mdio_bus 48485000.mdio: No GPIO consumer reset found
[    3.671634] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    3.679330] libphy: 48485000.mdio: probed
[    3.684256] mdio_bus 48485000.mdio: MDIO device at address 0 is missing.
[    3.692086] mdio_bus 48485000.mdio: MDIO device at address 1 is missing.
root@am57xx-evm:~# dmesg | grep cpsw
[    3.703621] cpsw 48484000.ethernet: Detected MACID = 38:81:d7:9f:e4:22
[    3.710240] cpsw 48484000.ethernet: initialized cpsw ale version 1.4
[    3.716683] cpsw 48484000.ethernet: ALE Table size 1024
[    3.722019] cpsw 48484000.ethernet: cpts: overflow check period 500 (jiffies)
[    3.730162] cpsw 48484000.ethernet: cpsw: Detected MACID = 38:81:d7:9f:e4:23
[   11.115313] net eth0: initializing cpsw version 1.15 (0)
[   11.755176] net eth1: initializing cpsw version 1.15 (0)
[   12.481709] cpsw 48484000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   13.041705] cpsw 48484000.ethernet eth1: Link is Up - 1Gbps/Full - flow control off
root@am57xx-evm:~# dmesg | grep phy
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] arch_timer: cp15 timer(s) running at 6.14MHz (phys).
[    0.632716] dra7-pcie 51000000.pcie: Linked as a consumer to phy-4a094000.pciephy.0
[    2.844458] libphy: Fixed MDIO Bus: probed
[    2.959337] libphy: 48485000.mdio: probed
[    3.679330] libphy: 48485000.mdio: probed
[   11.278678] Generic PHY fixed-0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:00, irq=POLL)
[   11.882061] Generic PHY fixed-0:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=fixed-0:01, irq=POLL)
[   12.251104] phy_omap_usb2: disagrees about version of symbol module_layout
[   12.280424] phy_omap_usb2: disagrees about version of symbol module_layout
[   12.358453] phy_omap_usb2: disagrees about version of symbol module_layout
[   12.398503] phy_omap_usb2: disagrees about version of symbol module_layout
[   12.561585] phy_omap_usb2: disagrees about version of symbol module_layout
[   12.622757] phy_omap_usb2: disagrees about version of symbol module_layout
[   12.707469] phy_omap_usb2: disagrees about version of symbol module_layout
[   12.746584] phy_omap_usb2: disagrees about version of symbol module_layout

we have modified am57xx-idk-common.dtsi.

AMX_ETH0_PHY_RST is gpio7_5

AMX_ETH1_PHY_RST is gpio7_6

we have made pin mux changes related to mdio,cpsw and gpio reset as follows:

&gpio7 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&gpio7_pins_default>;
};

&mac {
    status = "okay";
    pinctrl-names = "default", "sleep";
        pinctrl-0 = <&cpsw_pins_default>;
    pinctrl-1 = <&cpsw_pins_sleep>;
    dual_emac;
    //rx_descs = <64>;
};


&davinci_mdio{
    status = "okay";    
    pinctrl-names = "default", "sleep";
        pinctrl-0 = <&mdio_pins_default>;
    pinctrl-1 = <&mdio_pins_sleep>;
};

&davinci_mdio {
    phy0: ethernet-phy@0 {
        reg = <0>;
    //compatible = "micrel,ksz9031";
    device_type = "ethernet-phy";
        //max-speed = <1000>;
    };

    phy1: ethernet-phy@1 {
        reg = <1>;
    //compatible = "micrel,ksz9031";
    device_type = "ethernet-phy";
        //max-speed = <1000>;
    };
};


&cpsw_emac0 {
         status = "okay";    
    reset-gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
    reset-delay-us = <2>;  
    phy_id = <&davinci_mdio>, <0>;
    phy-mode = "rgmii";
    dual_emac_res_vlan = <1>;
    pinctrl-names = "default";
        pinctrl-0 = <&phy0_rst_gpios>;

    fixed-link {
          speed = <1000>;
          full-duplex;
    };
};

&cpsw_emac1 {
    status = "okay";
    reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
    reset-delay-us = <2>;
    phy_id = <&davinci_mdio>, <1>;
    phy-mode = "rgmii";
    dual_emac_res_vlan = <2>;
    pinctrl-names = "default";
        pinctrl-0 = <&phy1_rst_gpios>;

    fixed-link {
          speed = <1000>;
          full-duplex;
    };
};

this is the reset pin of processor


  • Hi Sriraksha,

    This is the same PHY used on our AM571/2/4x IDKs.  Is the layout the same as the IDK?  If no, what has been changed?

    It looks like the PHY is able to detect a link and negotiate the connection speed - does communications fail?

    Regards,
    Mike

  • Hi Mike,

    In custom board ,KSZ9031RNXIC is the same phy used in AM571/2/x series.It is able to detect the phy in fixed link but auto negotiation is failing.We tried setting static ip but ping fails.

    There is phy reset which is different than evm which we have taken care.Have shared the dtsi changes above. Are we missing anything?

    have modified the davinci node

    &davinci_mdio {
        phy0: ethernet-phy@0 {
            reg = <0>;
        compatible = "micrel,ksz9031";
        device_type = "ethernet-phy";
            //max-speed = <1000>;
        };

        phy1: ethernet-phy@1 {
            reg = <1>;
        compatible = "micrel,ksz9031";
        device_type = "ethernet-phy";
            //max-speed = <1000>;
        };
    };

    working log from evm am5674 is   

    2.905931] libphy: Fixed MDIO Bus: probed
    [    2.971625] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [    2.979318] davinci_mdio 48485000.mdio: detected phy mask fffffffc
    [    2.989940] libphy: 48485000.mdio: probed
    [    2.994009] davinci_mdio 48485000.mdio: phy[0]: device 48485000.mdio:00, driver Micrel KSZ9031 Gigabit PHY
    [    3.003748] davinci_mdio 48485000.mdio: phy[1]: device 48485000.mdio:01, driver Micrel KSZ9031 Gigabit PHY

    but we get this log in custom board.

    [    2.031638] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [    2.039334] libphy: 48485000.mdio: probed
    [    2.044045] mdio_bus 48485000.mdio: MDIO device at address 0 is missing.
    [    2.051877] mdio_bus 48485000.mdio: MDIO device at address 1 is missing.

    gpio7_5 and gpio7_6 we have reset to high and we can see green and yellow leds on ethernet.

    Regards,

    Sriraksha

  • Hi Sriraksha,

    The MDIO errors should be due to PHY strapping - are you certain this is correct on your board?

    Another thing thing to try is verifying the setup is correct in u-boot.  If you are setting the PHY reset pinmux in u-boot (you should be), then we have the mdio, mii and dhcp commands that will exercise portions of the hardware.  Use the mdio utility to verify the PHYs are detected.  You may only see the first PHY at address 0.  This is normal without modifying u-boot.  The mdio and mii utilities can also be used to dump registers.  Next, the dhcp command will force auto-negotiation, and should prove whether or not the PHY is behaving properly at a hardware level, or perhaps there is a pinmux issue.

    Regards,
    Mike

  • HI Mike,

    i tried to do pinmuxing in mux_data.h and as well as request the gpio and change direction to output in board.c but when i do md in uboot pinmux were not set. so i manually hardcoded the phy reset in uboot.after which phy reset is fine but on mdio bus i dont see the phy.

    can u guide on pinmuxing in uboot?and even after phy reset why are phy not detected?

    CPU  : DRA722-GP ES2.1
    Model : TI AM5728 BeagleBoard-X15
    Board: Custom Am5708 REV
    DRAM:  1 GiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... OK
    Unidentified board claims AM57XIDK in eeprom header
    am57x_idk_lcd_detect: Failed to get I2C device 0/56 (ret 1)
    Net:   Could not get PHY for ethernet@48484000: addr 1
    eth0: ethernet@48484000
    Hit any key to stop autoboot:  0
    => mw                                 
    mw - memory write (fill)

    Usage:
    mw [.b, .w, .l] address value [count]
    => mw 0x4A003448 0xE
    => mw 0x4A00344C 0xE
    => mdio read 0 0
    0 is not a known ethernet
    Reading from bus ethernet@48484000
    PHY at address 0:
    Error
    =>
    0 is not a known ethernet
    Reading from bus ethernet@48484000
    PHY at address 0:
    Error
    => mdio read 1 0
    1 is not a known ethernet
    Reading from bus ethernet@48484000
    PHY at address 1:
    Error

    Regards,
    Sriraksha

  • Hi All,

    We have used two Phy with address 00 and 01.

    These two phy working in fixed link from mac for both 100/1000Mbps. after changing resistor in HW.

    The issue is MDIO bus we could not read any message.

    kernel logs are looking like these

    root@am57xx-hs-evm:~# dmesg | grep phy
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.552308] dra7-pcie 51000000.pcie: Linked as a consumer to phy-4a094000.pciephy.0
    [    0.552684] dra7-pcie 51000000.pcie: Dropping the link to phy-4a094000.pciephy.0
    [    1.527720] libphy: Fixed MDIO Bus: probed
    [    1.646724] no live phy, scanning all ffffffff   0
    [    1.687269] libphy: 48485000.mdio: probed

    [    7.802534] net eth0: phy "/ocp/ethernet@48484000/slave@48480200/davinci_mdio/ethernet-phy@0" not found on slave 0
    [    8.185427] libphy: PHY 48485000.mdio:01 not found
    [    8.190253] net eth1: phy "48485000.mdio:01" not found on slave 1, err -19

    few dtsi changes are made

    &mac {
        status = "okay";
        pinctrl-names = "default";
            pinctrl-0 = <&cpsw_pins_default>;
        dual_emac;

    };

    &cpsw_emac0 {
             status = "okay";
        //phy_id = <&davinci_mdio>, <0>;
        phy-mode = "rgmii";
        phy-handle = <&phy0>;
        dual_emac_res_vlan = <1>;
        //phy-reset-gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
        davinci_mdio {
            status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <&mdio_pins_default>;
            #address-cells = <1>;
                   #size-cells = <0>;
                phy0: ethernet-phy@0 {
                compatible = "micrel,ksz9031","ethernet-phy-ieee802.3-c45";
                            device_type = "ethernet-phy";
                        reg = <0>;
                reset-gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
                       reset-delay-us = <100>;
                       reset-assert-us = <10000>;
                       reset-deassert-us = <100>;
                };
        };
    };

  • hi All,

    can anyone help us out in this issue?

    We are stuck on this for long time?

    Regards,

    Sriraksha

  • Closing the thread as its resolved in another thread

    e2e.ti.com/.../3498043