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