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.

AM5726: Eth1 fails

Part Number: AM5726

Hello,
When starting Linux the Ethernet PHY`s are recognized:

[    2.311347] libphy: Fixed MDIO Bus: probed
[    2.381059] davinci_mdio 48485000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    2.388757] libphy: 48485000.mdio: probed
[    2.398182] davinci_mdio 48485000.mdio: phy[0]: device 48485000.mdio:00, driver SMSC LAN8710/LAN8720
[    2.407394] davinci_mdio 48485000.mdio: phy[1]: device 48485000.mdio:01, driver SMSC LAN8710/LAN8720
[    2.417497] cpsw-phy-sel 4a002554.cpsw-phy-sel: invalid resource
[    2.423595] cpsw-phy-sel: probe of 4a002554.cpsw-phy-sel failed with error -22
[    2.431722] cpsw 48484000.ethernet: Detected MACID = 18:62:e4:6f:58:52
[    2.438432] cpsw 48484000.ethernet: initialized cpsw ale version 1.4
[    2.444822] cpsw 48484000.ethernet: ALE Table size 1024
[    2.450173] cpsw 48484000.ethernet: cpts: overflow check period 500 (jiffies)
[    2.459430] cpsw 48484000.ethernet: cpsw: Detected MACID = 18:62:e4:6f:58:53


If I add an Ethernet cable to a switch I get a message at Eth0 and Eth1 that the links are detected.
However, a ping only works for ETH0 and at "wiresharc" I can see that no data comes out of the ETH1 interface. Can you help me with this problem? Probably only something is wrong with the DTS.

The PHY addresses there are 0x00 (eth0) and 0x01 (eth1).

    cpsw_pins_default: cpsw_pins_default {
        pinctrl-single,pins = <
            /* Clock at slave 0/1 */
            DRA7XX_CORE_IOPAD(0x3644, PIN_INPUT_PULLDOWN | MUX_MODE0)    /* u3 rmii_mhz_50_clk.rmii_mhz_50_clk */

            /* Slave at addr 0x0 */
            DRA7XX_CORE_IOPAD(0x3658, PIN_INPUT | MUX_MODE1)    /* v7 rgmii0_txd3.rmii0_crs */
            DRA7XX_CORE_IOPAD(0x365c, PIN_INPUT | MUX_MODE1)    /* u7 rgmii0_txd2.rmii0_rxer */
            DRA7XX_CORE_IOPAD(0x3660, PIN_INPUT | MUX_MODE1)    /* v6 rgmii0_txd1.rmii0_rxd1 */
            DRA7XX_CORE_IOPAD(0x3664, PIN_INPUT | MUX_MODE1)    /* u6 rgmii0_txd0.rmii0_rxd0 */

            DRA7XX_CORE_IOPAD(0x3674, PIN_OUTPUT | MUX_MODE1)    /* v3 rgmii0_rxd2.rmii0_txen */
            DRA7XX_CORE_IOPAD(0x3678, PIN_OUTPUT | MUX_MODE1)    /* y2 rgmii0_rxd1.rmii0_txd1 */
            DRA7XX_CORE_IOPAD(0x367c, PIN_OUTPUT | MUX_MODE1)    /* w2 rgmii0_rxd0.rmii0_txd0 */

            /* Slave at addr 0x1 */
            DRA7XX_CORE_IOPAD(0x3648, PIN_INPUT | MUX_MODE2)    /* v2 uart3_rxd.rmii1_crs */
            DRA7XX_CORE_IOPAD(0x364c, PIN_INPUT | MUX_MODE2)    /* y1 uart3_txd.rmii1_rxer */
            DRA7XX_CORE_IOPAD(0x3650, PIN_INPUT | MUX_MODE2)    /* w9 rgmii0_txc.rmii1_rxd1 */
            DRA7XX_CORE_IOPAD(0x3654, PIN_INPUT | MUX_MODE2)    /* v9 rgmii0_txcl.rmii1_rxd0 */

            DRA7XX_CORE_IOPAD(0x3668, PIN_OUTPUT | MUX_MODE2)    /* u5 rgmii0_rxc.rmii1_txen */
            DRA7XX_CORE_IOPAD(0x366C, PIN_OUTPUT | MUX_MODE2)    /* v5 rgmii0_rxctl.rmii1_txd1 */
            DRA7XX_CORE_IOPAD(0x3670, PIN_OUTPUT | MUX_MODE2)    /* v4 rgmii0_rxd3.rmii1_txd0 */
        >;
    };

    cpsw_pins_sleep: cpsw_pins_sleep {
        pinctrl-single,pins = <
            /* Slave at addr 0x0 */
            DRA7XX_CORE_IOPAD(0x3658, PIN_INPUT | MUX_MODE15)    /* v7 rgmii0_txd3.disabled */
            DRA7XX_CORE_IOPAD(0x365c, PIN_INPUT | MUX_MODE15)    /* u7 rgmii0_txd2.disabled */
            DRA7XX_CORE_IOPAD(0x3660, PIN_INPUT | MUX_MODE15)    /* v6 rgmii0_txd1.disabled */
            DRA7XX_CORE_IOPAD(0x3664, PIN_INPUT | MUX_MODE15)    /* u6 rgmii0_txd0.disabled */

            DRA7XX_CORE_IOPAD(0x3674, PIN_INPUT | MUX_MODE15)    /* v3 rgmii0_rxd2.disabled */
            DRA7XX_CORE_IOPAD(0x3678, PIN_INPUT | MUX_MODE15)    /* y2 rgmii0_rxd1.disabled */
            DRA7XX_CORE_IOPAD(0x367c, PIN_INPUT | MUX_MODE15)    /* w2 rgmii0_rxd0.disabled */

            /* Slave at addr 0x1 */
            DRA7XX_CORE_IOPAD(0x3648, PIN_INPUT | MUX_MODE15)    /* v2 uart3_rxd.disabled */
            DRA7XX_CORE_IOPAD(0x364c, PIN_INPUT | MUX_MODE15)    /* y1 uart3_txd.disabled */
            DRA7XX_CORE_IOPAD(0x3650, PIN_INPUT | MUX_MODE15)    /* w9 rgmii0_txc.disabled */
            DRA7XX_CORE_IOPAD(0x3654, PIN_INPUT | MUX_MODE15)    /* v9 rgmii0_txcl.disabled */

            DRA7XX_CORE_IOPAD(0x3668, PIN_INPUT | MUX_MODE15)    /* u5 rgmii0_rxc.disabled */
            DRA7XX_CORE_IOPAD(0x366C, PIN_INPUT | MUX_MODE15)    /* v5 rgmii0_rxctl.disabled */
            DRA7XX_CORE_IOPAD(0x3670, PIN_INPUT | MUX_MODE15)    /* v4 rgmii0_rxd3.disabled */
        >;
    };

    davinci_mdio_pins_default: davinci_mdio_pins_default {
        pinctrl-single,pins = <
            /* MDIO */
            DRA7XX_CORE_IOPAD(0x363c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* V1 mdio_mclk.mdio_mclk */
            DRA7XX_CORE_IOPAD(0x3640, PIN_INPUT_PULLUP | MUX_MODE0)    /* U4 mdio_d.mdio_d */
        >;
    };

    davinci_mdio_pins_sleep: davinci_mdio_pins_sleep {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x363c, PIN_INPUT | MUX_MODE15) /* V1 mdio_mclk.disabled */
            DRA7XX_CORE_IOPAD(0x3640, PIN_INPUT | MUX_MODE15)    /* U4 mdio_d.disabled */
        >;
    };
};

&mac {
    status = "okay";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_pins_default>;
    pinctrl-1 = <&cpsw_pins_sleep>;
    rx_descs = <64>; /* Was removed from am33xx.dtsi but is needed by the CPSW driver */
    dual_emac;
};

&cpsw_emac0 {
    phy_id = <&davinci_mdio>, <0>;
    phy-mode = "rmii";
    dual_emac_res_vlan = <0>;
};

&cpsw_emac1 {
    phy_id = <&davinci_mdio>, <1>;
    phy-mode = "rmii";
    dual_emac_res_vlan = <1>;
};

&davinci_mdio {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&davinci_mdio_pins_default>;
    pinctrl-1 = <&davinci_mdio_pins_sleep>;
};

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

    phy1: ethernet-phy@2 {
        reg = <1>;
        max-speed = <100>;
    };
};



  • Hi,

    Please see http://software-dl.ti.com/processor-sdk-linux/esd/docs/06_01_00_08/linux/Foundational_Components_Kernel_Drivers.html#cpsw There is this constraint for Dual EMAC mode:

    "Both the interfaces should not be connected to the same subnet unless only configuring bridging, and not doing IP routing, then you can configure the two interfaces on the same subnet."

  • Hello Biser,

    Thank you for that hint.

    But that dont solves my problem now. I configure the interaces in two different subnet´s but it is not possible to get a working communication on eth1.

    At first I configure eth0:

    ifconfig eth0 172.16.14.55 netmask 255.255.0.0 up

    ifconfig eth1 192.168.2.1 netmask 255.255.255.0 up

    if I put the cable to the plug I get the typical links messages:

    [ 5555.071328] cpsw 48484000.ethernet eth0: Link is Down
    [ 5557.122754] cpsw 48484000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx


    [ 5660.082772] cpsw 48484000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
    [ 5660.090966] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready




    If I ping to 172.16.14.52 it works.

    If I ping to 192.168.2.100 it dont works. On this target I use wireshark and I cant get any pakets from the AM572x device.

    ------------------------------------------------------------------------------------------------------

    Than later I have mirrored the configuration and I get the same result.

    ifconfig eth1 172.16.14.55 netmask 255.255.0.0 up

    ifconfig eth0 192.168.2.1 netmask 255.255.255.0 up



  • Hi,

    Could you try connecting only eth1 (leave eth0 unconnected) and assign the ip address that you did to eth0 to eth1 and see if you can get the ping to work? We want to prove the eth1 is working.

    If I understand the topology correctly that you have described connecting eth0 and eth1 to a switch is essentially the same as connecting to the same subnet. 

    Best Regards,

    Schuyler

  • Hello Schuyler,

    I have only connected ETH1 to a switch now.Eth0 is open.


    # ifconfig eth1 172.16.14.100 netmask 255.255.0.0 up
    [   17.991674] net eth1: initializing cpsw version 1.15 (0)
    [   18.106299] SMSC LAN8710/LAN8720 48485000.mdio:01: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=48485000.mdio:01, ir)
    [   18.125974] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
    #
    # [   21.285902] cpsw 48484000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
    [   21.294188] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

    # ping 172.16.14.52
    PING 172.16.14.52 (172.16.14.52): 56 data bytes
    ^C
    --- 172.16.14.52 ping statistics ---
    12 packets transmitted, 0 packets received, 100% packet loss
    #

     

    The ethernet config is now:

    # ifconfig
    eth1      Link encap:Ethernet  HWaddr 18:62:E4:6F:3B:21  
              inet addr:172.16.14.100  Bcast:172.16.255.255  Mask:255.255.0.0
              inet6 addr: fe80::1a62:e4ff:fe6f:3b21/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:11074 errors:0 dropped:32 overruns:0 frame:0
              TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:712666 (695.9 KiB)  TX bytes:1512 (1.4 KiB)

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:12 errors:0 dropped:0 overruns:0 frame:0
              TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1344 (1.3 KiB)  TX bytes:1344 (1.3 KiB)

    If I change the config to eth0 it works.