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.

AM4372: Ethernet IP issue

Part Number: AM4372

Hi,

We are using dual KSZ8041RNLI ethernet ic on AM4372.

It detects the link for eth0 and eth1 separately, but can't get IP address if only one of them is plugged. 

If both of the eth0 and eth1 links are plugged; it get IP and network is OK.

I have added dts configurations and boot log and ethtool result when link is detected below.

Could you please check them to find the reason of issue ?

Thanks,

Halil

&mac {

pinctrl-names = "default";
pinctrl-0 = <&eth_pins_default>;
status = "okay";
dual_emac = <1>;
};

&davinci_mdio {
pinctrl-names = "default";
pinctrl-0 = <&eth_mdio_pins_default>;
status = "okay";
};

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

&cpsw_emac1 {
phy_id = <&davinci_mdio>, <5>;
phy-mode = "rmii";
dual_emac_res_vlan = <2>;
status = "okay";
};

[ 1.150228] libphy: Fixed MDIO Bus: probed
[ 1.229158] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[ 1.236861] davinci_mdio 4a101000.mdio: detected phy mask ffffffdc
[ 1.245987] libphy: 4a101000.mdio: probed
[ 1.250134] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Micrel KSZ8041RNLI
[ 1.259209] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver Micrel KSZ8041RNLI
[ 1.268214] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver Micrel KSZ8041RNLI
[ 1.278329] cpsw 4a100000.ethernet: Detected MACID = 50:65:83:e0:bb:a4
[ 1.285089] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[ 1.291534] cpsw 4a100000.ethernet: ALE Table size 1024
[ 1.296821] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
[ 1.304844] cpsw 4a100000.ethernet: cpsw: Detected MACID = 50:65:83:e0:bb:a6

(It is connected physically to PHY ids 1 and 5, not to 0)

root@am437x-evm:~# ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 5
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000000 (0)

Link detected: yes


[ 426.329933] cpsw 4a100000.ethernet eth1: Link is Down
[ 429.610117] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 429.618292] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

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: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/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

  • Please complete this checklist and post the results here: processors.wiki.ti.com/.../5x_CPSW

  • Hi,

    PHY is being reported and link is up on boot:

    ( It uses PHY id 1 and 5 regarding to schematic and during the boot network cable is plugged to eth1 only )

    libphy: Fixed MDIO Bus: probed
    [ 1.229163] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [ 1.236867] davinci_mdio 4a101000.mdio: detected phy mask ffffffdc
    [ 1.246001] libphy: 4a101000.mdio: probed
    [ 1.250150] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Micrel KSZ8041RNLI
    [ 1.259231] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver Micrel KSZ8041RNLI
    [ 1.268235] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver Micrel KSZ8041RNLI
    [ 1.278354] cpsw 4a100000.ethernet: Detected MACID = 50:65:83:e0:bb:a4
    [ 1.285117] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [ 1.291563] cpsw 4a100000.ethernet: ALE Table size 1024
    [ 1.296851] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [ 1.304876] cpsw 4a100000.ethernet: cpsw: Detected MACID = 50:65:83:e0:bb:a6

    [ 11.876959] net eth1: initializing cpsw version 1.15 (0)
    [ 12.029742] Micrel KSZ8041RNLI 4a101000.mdio:05: attached PHY driver [Micrel KSZ8041RNLI] (mii_bus:phy_addr=4a101000.mdio:05, irq=POLL)
    [ 12.271529] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
    [[0;32m OK [0m] Started Enable and configure wl18xx bluetooth stack.
    [ 12.758467] net eth0: initializing cpsw version 1.15 (0)
    [ 12.949791] Micrel KSZ8041RNLI 4a101000.mdio:01: attached PHY driver [Micrel KSZ8041RNLI] (mii_bus:phy_addr=4a101000.mdio:01, irq=POLL)
    [ 13.170753] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
    [ 14.250371] cpsw 4a100000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
    [ 14.373134] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
    [[0;32m OK [0m] Started Simple Network Management Protocol (SNMP) Daemon..

    ethtool eth1:

    root@am437x-evm:~# ethtool eth1
    Settings for eth1:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: Symmetric
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 5
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)
    Link detected: yes

    ethtool -S eth1:

    root@am437x-evm:~# ethtool -S eth1
    NIC statistics:
    Good Rx Frames: 0
    Broadcast Rx Frames: 0
    Multicast Rx Frames: 0
    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: 0
    Good Tx Frames: 35
    Broadcast Tx Frames: 6
    Multicast Tx Frames: 29
    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: 6667
    Rx + Tx 64 Octet Frames: 0
    Rx + Tx 65-127 Octet Frames: 19
    Rx + Tx 128-255 Octet Frames: 3
    Rx + Tx 256-511 Octet Frames: 13
    Rx + Tx 512-1023 Octet Frames: 0
    Rx + Tx 1024-Up Octet Frames: 0
    Net Octets: 6667
    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: 127
    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: 0
    Rx DMA chan 0: good_dequeue: 0
    Rx DMA chan 0: requeue: 0
    Rx DMA chan 0: teardown_dequeue: 0
    Tx DMA chan 0: head_enqueue: 35
    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: 0
    Tx DMA chan 0: empty_dequeue: 35
    Tx DMA chan 0: busy_dequeue: 0
    Tx DMA chan 0: good_dequeue: 35
    Tx DMA chan 0: requeue: 0
    Tx DMA chan 0: teardown_dequeue: 0

    ifconfig:

    root@am437x-evm:~# ifconfig
    eth0 Link encap:Ethernet HWaddr 50:65:83:E0:BB:A4
    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:47

    eth1 Link encap:Ethernet HWaddr 50:65:83:E0:BB:A6
    inet6 addr: fe80::5265:83ff:fee0:bba6/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:6527 (6.3 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:87508 errors:0 dropped:0 overruns:0 frame:0
    TX packets:87508 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:6125560 (5.8 MiB) TX bytes:6125560 (5.8 MiB)

    No wireshard / ping activity.

    root@am437x-evm:~# uname -a
    Linux am437x-evm 4.19.59-g5f8c1c6121 #1 PREEMPT Thu Feb 13 13:24:50 UTC 2020 armv7l GNU/Linux

    File system: TI SDK

    Custom board with dts:

    &mac {

    pinctrl-names = "default";
    pinctrl-0 = <&eth_pins_default>;
    status = "okay";
    dual_emac = <1>;
    };

    &davinci_mdio {
    pinctrl-names = "default";
    pinctrl-0 = <&eth_mdio_pins_default>;
    status = "okay";
    };

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

    &cpsw_emac1 {
    phy_id = <&davinci_mdio>, <5>;
    phy-mode = "rmii";
    dual_emac_res_vlan = <2>;
    status = "okay";
    };
  • Hi,

    I think you should look at why there are 3 PHY sign on messages. These messages make it look like there are 3 PHYs on the board.

    [ 1.250150] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Micrel KSZ8041RNLI
    [ 1.259231] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver Micrel KSZ8041RNLI
    [ 1.268235] davinci_mdio 4a101000.mdio: phy[5]: device 4a101000.mdio:05, driver Micrel KSZ8041RNLI

    Also look into why the HW statistics are not showing any received packets. This could be a pin mux issue.

    Best Regards,

    Schuyler