imx8mp eqos ethernet up/down issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mp eqos ethernet up/down issue

2,394 Views
vprajapati
Contributor II

I am working on a imx8mp based custom board. I am using single ethernet of eqos port and KSZ9131 ethernet Phy.  I have disabled feos and configured eqos RGMI interface as per our schematic design. 

 

&eqos {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_eqos>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy0>;
	status = "okay";

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

		ethphy0: ethernet-phy@3 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <3>;
			eee-broken-1000t;
			reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
			reset-assert-us = <10000>;
			reset-deassert-us = <80000>;
		};
	};
};

&fec {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec>;
	phy-mode = "rgmii-id";
	phy-handle = <&ethphy1>;
	fsl,magic-packet;
	status = "disabled";

	mdio {
		#address-cells = <1>;
		#size-cells = <0>;

		ethphy1: ethernet-phy@1 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <1>;
			eee-broken-1000t;
			reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
			reset-assert-us = <10000>;
			reset-deassert-us = <80000>;
			realtek,aldps-enable;
			realtek,clkout-disable;
		};
	};
};

	pinctrl_eqos: eqosgrp {
		fsl,pins = <
			MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC				0x2
			MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO				0x2
			MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0			0x90
			MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1			0x90
			MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2			0x90
			MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3			0x90
			MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK	0x90
			MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL		0x90
			MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0			0x16
			MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1			0x16
			MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2			0x16
			MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3			0x16
			MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL		0x16
			MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK	0x16
			MX8MP_IOMUXC_SAI2_RXC__GPIO4_IO22				0x10
		>;
	};

	pinctrl_fec: fecgrp {
		fsl,pins = <
			MX8MP_IOMUXC_SAI1_RXD2__ENET1_MDC		0x2
			MX8MP_IOMUXC_SAI1_RXD3__ENET1_MDIO		0x2
			MX8MP_IOMUXC_SAI1_RXD4__ENET1_RGMII_RD0		0x90
			MX8MP_IOMUXC_SAI1_RXD5__ENET1_RGMII_RD1		0x90
			MX8MP_IOMUXC_SAI1_RXD6__ENET1_RGMII_RD2		0x90
			MX8MP_IOMUXC_SAI1_RXD7__ENET1_RGMII_RD3		0x90
			MX8MP_IOMUXC_SAI1_TXC__ENET1_RGMII_RXC		0x90
			MX8MP_IOMUXC_SAI1_TXFS__ENET1_RGMII_RX_CTL	0x90
			MX8MP_IOMUXC_SAI1_TXD0__ENET1_RGMII_TD0		0x16
			MX8MP_IOMUXC_SAI1_TXD1__ENET1_RGMII_TD1		0x16
			MX8MP_IOMUXC_SAI1_TXD2__ENET1_RGMII_TD2		0x16
			MX8MP_IOMUXC_SAI1_TXD3__ENET1_RGMII_TD3		0x16
			MX8MP_IOMUXC_SAI1_TXD4__ENET1_RGMII_TX_CTL	0x16
			MX8MP_IOMUXC_SAI1_TXD5__ENET1_RGMII_TXC		0x16
			MX8MP_IOMUXC_SAI1_RXD0__GPIO4_IO02		0x10
		>;
	};

 


I am facing an issue that the board sometimes gets an IP address and sometimes doesnot get IP.  When I checked dmesg, I found that sometimes the ethernet link goes up and down continuously and getting below logs.

 

[ 1603.431182] 8021q: adding VLAN 0 to HW filter on device eth0
[ 1603.431215] imx-dwmac 30bf0000.ethernet eth0: Timeout accessing MAC_VLAN_Tag_Filter
[ 1606.495340] imx-dwmac 30bf0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[ 1611.997123] imx-dwmac 30bf0000.ethernet eth0: Reset adapter.
[ 1612.018437] imx-dwmac 30bf0000.ethernet eth0: FPE workqueue stop
[ 1612.021049] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 1612.172780] imx-dwmac 30bf0000.ethernet eth0: PHY [stmmac-1:03] driver [Microchip KSZ9131 Gigabit PHY] (irq=POLL)
[ 1612.172817] imx-dwmac 30bf0000.ethernet eth0: No Safety Features support found
[ 1612.376691] imx-dwmac 30bf0000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 1612.377609] imx-dwmac 30bf0000.ethernet eth0: registered PTP clock
[ 1612.377777] imx-dwmac 30bf0000.ethernet eth0: FPE workqueue start
[ 1612.377785] imx-dwmac 30bf0000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 1612.380276] 8021q: adding VLAN 0 to HW filter on device eth0
[ 1612.380312] imx-dwmac 30bf0000.ethernet eth0: Timeout accessing MAC_VLAN_Tag_Filter
[ 1615.455292] imx-dwmac 30bf0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[ 1620.961118] imx-dwmac 30bf0000.ethernet eth0: Reset adapter.
[ 1620.973075] imx-dwmac 30bf0000.ethernet eth0: FPE workqueue stop
[ 1620.978104] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 1621.124776] imx-dwmac 30bf0000.ethernet eth0: PHY [stmmac-1:03] driver [Microchip KSZ9131 Gigabit PHY] (irq=POLL)
[ 1621.124814] imx-dwmac 30bf0000.ethernet eth0: No Safety Features support found
[ 1621.328999] imx-dwmac 30bf0000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 1621.329195] imx-dwmac 30bf0000.ethernet eth0: registered PTP clock
[ 1621.329503] imx-dwmac 30bf0000.ethernet eth0: FPE workqueue start
[ 1621.329512] imx-dwmac 30bf0000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 1621.332051] 8021q: adding VLAN 0 to HW filter on device eth0
[ 1621.332085] imx-dwmac 30bf0000.ethernet eth0: Timeout accessing MAC_VLAN_Tag_Filter
[ 1624.415398] imx-dwmac 30bf0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[ 1629.917111] imx-dwmac 30bf0000.ethernet eth0: Reset adapter.
[ 1629.933853] imx-dwmac 30bf0000.ethernet eth0: FPE workqueue stop
[ 1629.937071] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 1630.088780] imx-dwmac 30bf0000.ethernet eth0: PHY [stmmac-1:03] driver [Microchip KSZ9131 Gigabit PHY] (irq=POLL)
[ 1630.088817] imx-dwmac 30bf0000.ethernet eth0: No Safety Features support found
[ 1630.292783] imx-dwmac 30bf0000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 1630.293269] imx-dwmac 30bf0000.ethernet eth0: registered PTP clock
[ 1630.293429] imx-dwmac 30bf0000.ethernet eth0: FPE workqueue start
[ 1630.293438] imx-dwmac 30bf0000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 1630.295842] 8021q: adding VLAN 0 to HW filter on device eth0
[ 1630.295875] imx-dwmac 30bf0000.ethernet eth0: Timeout accessing MAC_VLAN_Tag_Filter
[ 1633.379042] imx-dwmac 30bf0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off

 

 

image.pngimage.pngimage.pngimage.png

I have disabled TSN as guided in https://www.nxp.com/design/design-center/software/development-software/real-time-edge-software:REALT...

I also try to disable VLAN Filtering, still getting the same issue.  Sometimes reducing speed by "ethtool -s eth0 speed 100" works but not all times.
 
Can someone help me to understand the debug the issue.

0 Kudos
Reply
7 Replies

2,379 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

What is the BSP that you used for your board?

I would disable VLAN filtering and IEEE capabilities so I can isolate the issue into the lower layers of HW. Conserving this methodology, I would try to to get an static IP to see if it's still happening.

The possible tests are board to board and board to router as well, with static IP and sending ping packets, also, try monitoring the PHY LINK STATUS, does it fail?

Do your RGMII probes matches the RGMII standard? There is often an electrical mismatch that leads to an issue with PHY link.

Regards

0 Kudos
Reply

2,348 Views
vprajapati
Contributor II

Hi @JosephAtNXP 

I am using Yocto Scarthgap 6.6.23-lts-next for imx8mp. 

By default, the ethernet link is not detected.

root@ixm-ecoface:~# 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:  1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: unknown
        Port: Twisted Pair
        PHYAD: 3
        Transceiver: external
        MDI-X: on (auto)
        Supports Wake-on: ug
        Wake-on: d
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
        Link detected: no
root@ixm-ecoface:~# 


Then I will set speed to 100 and it detects the link.

root@ixm-ecoface:~# ethtool -s eth0 speed 100                                                                                                                                                              
root@ixm-ecoface:~# 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:  100baseT/Half 100baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        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: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Auto-negotiation: on
        master-slave cfg: preferred slave
        master-slave status: slave
        Port: Twisted Pair
        PHYAD: 3
        Transceiver: external
        MDI-X: on (auto)
        Supports Wake-on: ug
        Wake-on: d
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
        Link detected: yes


For electrical mismatch, the hardware team is checking the RGMII specifications.

I try to disable the VLAN Filtering by disabling following modules CONFIG_VLAN_8021Q, CONFIG_VLAN_8021Q_GVRP and CONFIG_VLAN_8021Q_MVRP. However, still it is not disabled.

Regarding IEEE capabilities, can you guide me how to disable that?

0 Kudos
Reply

2,328 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi @vprajapati,

You could quickly try to confirm it detecting a LINK STATUS through MDIO reading in U-boot and try to ping as well get an IP in U-boot. Because U-boot networking capabilities are really low level, it would mean that your HW and SW init in U-boot is correct and then we would move to Linux.

Regards,

0 Kudos
Reply

2,294 Views
vprajapati
Contributor II

Okay, I added an ethernet support in u-boot. It seems like auto-negotiation is not working properly. Below is my u-boot environmrnt.

u-boot-ecoface=> 
arch=arm
baudrate=115200
board=imx8mp_evk
board_name=IXM-ECOFACE
board_rev=ECOFACE_1_0
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_i
boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_fdt=try
boot_fit=no
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=usb0 mmc1 mmc2 
bootcmd=run distro_bootcmd;run bsp_bootcmd
bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else booti ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run;
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_mmc2=devnum=2; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootdelay=2
bootm_size=0x10000000
bootscript=echo Running bootscript from mmc ...; source
bsp_bootcmd=echo Running BSP bootcmd ...; mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; fi;
bsp_script=boot.scr
console=ttymxc1,115200
cpu=armv8
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
emmc_dev=2
eth1addr=46:f6:a7:1e:00:e9
ethact=ethernet@30bf0000
ethprime=eth1
fastboot_dev=mmc2
fdt_addr=0x43000000
fdt_addr_r=0x43000000
fdt_high=0xffffffffffffffff
fdtcontroladdr=bced6280
fdtfile=ixm-ecoface.dtb
gatewayip=192.168.1.1
image=Image
initrd_addr=0x43800000
initrd_high=0xffffffffffffffff
ipaddr=192.168.1.229
jh_clk= 
jh_mmcboot=setenv fdtfile ${jh_root_dtb};setenv jh_clk clk_ignore_unused mem=1920MB; if run loadimage; then run mmcboot; else run jh_netboot; fi; 
jh_netboot=setenv fdtfile ${jh_root_dtb}; setenv jh_clk clk_ignore_unused mem=1920MB; run netboot; 
jh_root_dtb=imx8mp-evk-root.dtb
kboot=booti 
kernel_addr_r=0x40400000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x40400000
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bsp_script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused 
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fit} = yes || test ${boot_fit} = try; then bootm ${loadaddr}; else if run loadfdt; then booti ${loadaddr} - ${fdt_addr_r}; else echo WARN: ;
mmcdev=2
mmcpart=1
mmcroot=/dev/mmcblk2p2 rootwait rw
mtdids=nand0=gpmi-nand
nandfit_part=yes
netargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
netboot=echo Booting from net ...; run netargs;  if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${loadaddr} ${image}; if test ${boot_fit} = yes || test ${boo;
netmask=255.255.255.0
nodes=/busfreq /power-domains /soc@0/caam-sm@100000 /soc@0/bus@30000000/caam_secvio /soc@0/bus@30000000/caam-snvs@30370000 /soc@0/bus@30800000/flexspi_nand@30bb0000 /soc@0/bus@32c00000/mipi_dsi@32e60000 
prepare_mcore=setenv mcore_clk clk-imx8mp.mcore_booted;
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_e
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo EXTLINUX FAILED: continuii
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCe
scriptaddr=0x43500000
sd_dev=1
serial#=0b0998003e85c138
soc=imx8m
soc_type=imx8mp
splashimage=0x50000000
sr_ir_v2_cmd=cp.b ${fdtcontroladdr} ${fdt_addr_r} 0x10000;fdt addr ${fdt_addr_r};fdt set /soc@0/usb@32f10100/usb@38100000 compatible snps,dwc3;fdt set /soc@0/usb@32f10108/usb@38200000 compatible snps,dw 
ubifs_boot=if ubi part ${bootubipart} ${bootubioff} && ubifsmount ubi0:${bootubivol}; then devtype=ubi; devnum=ubi0; bootfstype=ubifs; distro_bootpart=${bootubivol}; run scan_dev_for_boot; ubifsumount; i
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
vendor=freescale

Environment size: 6568/16380 bytes
u-boot-ecoface=>
u-boot-ecoface=> ping 192.168.1.105     
ethernet@30bf0000 Waiting for PHY auto negotiation to complete......................................... TIMEOUT !
phy_startup() failed: -110FAILED: -110ping failed; host 192.168.1.105 is not alive
u-boot-ecoface=> 
CTRL-A Z for help 
0 Kudos
Reply

2,291 Views
vprajapati
Contributor II

Further debugging

u-boot-ecoface=> mii device
MII devices: 'ethernet@30bf0000' 
Current device: 'ethernet@30bf0000'
u-boot-ecoface=> mii device ethernet@30bf0000
u-boot-ecoface=> mii dump 1
0.     (ffff)                 -- PHY control register --
  (8000:8000) 0.15    =     1     reset
  (4000:4000) 0.14    =     1     loopback
  (2040:2040) 0. 6,13 =   b11    speed selection = 10 Mbps
  (1000:1000) 0.12    =     1     A/N enable
  (0800:0800) 0.11    =     1     power-down
  (0400:0400) 0.10    =     1     isolate
  (0200:0200) 0. 9    =     1     restart A/N
  (0100:0100) 0. 8    =     1     duplex = full
  (0080:0080) 0. 7    =     1     collision test enable
  (003f:003f) 0. 5- 0 =    63     (reserved)
0 Kudos
Reply

2,269 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi @vprajapati,

1. I would confirm the PHY address in your design for reading.

2. After you find the correct address for PHY, if A/N is still disable, check the strapping pins for your design and try to enable it via MDIO write.

3. Is ping now working?

Regards,

0 Kudos
Reply

2,266 Views
vprajapati
Contributor II

Hi @JosephAtNXP 

The phy address is correct. It is 0x03.

The Auto negotiation is already enabled no need to set it.

On dhcp, it conitnuesly trying to get ip address but it is not getting. 
I set the static ip and still ping is still not working. It is giveing ARP Requst timeout.

 

u-boot-ecoface=> ping 192.168.1.105
No linkFAILED: -11ping failed; host 192.168.1.105 is not alive
u-boot-ecoface=> ping 192.168.1.105
Using ethernet@30bf0000 device

ARP Retry count exceeded; starting again
ping failed; host 192.168.1.105 is not alive
u-boot-ecoface=> 

 



 

0 Kudos
Reply