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: dual_emac eth1 receiving data but not sending

Part Number: AM5726

Hello,

We developed a custom board with AM5726.
We are using ti-processor-sdk kernel linux-4.19.79-rt28 commit 5baf382c8f566e7ab46a144eed51b639dec32841.

I'm having problems with the second ethernet interface of the cpsw in dual_emac configuration and phy-mode rmii.

This is still the same issue as my colleague posted in https://e2e.ti.com/support/processors/f/791/t/863091


Link detection and interface configuration work fine.

eth0 works as expected.
eth1 can receive but not send.


Here is the tcpdump output of "arping -b -I enx8cae4cfdd47b -c5 192.168.0.99" from Ubuntu VM to the custom board (direct cable connection; USB network adapter mapped into VM; nothing in between, no firewall).
Only eth1 is connected.


VM sends the request but does not receive the reply:

17:42:21.579408 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 28
17:42:22.580473 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 28
17:42:23.580821 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 28
17:42:24.581833 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 28
17:42:25.582174 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 28


Custom board receives the request and sends the reply:

00:01:04.779672 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 46
00:01:04.781305 ARP, Reply 192.168.0.99 is-at 18:62:e4:6f:58:21 (oui Unknown), length 28
00:01:05.780758 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 46
00:01:05.780919 ARP, Reply 192.168.0.99 is-at 18:62:e4:6f:58:21 (oui Unknown), length 28
00:01:06.781135 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 46
00:01:06.781291 ARP, Reply 192.168.0.99 is-at 18:62:e4:6f:58:21 (oui Unknown), length 28
00:01:07.782168 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 46
00:01:07.782323 ARP, Reply 192.168.0.99 is-at 18:62:e4:6f:58:21 (oui Unknown), length 28
00:01:08.782464 ARP, Request who-has 192.168.0.99 (Broadcast) tell 192.168.0.2, length 46
00:01:08.782619 ARP, Reply 192.168.0.99 is-at 18:62:e4:6f:58:21 (oui Unknown), length 28


Any ideas what we could try to fix this or narrow down?

Please let me know if you need any more info.



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: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes

ethtool -S eth1
NIC statistics:
     Good Rx Frames: 8
     Broadcast Rx Frames: 5
     Multicast Rx Frames: 3
     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: 881
     Good Tx Frames: 16
     Broadcast Tx Frames: 0
     Multicast Tx Frames: 11
     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: 1250
     Rx + Tx 64 Octet Frames: 5
     Rx + Tx 65-127 Octet Frames: 16
     Rx + Tx 128-255 Octet Frames: 3
     Rx + Tx 256-511 Octet Frames: 0
     Rx + Tx 512-1023 Octet Frames: 0
     Rx + Tx 1024-Up Octet Frames: 0
     Net Octets: 2131
     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: 133
     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: 6
     Rx DMA chan 0: good_dequeue: 6
     Rx DMA chan 0: requeue: 0
     Rx DMA chan 0: teardown_dequeue: 0
     Tx DMA chan 0: head_enqueue: 16
     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: 5
     Tx DMA chan 0: empty_dequeue: 16
     Tx DMA chan 0: busy_dequeue: 0
     Tx DMA chan 0: good_dequeue: 16
     Tx DMA chan 0: requeue: 0
     Tx DMA chan 0: teardown_dequeue: 0



ifconfig
eth0      Link encap:Ethernet  HWaddr 18:62:E4:6F:58:20
          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:75

eth0:1    Link encap:Ethernet  HWaddr 18:62:E4:6F:58:20
          inet addr:10.10.1.99  Bcast:10.10.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:75

eth0:2    Link encap:Ethernet  HWaddr 18:62:E4:6F:58:20
          inet addr:172.16.10.99  Bcast:172.16.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:75

eth0:3    Link encap:Ethernet  HWaddr 18:62:E4:6F:58:20
          inet addr:192.109.223.254  Bcast:192.109.223.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Interrupt:75

eth1      Link encap:Ethernet  HWaddr 18:62:E4:6F:58:21
          inet6 addr: fe80::1a62:e4ff:fe6f:5821/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:507 (507.0 B)  TX bytes:1256 (1.2 KiB)

eth1:1    Link encap:Ethernet  HWaddr 18:62:E4:6F:58:21
          inet addr:192.168.0.99  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2396 (2.3 KiB)  TX bytes:2396 (2.3 KiB)





DTS:

&dra7_pmx_core {
	cpsw_pins_default: cpsw_pins_default {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3658, PIN_INPUT_PULLDOWN | MUX_MODE1)	/* v7 rgmii0_txd3.rmii0_crs */
			DRA7XX_CORE_IOPAD(0x365c, PIN_INPUT_PULLDOWN | MUX_MODE1)	/* u7 rgmii0_txd2.rmii0_rxer */
			DRA7XX_CORE_IOPAD(0x3660, PIN_INPUT_PULLDOWN | MUX_MODE1)	/* v6 rgmii0_txd1.rmii0_rxd1 */
			DRA7XX_CORE_IOPAD(0x3664, PIN_INPUT_PULLDOWN | MUX_MODE1)	/* u6 rgmii0_txd0.rmii0_rxd0 */
			DRA7XX_CORE_IOPAD(0x3674, PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* v3 rgmii0_rxd2.rmii0_txen */
			DRA7XX_CORE_IOPAD(0x3678, PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* y2 rgmii0_rxd1.rmii0_txd1 */
			DRA7XX_CORE_IOPAD(0x367c, PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* w2 rgmii0_rxd0.rmii0_txd0 */

			DRA7XX_CORE_IOPAD(0x3648, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* v2 uart3_rxd.rmii1_crs */
			DRA7XX_CORE_IOPAD(0x364c, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* y1 uart3_txd.rmii1_rxer */
			DRA7XX_CORE_IOPAD(0x3650, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* w9 rgmii0_txc.rmii1_rxd1 */
			DRA7XX_CORE_IOPAD(0x3654, PIN_INPUT_PULLDOWN | MUX_MODE2)	/* v9 rgmii0_txctl.rmii1_rxd0 */
			DRA7XX_CORE_IOPAD(0x3668, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* u5 rgmii0_rxc.rmii1_txen */
			DRA7XX_CORE_IOPAD(0x366C, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* v5 rgmii0_rxctl.rmii1_txd1 */
			DRA7XX_CORE_IOPAD(0x3670, PIN_OUTPUT_PULLDOWN | MUX_MODE2)	/* v4 rgmii0_rxd3.rmii1_txd0 */
		>;
	};

	cpsw_pins_sleep: cpsw_pins_sleep {
		pinctrl-single,pins = <
			DRA7XX_CORE_IOPAD(0x3658, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* v7 rgmii0_txd3.disabled */
			DRA7XX_CORE_IOPAD(0x365c, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* u7 rgmii0_txd2.disabled */
			DRA7XX_CORE_IOPAD(0x3660, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* v6 rgmii0_txd1.disabled */
			DRA7XX_CORE_IOPAD(0x3664, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* u6 rgmii0_txd0.disabled */
			DRA7XX_CORE_IOPAD(0x3674, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* v3 rgmii0_rxd2.disabled */
			DRA7XX_CORE_IOPAD(0x3678, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* y2 rgmii0_rxd1.disabled */
			DRA7XX_CORE_IOPAD(0x367c, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* w2 rgmii0_rxd0.disabled */

			DRA7XX_CORE_IOPAD(0x3648, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* v2 uart3_rxd.disabled */
			DRA7XX_CORE_IOPAD(0x364c, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* y1 uart3_txd.disabled */
			DRA7XX_CORE_IOPAD(0x3650, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* w9 rgmii0_txc.disabled */
			DRA7XX_CORE_IOPAD(0x3654, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* v9 rgmii0_txcl.disabled */
			DRA7XX_CORE_IOPAD(0x3668, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* u5 rgmii0_rxc.disabled */
			DRA7XX_CORE_IOPAD(0x366C, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* v5 rgmii0_rxctl.disabled */
			DRA7XX_CORE_IOPAD(0x3670, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* v4 rgmii0_rxd3.disabled */
		>;
	};

	davinci_mdio_pins_default: davinci_mdio_pins_default {
		pinctrl-single,pins = <
			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_PULLDOWN | MUX_MODE15) /* V1 mdio_mclk.disabled */
			DRA7XX_CORE_IOPAD(0x3640, PIN_INPUT_PULLDOWN | MUX_MODE15)	/* U4 mdio_d.disabled */
		>;
	};
};

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

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

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

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

&cpsw_emac0 {
	phy-handle = <&phy0>;

	phy-mode = "rmii";

	dual_emac_res_vlan = <1>;
};

&cpsw_emac1 {
	phy-handle = <&phy1>;

	phy-mode = "rmii";

	dual_emac_res_vlan = <2>;
};

  • Hi Andreas,

    Based on your query, I understand that custom board is replying back but the reply is not seen on the VM.

    Can you please run wireshark on your host PC's native OS (I mean the OS on which you are running Ubuntu VM) and check whether the repsonse is received?

    This will help us to root down on whether the issue is in VM network configuration or the board.

    Regards

    Santhana Bharathi

  • Hello Santhana,

    I tested with the native OS (Windows 10) and also with another PC (Linux).

    The behavior is the same as described.

    Best regards

    Andreas

  • Hi,

    It seems the issue was with the external clock not being connected properly.
    I also moved the pinmuxing to uboot according to errata i869.
    Now most of the time both eth0 and eth1 work in terms of general communication.

    But there are some other issues.

    1. Sometimes the phys are not detected on boot.
    According to https://patchwork.kernel.org/patch/9689903/ there can be such issues because AM572x could leave the PHYs at an invalid state during power up/reset. And PHYs have to be reset via a GPIO.
    On our board PHY reset is directly connected to ball F23 (rstoutn).
    Would you advise to change that to a GPIO so the driver can reset the PHYs?

    2. On both interfaces there is packet loss
    ethtool -S shows Rx CRC and Align/Code Errors
    Good Rx Frames: 9758
    Broadcast Rx Frames: 7517
    Multicast Rx Frames: 1723
    Pause Rx Frames: 0
    ->Rx CRC Errors: 406
    ->Rx Align/Code Errors: 474
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 9
    Rx Octets: 1272809

    Any advice on that?

    Best regards
    Andreas

  • Hello again,

    Issue 1. from last post has been solved by giving each PHY its own reset GPIO.
    Issue 2. remains.

    I will close this thread as resolved.
    We will continue to look for the source of number 2 which is probably a hardware/layout issue.

    Best regards

    Andreas