how to replace net PHY of Xavier

dear nvidia,

how to replace net PHY of Xavier? how to modify dts?where is net phy driver file ?

thanks

root@cdesktop:/home/cidi# dmesg | grep PHY
[    4.281195] eqos 2490000.ether_qos: no PHY interrupt found
[   15.656213] eth0: Could not attach to PHY
[   15.657135] net eth0: eqos_open: Cannot attach to PHY (error: -19)

root@desktop:/home/cidi# dmesg | grep phy
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 31.25MHz (phys).
[    4.277542] libphy: Fixed MDIO Bus: probed
[    4.397575] libphy: dwc_phy: probed
root@desktop:/home/cidi# dmesg | grep eth0
[   15.655204] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.656213] eth0: Could not attach to PHY
[   15.657135] net eth0: eqos_open: Cannot attach to PHY (error: -19)
[    4.281195] eqos 2490000.ether_qos: no PHY interrupt found

Hi, are you trying to use another PHY chip on your custom board? We don’t have recommended ones on this. You should ask vendor for design guide first, then follow NV’s OEM DG to do layout design. After that, you need to ask vendor for the driver and tune it on Xavier.

Please check for this thread. That’s all we could share for now.
https://devtalk.nvidia.com/default/topic/1055812/

hi Trumany,

Shouldn’t network PHY driver be general purpose driver ?

hi WayneWWW

I replaced Marvell 88E1512 with Micrel KSZ9031 Gigabit PHY;

Do I still need to write device drivers? Isn't the platform already supported ?

Sorry that we don’t know if the source already has it or not. We only support Marvell 88E1512 here.
For other PHY, please try to add the driver.

dear WayneWWW,

  This is where I saw the phy driver support list。
root@desktop:/sys/bus/mdio_bus# cd drivers
root@desktop:/sys/bus/mdio_bus/drivers# ls
'Broadcom BCM50610'   'Marvell 88E1101'   'Micrel KSZ8001 or KS8721'
'Broadcom BCM50610M'  'Marvell 88E1111'   'Micrel KSZ8021 or KSZ8031'
'Broadcom BCM5241'    'Marvell 88E1112'   'Micrel KSZ8031'
'Broadcom BCM5411'    'Marvell 88E1116R'  'Micrel KSZ8041'
'Broadcom BCM5421'    'Marvell 88E1118'   'Micrel KSZ8041RNLI'
'Broadcom BCM5461'    'Marvell 88E1121R'  'Micrel KSZ8051'
'Broadcom BCM54616S'  'Marvell 88E1145'   'Micrel KSZ8061'
'Broadcom BCM5464'    'Marvell 88E1149R'  'Micrel KSZ8081 or KSZ8091'
'Broadcom BCM5481'    'Marvell 88E1240'   'Micrel KSZ8795'
'Broadcom BCM5482'    'Marvell 88E1318S'  'Micrel KSZ886X Switch'
'Broadcom BCM57780'   'Marvell 88E1510'   'Micrel KSZ8873MLL Switch'
'Broadcom BCM89610'   'Marvell 88E1512'   'Micrel KSZ9021 Gigabit PHY'
'Broadcom BCMAC131'   'Marvell 88E1540'  <b> 'Micrel KSZ9031 Gigabit PHY</b>'
'Generic 10G PHY'     'Marvell 88E3016'
'Generic PHY'         'Micrel KS8737'
root@desktop:/sys/bus/mdio_bus/drivers#

If you don’t see any device under /sys/bus/mdio_bus/devices, please try to trace the eqos driver. It may indicate the device tree is not correct.

The corresponding device tree is “tegra194-platforms-eqos.dtsi”.

dear WayneWWW,

 How to modify DTS specifically.Can you provide relevant templates?

 thanks!!

My modify as follow:

56                         phy0: ethernet-phy@0 {
 57                                 //add
 58                                 compatible = "micrel,ksz9031";
 59 
 60                                 reg = <0>;
 61                                 interrupt-parent = <&tegra_main_gpio>;
 62                                 interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
 63                                 //marvell,copper-mode;
 64                                 micrel,copper-mode;
 65                                 /* Setup LED[2] as interrupt pin (active low) */
 66                                 //marvell,reg-init = <0x03 0x12 0x7fff 0x880>;
 67                                 micrel,reg-init = <0x03 0x12 0x7fff 0x880>;

only appear this device

root@desktop:/sys/bus/mdio_bus/devices# ls
dwc_phy-1:00
root@desktop:/sys/bus/mdio_bus/devices#

You could check external resource for it.

dear WayneWWW,

  my modify as follow:
2                 phy-mode = "rgmii-id";
 43 //              phy-handle = <&phy0>;
 44 
 45                 //add
 46                 fixed-link{
 47                 speed = <1000>;
 48                 full-duplex;
 49                 };
 50 
 51                 mdio {
 52                         compatible = "nvidia,eqos-mdio";
 53                         #address-cells = <1>;
 54                         #size-cells = <0>;
 55 
 56                         phy0: ethernet-phy@0 {
 57                                 //add
 58                                 compatible = "micrel,ksz9031";
 59                                 //compatible = "micrel,ksz9031 gigabit phy";
 60                                 //compatible = "Micrel,KSZ9031 Gigabit PHY";
 61                                 //compatible = "";
 62 
 63                                 reg = <0>;
 64                                 interrupt-parent = <&tegra_main_gpio>;
 65                                 interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>;
 66                                 //marvell,copper-mode;
 67                                 micrel,copper-mode;
 68                                 /* Setup LED[2] as interrupt pin (active low) */
 69                                 //marvell,reg-init = <0x03 0x12 0x7fff 0x880>;
 70                                 micrel,reg-init = <0x03 0x12 0x7fff 0x880>;
 71                         };

ifconfig

-desktop:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.18.0.176  netmask 255.255.254.0  broadcast 172.18.1.255
        inet6 fe80::f4ae:6e84:c1b3:874a  prefixlen 64  scopeid 0x20<link>
        ether 00:04:4b:cb:dd:90  txqueuelen 1000  (Ethernet)
        RX packets 24214  bytes 1496885 (1.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 379  bytes 38890 (38.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 40  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 268  bytes 22800 (22.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 268  bytes 22800 (22.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Does this mean my PHY is working properly, or is it a system simulated network card?

Assuming this still uses DHCP, and that nothing is assigning a static IP address, then the address wouldn’t exist unless the router replied to offer the address and the Xavier saw the reply. Is the network address assigned by router?

Hello Jia ZW
I also use the ksz9031 chip, which is still not connected to the Internet. Did you solve this problem? Did you change those files or configuration? Thank you!