RGMII PHY KSZ9131 no transfer data

Hello.

I have successfully (I think so) added RGMII to device tree, but the ethernet does not work, there is no data transfer.

#include "staging/tegra234-p3737-0000+p3701-0004.dts"
#include "tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi"
#include "tegra234-p3701-0000.dtsi"
#include <dt-bindings/gpio/tegra234-gpio.h>
/ {
bus@0{
        ethernet@6800000 {
                status = "disabled";
        };
	ethernet@2310000 {
		status = "okay";
		nvidia,mac-addr-idx = <0>;
		nvidia,phy-reset-gpio = <&gpio TEGRA234_MAIN_GPIO(G, 5) 0>;
		phy-mode = "rgmii-id";
		phy-handle = <&phy>;

		mdio {
			compatible = "nvidia,eqos-mdio";
			#address-cells = <1>;
			#size-cells = <0>;

			phy: phy@3 {        
				reg = <3>;    
				nvidia,phy-rst-pdelay-msec = <224>; /* msec */
				nvidia,phy-rst-duration-usec = <10000>; /* usec */
				interrupt-parent = <&gpio>; 
				interrupts = <TEGRA234_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
			};
		};
	};
	};
};

Log entries show specific problems:

jetson@ubuntu:~$ sudo dmesg | grep -i eth
[    0.278987] igb: Intel(R) Gigabit Ethernet Network Driver
[    9.901731] nvpps c6a0000.nvpps: primary-emac found ethernet@6800000
[    9.901746] nvpps c6a0000.nvpps: using ptp notifier method on emac ethernet@6800000
[    9.984710] nvethernet 2310000.ethernet: Adding to iommu group 48
**[    9.985242] nvethernet 2310000.ethernet: failed to read skip mac reset flag, default 0**
**[    9.985246] nvethernet 2310000.ethernet: failed to read MDIO address**
[    9.985249] nvethernet 2310000.ethernet: Failed to read nvida,pause_frames, so setting to default support as disable
[    9.985252] nvethernet 2310000.ethernet: setting to default DMA bit mask
[    9.985259] nvethernet 2310000.ethernet: max-platform-mtu DT entry missing, setting default 1500
[   10.227917] nvethernet 2310000.ethernet: Ethernet MAC address: 48:b0:2d:94:9d:9f
[   10.292869] nvethernet 2310000.ethernet: Macsec not enabled
[   10.292873] nvethernet 2310000.ethernet: Macsec: Reduced MTU: 1466 Max: 1500
[   10.302599] nvethernet 2310000.ethernet: eth0 (HW ver: 53) created with 8 DMA channels
[   13.666888] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   13.667220] nvethernet 2310000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   17.477847] using random self ethernet address
[   17.477854] using random host ethernet address
[   17.698059] using random self ethernet address
[   17.698066] using random host ethernet address
jetson@ubuntu:~$ sudo ethtool eth0
Settings for eth0:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/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
                                1000baseT/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
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: master
        Port: Twisted Pair
        PHYAD: 3
        Transceiver: external
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes

I checked the reset and interupts:

jetson@ubuntu:~$ sudo cat /sys/kernel/debug/gpio |grep PG
 gpio-347 (PGG.00              )
 gpio-383 (PG.00               |Force Recovery      ) in  hi IRQ ACTIVE LOW
 gpio-384 (PG.01               )
 gpio-385 (PG.02               |Suspend             ) in  hi IRQ ACTIVE LOW
 gpio-386 (PG.03               )
 gpio-387 (PG.04               )
 gpio-388 (PG.05               |phy_reset           ) out hi
 gpio-389 (PG.06               )
 gpio-390 (PG.07               |cd                  ) in  hi IRQ ACTIVE LOW

After link up / down interrupt counts increace

jetson@ubuntu:~$ cat /proc/interrupts | grep eth
199:          3          0          0          0          0          0          0          0     GICv3 226 Level     eth0.common_irq
200:        622          0          0          0          0          0          0          0     GICv3 218 Level     eth0.vm0
201:          0          0          0          0          0          0          0          0     GICv3 219 Level     eth0.vm1
202:          0          0          0          0          0          0          0          0     GICv3 220 Level     eth0.vm2
203:          0          0          0          0          0          0          0          0     GICv3 221 Level     eth0.vm3
286:          9          0          0          0          0          0          0          0  2200000.gpio  39 Level     2310000.ethernet:03
jetson@ubuntu:~$ sudo ifconfig eth0 down
jetson@ubuntu:~$ sudo ifconfig eth0 up
jetson@ubuntu:~$ cat /proc/interrupts | grep eth
199:          4          0          0          0          0          0          0          0     GICv3 226 Level     eth0.common_irq
200:        623          0          0          0          0          0          0          0     GICv3 218 Level     eth0.vm0
201:          0          0          0          0          0          0          0          0     GICv3 219 Level     eth0.vm1
202:          0          0          0          0          0          0          0          0     GICv3 220 Level     eth0.vm2
203:          0          0          0          0          0          0          0          0     GICv3 221 Level     eth0.vm3
286:         11          0          0          0          0          0          0          0  2200000.gpio  39 Level     2310000.ethernet:03

The connection is successfully established on one gigabit but the data is not transferred:

j

etson@ubuntu:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1466
        inet 192.168.2.6  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::4ab0:2dff:fe94:9d9f  prefixlen 64  scopeid 0x20<link>
        ether 48:b0:2d:94:9d:9f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4068  bytes 181834 (181.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Hi,

  1. Please check

/sys/bus/mdio_bus/devices/

And there should be something like 2310000.etherent.
Please also check what is the “driver” directory under 2310000.etherent. pointing to.

  1. It looks like TX are alive but RX are dead. Please double check your pinmux setting is correct or not.
busybox devmem 0x02434070: 
busybox devmem 0x02434078: 
busybox devmem 0x02445058: 
busybox devmem 0x02445018: 
busybox devmem 0x02445010: 
busybox devmem 0x02445008: 
busybox devmem 0x02445000: 
busybox devmem 0x02445068: 
busybox devmem 0x02445040:
busybox devmem 0x02445030: 
busybox devmem 0x02445028: 
busybox devmem 0x02445020: 
busybox devmem 0x02445070:
busybox devmem 0x02445060: 
busybox devmem 0x02445038: 
busybox devmem 0x02445048: 
busybox devmem 0x02445050:

Hello.

Checked it again

In Linux_for_Tegra/jetson-agx-orin-devkit.conf if find
source “${LDK_DIR}/p3737-0000-p3701-0000.conf.common”;

In this file i find
PINMUX_CONFIG=“tegra234-mb1-bct-pinmux-p3701-0000.dtsi”;

In tegra234-mb1-bct-pinmux-p3701-0000.dtsi i adding records:

			eqos_txc_pe0 {
				nvidia,pins = "eqos_txc_pe0";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

			eqos_td0_pe1 {
				nvidia,pins = "eqos_td0_pe1";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

			eqos_td1_pe2 {
				nvidia,pins = "eqos_td1_pe2";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

			eqos_td2_pe3 {
				nvidia,pins = "eqos_td2_pe3";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

			eqos_td3_pe4 {
				nvidia,pins = "eqos_td3_pe4";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

			eqos_tx_ctl_pe5 {
				nvidia,pins = "eqos_tx_ctl_pe5";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

			eqos_rd0_pe6 {
				nvidia,pins = "eqos_rd0_pe6";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

			eqos_rd1_pe7 {
				nvidia,pins = "eqos_rd1_pe7";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

			eqos_rd2_pf0 {
				nvidia,pins = "eqos_rd2_pf0";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

			eqos_rd3_pf1 {
				nvidia,pins = "eqos_rd3_pf1";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

			eqos_rx_ctl_pf2 {
				nvidia,pins = "eqos_rx_ctl_pf2";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

			eqos_rxc_pf3 {
				nvidia,pins = "eqos_rxc_pf3";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

			eqos_sma_mdio_pf4 {
				nvidia,pins = "eqos_sma_mdio_pf4";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
			};

			eqos_sma_mdc_pf5 {
				nvidia,pins = "eqos_sma_mdc_pf5";
				nvidia,function = "eqos";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
			};

After all, i flashing orin:
sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1
.

Then I read the registers, and it’s not at all what I expect to read:

EQOS_TXC 	sudo busybox devmem 0x02434058 		0x00000058
EQOS_TD0 	sudo busybox devmem 0x02434018		0x00000001
EQOS_TD1 	sudo busybox devmem 0x02434010		0x00000002
EQOS_TD2 	sudo busybox devmem 0x02434008		0x00000001
EQOS_TD3 	sudo busybox devmem 0x02434000		0x00000000
EQOS_TX_CTL 	sudo busybox devmem 0x02434068		0x00000000


EQOS_RXC  	sudo busybox devmem 0x02434060 		0x00001058
EQOS_RD0 	sudo busybox devmem 0x02434040		0x00000054
EQOS_RD1 	sudo busybox devmem 0x02434030		0x00000460
EQOS_RD2 	sudo busybox devmem 0x02434028		0x00001460
EQOS_RD3 	sudo busybox devmem 0x02434020	 	0x00000002
EQOS_RX_CTL  	sudo busybox devmem 0x02434070    	0x00000058

EQOS_SMA_MDIO 	sudo busybox devmem 0x02434038		0x00000058
EQOS_SMA_MDC 	sudo busybox devmem 0x02434048		0x00000000

What could be the reason?

Please go back to previous post and use similar method to check things again…

Your flash log gives this:

copying pinmux_config(/home/jetson/Jetson_RT/Linux_for_Tegra/bootloader/generic/BCT/tegra234-mb1-bct-pinmux-p3701-0000-a04.dtsi

Which means your pinmux is not tegra234-mb1-bct-pinmux-p3701-0000.dtsi…

I made a mistake with the offset, below are the correct register values:

EQOS_TXC 	sudo busybox devmem 0x02445058 		0x00002400
EQOS_TD0 	sudo busybox devmem 0x02445018		0x00002400
EQOS_TD1 	sudo busybox devmem 0x02445010		0x00002400
EQOS_TD2 	sudo busybox devmem 0x02445008		0x00002400
EQOS_TD3 	sudo busybox devmem 0x02445000		0x00002400
EQOS_TX_CTL 	sudo busybox devmem 0x02445068		0x00002400


EQOS_RXC  	sudo busybox devmem 0x02445060 		0x00002458
EQOS_RD0 	sudo busybox devmem 0x02445040		0x00002458
EQOS_RD1 	sudo busybox devmem 0x02445030		0x00002458
EQOS_RD2 	sudo busybox devmem 0x02445028		0x00002458
EQOS_RD3 	sudo busybox devmem 0x02445020	 	0x00002458
EQOS_RX_CTL  	sudo busybox devmem 0x02445070    	0x00002458

EQOS_SMA_MDIO 	sudo busybox devmem 0x02445038		0x00002440
EQOS_SMA_MDC 	sudo busybox devmem 0x02445048		0x00002400

ENET_RST_N      sudo busybox devmem 0x02434078          0x00000000
ENET_INT_N	sudo busybox devmem 0x02434078		0x00000058

Looks correct, but ethernet still doesn’t work.

Pinging 192.168.2.6 with 32 bytes of data:
Request timed out.
PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.
From 192.168.2.6 icmp_seq=1 Destination Host Unreachable
From 192.168.2.6 icmp_seq=2 Destination Host Unreachable
From 192.168.2.6 icmp_seq=3 Destination Host Unreachable
--- 192.168.2.2 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3066ms
pipe 3

Then please contact with PHY vendor about the debug method.

There is nothing from our side to check. No obvious error log.

What about these errors? Perhaps they are the reason?

No they are not the reason. These logs will appear even in working case.

Pinging 192.168.2.6 with 32 bytes of data:
Reply from 192.168.2.6: bytes=32 time=1ms TTL=64
Reply from 192.168.2.6: bytes=32 time=1ms TTL=64
Reply from 192.168.2.6: bytes=32 time=1ms TTL=64
Reply from 192.168.2.6: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.2.6:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)

Thanks for the help!
There was an error in the board.

1 Like

Maybe you could share what kind of error is that as a record.

RX[3:0] → RX[0:3].
As i understand, this cannot be cured programmatically.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.