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/PROCESSOR-SDK-AM437X: Ethernet link issue

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: AM4372

Tool/software: Linux

Dear Sir:

         we use custom board AM437X+RTL8201 Ethernet PHY for 10/100M RJ45 Port.

         RTL8201 only support MII or RMII mode. now it is MII mode in default.

         its phy address is 1.

         Now the interface eth0 can't link up. it is not ready.

         Can you give us some advice ?

         our device tree as below:

cpsw_default: cpsw_default {
pinctrl-single,pins = <
/* Slave 1 */
AM4372_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txen.rgmii1_txen */
AM4372_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxdv.rgmii1_rxctl */
AM4372_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii1_txd3 */
AM4372_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii1_txd2 */
AM4372_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd1.rgmii1_txd1 */
AM4372_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txd0.rgmii1_txd0 */
AM4372_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mii1_txclk.rmii1_tclk */
AM4372_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxclk.rmii1_rclk */
AM4372_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd1.rgmii1_rxd3 */
AM4372_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd0.rgmii1_rxd2 */
AM4372_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd1.rgmii1_rxd1 */
AM4372_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2) /* mii1_rxd0.rgmii1_rxd0 */
AM4372_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE0)
AM4372_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE0)
AM4372_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE0)
>;
};

cpsw_sleep: cpsw_sleep {
pinctrl-single,pins = <
/* Slave 1 reset value */
AM4372_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
};

davinci_mdio_default: davinci_mdio_default {
pinctrl-single,pins = <
/* MDIO */
AM4372_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
AM4372_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */
>;
};

davinci_mdio_sleep: davinci_mdio_sleep {
pinctrl-single,pins = <
/* MDIO reset value */
AM4372_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7)
AM4372_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
};

&mac {
slaves = <1>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
status = "okay";
};

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

&cpsw_emac0 {
phy_id = <&davinci_mdio>, <1>;
phy-mode = "rgmii";
};

         Please check our Sch. as below.

          please see the console log as below:

[ 1.150150] libphy: Fixed MDIO Bus: probed
[ 1.222491] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[ 1.228588] davinci_mdio 4a101000.mdio: detected phy mask fffffffc
[ 1.236182] libphy: 4a101000.mdio: probed
[ 1.240202] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver RTL8201F 10/100Mbps Ethernet
[ 1.250098] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver RTL8201F 10/100Mbps Ethernet
[ 1.260700] cpsw 4a100000.ethernet: Detected MACID = 60:64:05:5d:3f:69
[ 1.267480] cpsw 4a100000.ethernet: device node lookup for pps timer failed
[ 1.274514] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[ 1.282515] cpsw 4a100000.ethernet: cpsw: Detected MACID = 60:64:05:5d:3f:6b
[ 1.290854] mousedev: PS/2 mouse device common for all mice
[ 1.296802] i2c /dev entries driver
[ 1.301999] cpuidle: enable-method property 'ti,am4372' found operations
[ 1.309742] omap_hsmmc 48060000.mmc: Got CD GPIO
[ 1.315451] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.323847] NET: Registered protocol family 10
[ 1.329482] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 1.336122] NET: Registered protocol family 17

[   17.923258] net eth0: initializing cpsw version 1.15 (0)

[ 18.083953] RTL8201F 10/100Mbps Ethernet 4a101000.mdio:01: attached PHY driver [RTL8201F 10/100Mbps Ethernet] (mii_bus:phy_addr=4a101000.mdio:01, irq=-1)
[ 18.088241] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

  • Dear Sir:
    some debug info as below:
    root@am437x-evm:~# ifconfig
    eth0 Link encap:Ethernet HWaddr 60:64:05:5D:3F:69
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:139

    eth1 Link encap:Ethernet HWaddr 60:64:05:5D:3F:6B
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

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

    root@am437x-evm:~# ethtool eth0
    Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Speed: 10Mb/s
    Duplex: Half
    Port: MII
    PHYAD: 1
    Transceiver: external
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)

    Link detected: no
  • Dear Sir:
    Sorry, we make the RTL8201 as EtherCAT port.
  • Dear Sir:
    In device tree we also check
    &mac {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_default>;
    pinctrl-1 = <&cpsw_sleep>;
    dual_emac = <1>;
    status = "okay";
    };

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

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

    &cpsw_emac1 {
    phy_id = <&davinci_mdio>, <4>;
    phy-mode = "rgmii";
    dual_emac_res_vlan = <2>;
    };
  • Dear Sir:
    It is strange about the pin AM437X_MII1_TXCLK and AM437X_MII1_RXCLK.
    we measure it only 1.25MHz.
  • What Linux version is this?
  • Dear Biser:
    we use SDK ti-processor-sdk-linux-am437x-evm-04.03.00.05-Linux-x86-Install.bin.

    It include u-boot-2017.01+gitAUTOINC+c68ed086bd-gc68ed086bd and linux-4.9.69+gitAUTOINC+9ce43c71ae-g9ce43c71ae
  • Dear Biser:
    Our RTL8201 work on MII Mode.
    So how to configure the all used Pins mux to MII mode ?

    We found that there is no pinmux for MII mode, only there is RGMII, RMII, GMII.
    so we configure the pins to gmii interface. and we set gmii-sel to 0x4. so gmii0 will in GMII/MII mode.
    is it right ?
  • Hi,

    Depending on the issue the clock is reflecting what ethtool has assumed for the line which is 10Mbps and half duplex. This is the default speed for a link not detected.

    Did you use the pin tool to generate the pin mux DTS for the custom board? Please confirm with the pin mux tool but the solution maybe changing your default and sleep pin mux entries from mux mode 2 to mux mode 0.

    Best Regards,
    Schuyler
  • Dear Schuyler:
    we have set the pin mux from mux mode 2 to mux mode 0.
    but it still can't detect link.

    cpsw_default: cpsw_default {
    pinctrl-single,pins = <
    /* Slave 1 */
    AM4372_IOPAD(0x92c, PIN_INPUT | MUX_MODE0) /* mii1_txclk.gmii1_txclk */
    AM4372_IOPAD(0x914, PIN_OUTPUT | MUX_MODE0) /* mii1_txen.gmii1_txen */
    AM4372_IOPAD(0x928, PIN_OUTPUT | MUX_MODE0) /* mii1_txd0.gmii1_txd0 */
    AM4372_IOPAD(0x924, PIN_OUTPUT | MUX_MODE0) /* mii1_txd1.gmii1_txd1 */
    AM4372_IOPAD(0x920, PIN_OUTPUT | MUX_MODE0) /* mii1_txd0.gmii1_txd2 */
    AM4372_IOPAD(0x91c, PIN_OUTPUT | MUX_MODE0) /* mii1_txd1.gmii1_txd3 */
    AM4372_IOPAD(0x930, PIN_INPUT | MUX_MODE0) /* mii1_rxclk.gmii1_rcclk */
    AM4372_IOPAD(0x918, PIN_INPUT | MUX_MODE0) /* mii1_rxdv.gmii1_rxdv */
    AM4372_IOPAD(0x940, PIN_INPUT | MUX_MODE0) /* mii1_rxd0.gmii1_rxd0 */
    AM4372_IOPAD(0x93c, PIN_INPUT | MUX_MODE0) /* mii1_rxd1.gmii1_rxd1 */
    AM4372_IOPAD(0x938, PIN_INPUT | MUX_MODE0) /* mii1_rxd0.gmii1_rxd2 */
    AM4372_IOPAD(0x934, PIN_INPUT | MUX_MODE0) /* mii1_rxd1.gmii1_rxd3 */
    AM4372_IOPAD(0x90c, PIN_INPUT | MUX_MODE0) /* mii1_crs.gmii1_crs */
    AM4372_IOPAD(0x910, PIN_INPUT | MUX_MODE0) /* mii1_rxerr.gmii1_rxer */
    AM4372_IOPAD(0x908, PIN_INPUT | MUX_MODE0) /* mii1_col.gmii1_col */


    cpsw_sleep: cpsw_sleep {
    pinctrl-single,pins = <
    /* Slave 1 reset value */
    AM4372_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7)
    AM4372_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE7)