IMX8DX device tree, Second Ethernet configuration

Hi, we have some troubles defining the second ethernet port using device tree overlays.

We have noticed, using the Toradex Pinout designer that the MDIO and MDC pins are shared for the two ethernet ports.
Defining the ethphy2 in the fec1 as for the ethphy1 we were able to make the second eth port work but we are not able to set Phy parameters like as “micrel,led-mode” or “max-speed”.
It seems like as the second phy is ignoring those parameters.
We defined the fec2 in this way in our overlay dts:

/* Colibri FastEthernet */
&fec1 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&pinctrl_fec1>;
	pinctrl-1 = <&pinctrl_fec1_sleep>;
	phy-mode = "rmii";
	phy-handle = <&ethphy0>;
	fsl,magic-packet;
	fsl,wakeup_irq = <0>;
	status = "okay";
	mdio {
		#address-cells = <1>;
		#size-cells = <0>;
	
		ethphy0: ethernet-phy@2 {	
			compatible = "ethernet-phy-ieee802.3-c22";
			max-speed = <100>;
                        micrel,led-mode = <1>;
			reg = <2>;
		};

		ethphy1: ethernet-phy@1 {
			compatible = "ethernet-phy-ieee802.3-c22";
			max-speed = <100>;
			micrel,led-mode = <1>;
			reg = <1>;
		};
	};
};

/* Colibri FastEthernet 2 ETH2 */
&fec2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_fec2>;
	phy-mode = "rmii";
	phy-handle = <&ethphy1>;
	fsl,magic-packet;
	fsl,mii-exclusive;
	status = "okay";
};

&iomuxc {

/* Colibri Ethernet: On-module 100Mbps PHY Micrel KSZ8041 */
pinctrl_fec1: fec1grp {
	fsl,pins = <
		IMX8QXP_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB0_PAD	0x000014a0 
		IMX8QXP_COMP_CTL_GPIO_1V8_3V3_ENET_ENETB1_PAD	0x000014a0
		IMX8QXP_ENET0_MDC_CONN_ENET0_MDC		0x06000020
		IMX8QXP_ENET0_MDIO_CONN_ENET0_MDIO		0x06000020
		IMX8QXP_ENET0_RGMII_TX_CTL_CONN_ENET0_RGMII_TX_CTL	0x61
		IMX8QXP_ENET0_RGMII_TXC_CONN_ENET0_RCLK50M_OUT	0x06000061
		IMX8QXP_ENET0_RGMII_TXD0_CONN_ENET0_RGMII_TXD0	0x61
		IMX8QXP_ENET0_RGMII_TXD1_CONN_ENET0_RGMII_TXD1	0x61
		IMX8QXP_ENET0_RGMII_RX_CTL_CONN_ENET0_RGMII_RX_CTL	0x61
		IMX8QXP_ENET0_RGMII_RXD0_CONN_ENET0_RGMII_RXD0	0x61
		IMX8QXP_ENET0_RGMII_RXD1_CONN_ENET0_RGMII_RXD1	0x61
		IMX8QXP_ENET0_RGMII_RXD2_CONN_ENET0_RMII_RX_ER	0x61
	>;	
};

// Pin per la seconda Ethernet
pinctrl_fec2: fec2grp {
	fsl,pins = <
		IMX8QXP_ESAI0_TX4_RX1_CONN_ENET1_RGMII_TXD0 0x60			        // SODIMM 62
		IMX8QXP_ESAI0_FSR_CONN_ENET1_RCLK50M_IN		0x60			// SODIMM 76
		IMX8QXP_ESAI0_TX5_RX0_CONN_ENET1_RGMII_TXD1 0x60        	                // SODIMM 48
		IMX8QXP_ESAI0_SCKR_CONN_ENET1_RGMII_TX_CTL  0x60			        // SODIMM 60
		IMX8QXP_SPDIF0_RX_CONN_ENET1_RGMII_RXD0		0x60			// SODIMM 74
		IMX8QXP_ESAI0_TX3_RX2_CONN_ENET1_RGMII_RXD1	0x60			// SODIMM 46
		IMX8QXP_ESAI0_TX2_RX3_CONN_ENET1_RMII_RX_ER 0x60			       // SODIMM 80
		//IMX8QXP_ENET0_MDC_CONN_ENET1_MDC			0x06000020		// SODIMM 184
		//IMX8QXP_ENET0_MDIO_CONN_ENET1_MDIO		0x06000020		        // SODIMM 180
		IMX8QXP_SPDIF0_TX_CONN_ENET1_RGMII_RX_CTL	0x60			        // SODIMM 50
	>;
};
};

The output of the “dmesg” command is the following:


[    8.657179] 001: Micrel KSZ8041 5b040000.ethernet-1:01: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=5b040000.ethernet-1:01, irq=POLL)
[    8.708805] 000: Micrel KSZ8041 5b040000.ethernet-1:02: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=5b040000.ethernet-1:02, irq=POLL)
[    9.662718] 000: fec 5b050000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[    9.662779] 000: IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   29.182692] 000: fec 5b040000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[   29.182749] 000: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   31.709955] 001: 3.3V: disabling

What are we doing wrong?
Thanks in advance for the support.

Dear @xMark94,

Sorry for the delay in answering!
Could you please specify which kernel version you are on? Then I could check how the ethernet is being configured for that version.

Hi Rudhi
My Kernel is the following:

uname -a:
Linux colibri-imx8x-07266862 5.4.193-rt74-5.7.2-devel+git.b60d3160fd04 #1 SMP PREEMPT_RT Fri Dec 23

Hello @xMark94,

Looking at your device tree snippet, I think you have made the right modifications. Also, from the dmesg logs it looks like the MDIO communication works and the PHY is also recognized. We can also see that both the ethernet interfaces are auto-negotiated to 100 mbps speed. So may I ask what issue you are facing here?

Hello @rudhi.tx,
The micrel led mode is not correctly interpreted for eth2.
The leds are blinking like as in mode “0”, instead for eth1 they are working correctly.
Also, if I try to change the max-speed for eth2 and set it to “max-speed = <10>”, the value is ignored too, and setted instead to 100.

It seems like those parameters are completely ignored for the second ethernet interface.

Hello @xMark94,

The configuration looks good to us. Could you please send us the full dmesg log?
You could also use phytool to access the phy registers directly to see if they have the correct values. You can check it as follows:
phytool read eth1/1/0x1e
Here the register value should be 1.

I can send you the phytool cross-compiled for arm64 so you don’t have to compile it again.
phytool (1.3 MB)

Hi @rudhi.tx!

I tried with the phytool you gave me, here the results:

root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool read eth1/2/0x1E
0x4800
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool read eth1/1/0x1E
0000
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool write eth1/1/0x1E 0x4000
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool read eth1/1/0x1E
0x4000
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#


root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool read eth1/2/0x1e
0x4800
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool read eth1/1/0x1e
0x0800
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ifconfig eth1 down
root@colibri-imx8x-14714445:~# ifconfig eth1 up
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool read eth1/2/0x1e
0x4800
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~# ./phytool read eth1/1/0x1e
0x4800
root@colibri-imx8x-14714445:~#
root@colibri-imx8x-14714445:~#

The register 2 is associated to the phy of the first ethernet port, and register 1 is associated with the phy of the second ethernet port.
We can see that we are able to set the correct led mode through the “phytool write” command but the driver seems not to be able to configure it at the start.

We obtain the same result also using “ifconfig eth1 down” “ifconfig eth1 up” to reconfigure the ethernet port.

Here is the full dmesg log:

root@colibri-imx8x-14714445:~# dmesg
[    0.000000] 000: Booting Linux on physical CPU 0x0000000000 [0x410fd042]
[    0.000000] 000: Linux version 5.4.193-rt74-5.7.3-devel+git.49e4130e2197 (oe-user@oe-host) (gcc version 9.5.0 (GCC)) #1 SMP PREEMPT Tue Apr 11 21:14:29 UTC 2023
[    0.000000] 000: Machine model: Toradex Colibri iMX8DX on CSTAR
[    0.000000] 000: efi: Getting EFI parameters from FDT:
[    0.000000] 000: efi: UEFI not found.
[    0.000000] 000: Reserved memory: created DMA memory pool at 0x0000000090000000, size 0 MiB
[    0.000000] 000: OF: reserved mem: initialized node vdev0vring0@90000000, compatible id shared-dma-pool
[    0.000000] 000: Reserved memory: created DMA memory pool at 0x0000000090008000, size 0 MiB
[    0.000000] 000: OF: reserved mem: initialized node vdev0vring1@90008000, compatible id shared-dma-pool
[    0.000000] 000: Reserved memory: created DMA memory pool at 0x0000000090010000, size 0 MiB
[    0.000000] 000: OF: reserved mem: initialized node vdev1vring0@90010000, compatible id shared-dma-pool
[    0.000000] 000: Reserved memory: created DMA memory pool at 0x0000000090018000, size 0 MiB
[    0.000000] 000: OF: reserved mem: initialized node vdev1vring1@90018000, compatible id shared-dma-pool
[    0.000000] 000: Reserved memory: created DMA memory pool at 0x0000000090400000, size 1 MiB
[    0.000000] 000: OF: reserved mem: initialized node vdevbuffer, compatible id shared-dma-pool
[    0.000000] 000: cma: Reserved 224 MiB at 0x00000000ae000000
[    0.000000] 000: NUMA: No NUMA configuration found
[    0.000000] 000: NUMA: Faking a node at [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] 000: NUMA: NODE_DATA [mem 0xbfde8500-0xbfde9fff]
[    0.000000] 000: Zone ranges:
[    0.000000] 000:   DMA32    [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] 000:   Normal   empty
[    0.000000] 000: Movable zone start for each node
[    0.000000] 000: Early memory node ranges
[    0.000000] 000:   node   0: [mem 0x0000000080200000-0x0000000083ffffff]
[    0.000000] 000:   node   0: [mem 0x0000000086200000-0x0000000087ffffff]
[    0.000000] 000:   node   0: [mem 0x0000000090020000-0x00000000901fffff]
[    0.000000] 000:   node   0: [mem 0x0000000090500000-0x0000000091ffffff]
[    0.000000] 000:   node   0: [mem 0x0000000094c00000-0x00000000bfffffff]
[    0.000000] 000: Initmem setup node 0 [mem 0x0000000080200000-0x00000000bfffffff]
[    0.000000] 000: On node 0 totalpages: 208096
[    0.000000] 000:   DMA32 zone: 3252 pages used for memmap
[    0.000000] 000:   DMA32 zone: 0 pages reserved
[    0.000000] 000:   DMA32 zone: 208096 pages, LIFO batch:63
[    0.000000] 000: psci: probing for conduit method from DT.
[    0.000000] 000: psci: PSCIv1.1 detected in firmware.
[    0.000000] 000: psci: Using standard PSCI v0.2 function IDs
[    0.000000] 000: psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] 000: psci: SMC Calling Convention v1.1
[    0.000000] 000: percpu: Embedded 20 pages/cpu s42520 r8192 d31208 u81920
[    0.000000] 000: pcpu-alloc: s42520 r8192 d31208 u81920 alloc=20*4096
[    0.000000] 000: pcpu-alloc: [0] 0 [0] 1
[    0.000000] 000: Detected VIPT I-cache on CPU0
[    0.000000] 000: CPU features: detected: GIC system register CPU interface
[    0.000000] 000: Speculative Store Bypass Disable mitigation not required
[    0.000000] 000: Built 1 zonelists, mobility grouping on.  Total pages: 204844
[    0.000000] 000: Policy zone: DMA32
[    0.000000] 000: Kernel command line: root=PARTUUID=ebe00d4e-d97c-6049-8d64-b558e4132a47 ro rootwait video=imxdpufb5:off video=imxdpufb6:off video=imxdpufb7:off
[    0.000000] 000: Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] 000: Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] 000: mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] 000: Memory: 556504K/832384K available (14268K kernel code, 1224K rwdata, 6588K rodata, 2944K init, 1029K bss, 46504K reserved, 229376K cma-reserved)
[    0.000000] 000: SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] 000: rcu: Preemptible hierarchical RCU implementation.
[    0.000000] 000: rcu:        RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=2.
[    0.000000] 000:     Tasks RCU enabled.
[    0.000000] 000: rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] 000: rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] 000: NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] 000: GICv3: GIC: Using split EOI/Deactivate mode
[    0.000000] 000: GICv3: 512 SPIs implemented
[    0.000000] 000: GICv3: 0 Extended SPIs implemented
[    0.000000] 000: GICv3: Distributor has no Range Selector support
[    0.000000] 000: GICv3: 16 PPIs implemented
[    0.000000] 000: GICv3: no VLPI support, no direct LPI support
[    0.000000] 000: GICv3: CPU0: found redistributor 0 region 0:0x0000000051b00000
[    0.000000] 000: random: get_random_bytes called from start_kernel+0x2b8/0x43c with crng_init=0
[    0.000000] 000: arch_timer: cp15 timer(s) running at 8.00MHz (phys).
[    0.000000] 000: clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 440795202120 ns
[    0.000001] 000: sched_clock: 56 bits at 8MHz, resolution 125ns, wraps every 2199023255500ns
[    0.000659] 000: Console: colour dummy device 80x25
[    0.000667] 000: printk: console [tty0] enabled
[    0.000751] 000: Calibrating delay loop (skipped), value calculated using timer frequency.. 16.00 BogoMIPS (lpj=32000)
[    0.000758] 000: pid_max: default: 32768 minimum: 301
[    0.000838] 000: LSM: Security Framework initializing
[    0.000894] 000: Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000906] 000: Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.002375] 000: ASID allocator initialised with 32768 entries
[    0.002470] 000: rcu: Hierarchical SRCU implementation.
[    0.007038] 000: EFI services will not be available.
[    0.007314] 000: smp: Bringing up secondary CPUs ...
[    0.008062] 001: Detected VIPT I-cache on CPU1
[    0.008092] 001: GICv3: CPU1: found redistributor 1 region 0:0x0000000051b20000
[    0.008134] 001: CPU1: Booted secondary processor 0x0000000001 [0x410fd042]
[    0.008236] 000: smp: Brought up 1 node, 2 CPUs
[    0.008243] 000: SMP: Total of 2 processors activated.
[    0.008247] 000: CPU features: detected: 32-bit EL0 Support
[    0.008252] 000: CPU features: detected: CRC32 instructions
[    0.014543] 000: CPU: All CPU(s) started at EL2
[    0.014574] 000: alternatives: patching kernel code
[    0.015748] 001: devtmpfs: initialized
[    0.034047] 000: clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.034075] 000: futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.041610] 000: pinctrl core: initialized pinctrl subsystem
[    0.042207] 000: DMI not present or invalid.
[    0.042520] 000: NET: Registered protocol family 16
[    0.051411] 000: DMA: preallocated 256 KiB pool for atomic allocations
[    0.051457] 000: audit: initializing netlink subsys (disabled)
[    0.051772] 000: audit: type=2000 audit(0.048:1): state=initialized audit_enabled=0 res=1
[    0.052543] 000: cpuidle: using governor menu
[    0.053748] 000: hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.055799] 000: Serial: AMBA PL011 UART driver
[    0.055862] 000: imx mu driver is registered.
[    0.055885] 000: imx rpmsg driver is registered.
[    0.106601] 001: HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.106615] 001: HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
[    0.106619] 001: HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.106624] 001: HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    0.107937] 001: cryptd: max_cpu_qlen set to 1000
[    0.112215] 000: ACPI: Interpreter disabled.
[    0.115201] 001: iommu: Default domain type: Translated
[    0.115353] 001: vgaarb: loaded
[    0.115689] 001: SCSI subsystem initialized
[    0.115841] 000: libata version 3.00 loaded.
[    0.116077] 000: usbcore: registered new interface driver usbfs
[    0.116114] 000: usbcore: registered new interface driver hub
[    0.116142] 000: usbcore: registered new device driver usb
[    0.118547] 000: mc: Linux media interface: v0.10
[    0.118579] 000: videodev: Linux video capture interface: v2.00
[    0.118663] 000: pps_core: LinuxPPS API ver. 1 registered
[    0.118667] 000: pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.118682] 000: PTP clock support registered
[    0.119050] 000: EDAC MC: Ver: 3.0.0
[    0.121113] 001: No BMan portals available!
[    0.121538] 001: QMan: Allocated lookup table at (____ptrval____), entry count 65537
[    0.122314] 001: No QMan portals available!
[    0.123428] 001: No USDPAA memory, no 'fsl,usdpaa-mem' in device-tree
[    0.124206] 000: FPGA manager framework
[    0.124319] 000: Advanced Linux Sound Architecture Driver Initialized.
[    0.126310] 000: imx-scu scu: NXP i.MX SCU Initialized
[    0.132154] 000: random: fast init done
[    0.164785] 000: imx8qxp-pinctrl scu:pinctrl: Invalid fsl,pins or pins property in node /scu/pinctrl/colibri-imx8qxp/lusb2
[    0.164804] 000: imx8qxp-pinctrl scu:pinctrl: Invalid fsl,pins or pins property in node /scu/pinctrl/colibri-imx8qxp/usbh1-reg_sdi
[    0.164831] 000: imx8qxp-pinctrl scu:pinctrl: initialized IMX pinctrl driver
[    0.165723] 000: imx8qxp-pinctrl scu:pinctrl: pin_config_set op failed for pin 132
[    0.165730] 000: imx8qxp-pinctrl scu:pinctrl: Error applying setting, reverse things back
[    0.165743] 000: imx8qxp-pinctrl scu:pinctrl: failed to select default state
[    0.167600] 000: clocksource: Switched to clocksource arch_sys_counter
[    0.167803] 000: VFS: Disk quotas dquot_6.6.0
[    0.167858] 000: VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.168055] 000: pnp: PnP ACPI: disabled
[    0.197558] 000: thermal_sys: Registered thermal governor 'step_wise'
[    0.197564] 000: thermal_sys: Registered thermal governor 'power_allocator'
[    0.198563] 000: NET: Registered protocol family 2
[    0.198690] 000: IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.199399] 000: tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.199421] 000: TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.199486] 000: TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.199733] 000: TCP: Hash tables configured (established 8192 bind 8192)
[    0.199831] 000: UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.199858] 000: UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.199977] 000: NET: Registered protocol family 1
[    0.201305] 000: RPC: Registered named UNIX socket transport module.
[    0.201312] 000: RPC: Registered udp transport module.
[    0.201315] 000: RPC: Registered tcp transport module.
[    0.201317] 000: RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.201326] 000: PCI: CLS 0 bytes, default 64
[    0.202099] 000: hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    0.203325] 000: kvm [1]: IPA Size Limit: 40 bits
[    0.204823] 000: kvm [1]: GICv3: no GICV resource entry
[    0.204830] 000: kvm [1]: disabling GICv2 emulation
[    0.204850] 000: kvm [1]: GIC system register CPU interface enabled
[    0.204908] 000: kvm [1]: vgic interrupt IRQ1
[    0.204989] 000: kvm [1]: Hyp mode initialized successfully
[    0.208770] 001: Initialise system trusted keyrings
[    0.208957] 001: workingset: timestamp_bits=44 max_order=18 bucket_order=0
[    0.216227] 001: squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.217012] 001: NFS: Registering the id_resolver key type
[    0.217040] 001: Key type id_resolver registered
[    0.217043] 001: Key type id_legacy registered
[    0.217053] 001: nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.217057] 001: nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    0.217079] 001: jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.234030] 000: Key type asymmetric registered
[    0.234041] 000: Asymmetric key parser 'x509' registered
[    0.234086] 000: Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)
[    0.234093] 000: io scheduler mq-deadline registered
[    0.234097] 000: io scheduler kyber registered
[    0.248804] 000: EINJ: ACPI disabled.
[    0.254370] 000: imx8qxp-lpcg-clk 37620000.clock-controller: failed to get clock parent names
[    0.254454] 000: imx8qxp-lpcg-clk: probe of 37620000.clock-controller failed with error -22
[    0.334413] 000: mxs-dma 5b810000.dma-apbh: initialized
[    0.336097] 000: Bus freq driver module loaded
[    0.343754] 000: Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.349593] 000: 5a060000.serial: ttyLP0 at MMIO 0x5a060010 (irq = 47, base_baud = 5000000) is a FSL_LPUART
[    0.350164] 001: fsl-lpuart 5a060000.serial: DMA tx channel request failed, operating without tx DMA
[    0.350174] 001: fsl-lpuart 5a060000.serial: DMA rx channel request failed, operating without rx DMA
[    0.350924] 001: 5a070000.serial: ttyLP1 at MMIO 0x5a070010 (irq = 48, base_baud = 5000000) is a FSL_LPUART
[    0.352274] 001: 5a080000.serial: ttyLP2 at MMIO 0x5a080010 (irq = 49, base_baud = 5000000) is a FSL_LPUART
[    0.353228] 001: 5a090000.serial: ttyLP3 at MMIO 0x5a090010 (irq = 50, base_baud = 5000000) is a FSL_LPUART
[    0.420921] 000: brd: module loaded
[    0.427527] 000: loop: module loaded
[    0.428040] 000: zram: Added device: zram0
[    0.442380] 001: tun: Universal TUN/TAP device driver, 1.6
[    0.444831] 001: pps pps0: new PPS source ptp0
[    0.453420] 001: fec 5b040000.ethernet eth0: registered PHC device 0
[    0.454821] 000: pps pps1: new PPS source ptp1
[    0.460324] 000: fec 5b050000.ethernet: Invalid MAC address: 00:00:00:00:00:00
[    0.460350] 000: fec 5b050000.ethernet: Using random MAC address: 92:8b:b3:5a:6e:94
[    0.461978] 000: fec 5b050000.ethernet eth1: registered PHC device 1
[    0.463549] 000: Freescale FM module, FMD API version 21.1.0
[    0.464584] 000: Freescale FM Ports module
[    0.466580] 000: VFIO - User Level meta-driver version: 0.3
[    0.472438] 000: ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.472475] 000: ehci-pci: EHCI PCI platform driver
[    0.474011] 000: usbcore: registered new interface driver usb-storage
[    0.474101] 000: usbcore: registered new interface driver usbserial_generic
[    0.474122] 000: usbserial: USB Serial support registered for generic
[    0.474149] 000: usbcore: registered new interface driver cp210x
[    0.474167] 000: usbserial: USB Serial support registered for cp210x
[    0.474199] 000: usbcore: registered new interface driver ftdi_sio
[    0.474218] 000: usbserial: USB Serial support registered for FTDI USB Serial Device
[    0.474246] 000: usbcore: registered new interface driver pl2303
[    0.474266] 000: usbserial: USB Serial support registered for pl2303
[    0.474296] 000: usbcore: registered new interface driver usb_serial_simple
[    0.474318] 000: usbserial: USB Serial support registered for carelink
[    0.474338] 000: usbserial: USB Serial support registered for zio
[    0.474358] 000: usbserial: USB Serial support registered for funsoft
[    0.474376] 000: usbserial: USB Serial support registered for flashloader
[    0.474402] 000: usbserial: USB Serial support registered for google
[    0.474420] 000: usbserial: USB Serial support registered for libtransistor
[    0.474439] 000: usbserial: USB Serial support registered for vivopay
[    0.474460] 000: usbserial: USB Serial support registered for moto_modem
[    0.474486] 000: usbserial: USB Serial support registered for motorola_tetra
[    0.474506] 000: usbserial: USB Serial support registered for nokia
[    0.474526] 000: usbserial: USB Serial support registered for novatel_gps
[    0.474546] 000: usbserial: USB Serial support registered for hp4x
[    0.474566] 000: usbserial: USB Serial support registered for suunto
[    0.474583] 000: usbserial: USB Serial support registered for siemens_mpi
[    0.482178] 000: input: sc-powerkey as /devices/platform/sc-powerkey/input/input0
[    0.484770] 000: imx-sc-rtc scu:rtc: registered as rtc0
[    0.485671] 000: i2c /dev entries driver
[    0.496586] 000: sdhci: Secure Digital Host Controller Interface driver
[    0.496597] 000: sdhci: Copyright(c) Pierre Ossman
[    0.497156] 000: Synopsys Designware Multimedia Card Interface Driver
[    0.499147] 000: sdhci-pltfm: SDHCI platform and OF driver helper
[    0.533041] 000: mmc0: SDHCI controller on 5b010000.mmc [5b010000.mmc] using ADMA
[    0.565989] 001: mmc1: SDHCI controller on 5b020000.mmc [5b020000.mmc] using ADMA
[    0.572441] 001: ledtrig-cpu: registered to indicate activity on CPUs
[    0.576861] 001: caam 31400000.crypto: device ID = 0x0a16040000000100 (Era 9)
[    0.576878] 001: caam 31400000.crypto: job rings = 2, qi = 0
[    0.599506] 000: mmc0: new HS400 MMC card at address 0001
[    0.600324] 000: mmcblk0: mmc0:0001 Q2J54A 3.59 GiB
[    0.600585] 000: mmcblk0boot0: mmc0:0001 Q2J54A partition 1 16.0 MiB
[    0.600845] 000: mmcblk0boot1: mmc0:0001 Q2J54A partition 2 16.0 MiB
[    0.601044] 000: mmcblk0rpmb: mmc0:0001 Q2J54A partition 3 512 KiB, chardev (237:0)
[    0.601282] 001: caam algorithms registered in /proc/crypto
[    0.603335] 001: caam 31400000.crypto: caam pkc algorithms registered in /proc/crypto
[    0.603356] 001: caam 31400000.crypto: registering rng-caam
[    0.603836] 000: Device caam-keygen registered
[    0.605023] 000:  mmcblk0: p1 p2 p3 p4 p5
[    0.606712] 001: hidraw: raw HID events driver (C) Jiri Kosina
[    0.606874] 001: usbcore: registered new interface driver usbhid
[    0.606879] 001: usbhid: USB HID core driver
[    0.613153] 001: No fsl,qman node
[    0.613164] 001: Freescale USDPAA process driver
[    0.613166] 001: fsl-usdpaa: no region found
[    0.613168] 001: Freescale USDPAA process IRQ driver
[    0.618754] 001: clk: couldn't get clock 0 for /bus@5a000000/adc@5a890000
[    0.627858] 001: [VPU Decoder] H265 is disabled
[    0.628077] 001: [VPU Decoder] warning: init rtx channel failed, ret: -517
[    0.628086] 001: [VPU Decoder] failed to request mailbox, ret = -517
[    0.634068] 000: [VPU Encoder] warning:  init rtx channel failed, ret: -517
[    0.634082] 000: [VPU Encoder] fail to request mailbox, ret = -517
[    0.643128] 001: check_dsp_is_available: HiFi4 DSP not available on this silicon
[    0.659501] 001: pktgen: Packet Generator for packet performance testing. Version: 2.75
[    0.660130] 000: NET: Registered protocol family 26
[    0.660944] 000: NET: Registered protocol family 10
[    0.661843] 000: Segment Routing with IPv6
[    0.661907] 000: NET: Registered protocol family 17
[    0.661950] 000: tsn generic netlink module v1 init...
[    0.662014] 000: Key type dns_resolver registered
[    0.662632] 001: registered taskstats version 1
[    0.662638] 001: Loading compiled-in X.509 certificates
[    0.689310] 001: mxs_phy 5b100000.usbphy: 5b100000.usbphy supply phy-3p0 not found, using dummy regulator
[    0.696636] 000: crng init done
[    0.703266] 001: regulator-usbh-vbus GPIO handle specifies active low - ignored
[    0.703805] 001: usb_phy_generic bus@5b000000:usb3-phy: bus@5b000000:usb3-phy supply vcc not found, using dummy regulator
[    0.709250] 001: sgtl5000 16-000a: sgtl5000 revision 0x11
[    0.752899] 001: usb3503 16-0008: switched to HUB mode
[    0.752911] 001: usb3503 16-0008: usb3503_probe: probed in hub mode
[    0.753001] 001: i2c i2c-16: LPI2C adapter registered
[    0.754582] 001: i2c i2c-17: LPI2C adapter registered
[    0.755732] 001: i2c i2c-18: LPI2C adapter registered
[    0.757120] 001: i2c i2c-19: LPI2C adapter registered
[    0.760846] 000: imx6q-pcie 5f010000.pcie: 5f010000.pcie supply epdev_on not found, using dummy regulator
[    0.761143] 000: imx6q-pcie 5f010000.pcie: pcie_ext clock source missing or invalid
[    0.769869] 001: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    0.769881] 001: [drm] No driver support for vblank timestamp query.
[    0.769955] 001: imx-drm display-subsystem: bound imx-drm-dpu-bliteng.2 (ops dpu_bliteng_ops)
[    0.770668] 001: imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
[    0.771243] 001: imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
[    0.771867] 001: [drm] Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 0
[    0.771920] 001: dpu-core 56180000.dpu: driver probed
[    0.774297] 001: fsl_lpspi 5a020000.spi: chipselect 0 already in use
[    0.774311] 001: spi_master spi0: spi_device register error /bus@5a000000/spi@5a020000/23lc1024-0@0
[    0.774322] 001: spi_master spi0: Failed to create SPI device for /bus@5a000000/spi@5a020000/23lc1024-0@0
[    0.779333] 001: spi-nor spi2.0: sst25vf040b (512 Kbytes)
[    0.779373] 001: 3 fixed-partitions partitions found on MTD device spi2.0
[    0.779378] 001: Creating 3 MTD partitions on "spi2.0":
[    0.779386] 001: 0x000000000000-0x000000010000 : "Firmdata"
[    0.780672] 001: 0x000000010000-0x000000070000 : "Config"
[    0.781673] 001: 0x000000070000-0x000000080000 : "Test"
[    0.787476] 001:  xhci-cdns3: xHCI Host Controller
[    0.787506] 001:  xhci-cdns3: new USB bus registered, assigned bus number 1
[    0.788774] 001:  xhci-cdns3: hcc params 0x200073c8 hci version 0x100 quirks 0x0000001000018010
[    0.789570] 001: hub 1-0:1.0: USB hub found
[    0.789600] 001: hub 1-0:1.0: 1 port detected
[    0.789894] 001:  xhci-cdns3: xHCI Host Controller
[    0.789911] 001:  xhci-cdns3: new USB bus registered, assigned bus number 2
[    0.789922] 001:  xhci-cdns3: Host supports USB 3.0 SuperSpeed
[    0.789981] 001: usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    0.790463] 001: hub 2-0:1.0: USB hub found
[    0.790488] 001: hub 2-0:1.0: 1 port detected
[    0.799103] 001: [VPU Decoder] H265 is disabled
[    0.831346] 001: debugfs: Directory '59040000.sai' with parent 'imx8qxp-sgtl5000' already present!
[    0.831989] 001: asoc-simple-card sound-card: sgtl5000 <-> 59040000.sai mapping ok
[    0.832009] 001: asoc-simple-card sound-card: ASoC: no DMI vendor name!
[    0.836246] 001: imx-rpmsg 90000000.rpmsg: assigned reserved memory node vdevbuffer
[    0.859640] 001: virtio_rpmsg_bus virtio0: rpmsg host is online
[    0.883622] 001: virtio_rpmsg_bus virtio1: rpmsg host is online
[    0.886573] 000: imx6q-pcie 5f010000.pcie: 5f010000.pcie supply epdev_on not found, using dummy regulator
[    0.887039] 000: imx6q-pcie 5f010000.pcie: No cache used with register defaults set!
[    0.895421] 001: ci_hdrc ci_hdrc.0: EHCI Host Controller
[    0.895447] 001: ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 3
[    0.907610] 001: ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    0.908274] 001: hub 3-0:1.0: USB hub found
[    0.908304] 001: hub 3-0:1.0: 1 port detected
[    0.912803] 001: imx8qxp-lpcg-clk 59580000.clock-controller: ignoring dependency for device, assuming no driver
[    0.913382] 001: imx8qxp-lpcg-clk 5a4d0000.clock-controller: ignoring dependency for device, assuming no driver
[    0.913556] 000: imx6q-pcie 5f010000.pcie: ERROR PM_REQ_CORE_RST is still set.
[    0.913946] 001: imx8qxp-lpcg-clk 5ac90000.clock-controller: ignoring dependency for device, assuming no driver
[    0.914520] 001: imx8qxp-lpcg-clk 5ac40000.clock-controller: ignoring dependency for device, assuming no driver
[    0.915083] 001: imx8qxp-lpcg-clk 5b260000.clock-controller: ignoring dependency for device, assuming no driver
[    0.926728] 001: imx-sc-rtc scu:rtc: setting system clock to 2023-07-28T04:31:31 UTC (1690518691)
[    0.933328] 001: ALSA device list:
[    0.933342] 001:   #0: imx8qxp-sgtl5000
[    0.935508] 000: imx6q-pcie 5f010000.pcie: PCIe PLL lock timeout
[    0.943777] 001: EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    0.943843] 001: VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    0.946694] 001: devtmpfs: mounted
[    0.948256] 001: Freeing unused kernel memory: 2944K
[    0.959708] 000: Run /sbin/init as init process
[    1.074064] 001: systemd[1]: systemd 244.5+ running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR -SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[    1.074596] 001: systemd[1]: Detected architecture arm64.
[    1.102984] 001: systemd[1]: Set hostname to <colibri-imx8x-14714445>.
[    1.215653] 000: usb 1-1: new high-speed USB device number 2 using cdns-usb3
[    1.368760] 000: hub 1-1:1.0: USB hub found
[    1.368819] 000: hub 1-1:1.0: 2 ports detected
[    1.483281] 001: systemd[1]: Created slice system-getty.slice.
[    1.485123] 001: systemd[1]: Created slice system-syslog\x2dng.slice.
[    1.486465] 001: systemd[1]: Created slice User and Session Slice.
[    1.486982] 001: systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    1.487457] 001: systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    1.487865] 001: systemd[1]: Reached target Paths.
[    1.488103] 001: systemd[1]: Reached target Remote File Systems.
[    1.488302] 001: systemd[1]: Reached target Slices.
[    1.488520] 001: systemd[1]: Reached target Swap.
[    1.505064] 001: systemd[1]: Listening on RPCbind Server Activation Socket.
[    1.505517] 001: systemd[1]: Reached target RPC Port Mapper.
[    1.506049] 001: systemd[1]: Listening on initctl Compatibility Named Pipe.
[    1.507008] 001: systemd[1]: Listening on Journal Audit Socket.
[    1.507901] 001: systemd[1]: Listening on Journal Socket (/dev/log).
[    1.508634] 001: systemd[1]: Listening on Journal Socket.
[    1.509485] 001: systemd[1]: Listening on Network Service Netlink Socket.
[    1.510116] 001: systemd[1]: Listening on udev Control Socket.
[    1.510658] 001: systemd[1]: Listening on udev Kernel Socket.
[    1.514964] 001: systemd[1]: Mounting Huge Pages File System...
[    1.520093] 001: systemd[1]: Mounting POSIX Message Queue File System...
[    1.525423] 001: systemd[1]: Mounting Kernel Debug File System...
[    1.530771] 001: systemd[1]: Mounting Temporary Directory (/tmp)...
[    1.540566] 001: systemd[1]: Starting Create list of static device nodes for the current kernel...
[    1.546378] 001: systemd[1]: Starting RPC Bind...
[    1.551339] 001: systemd[1]: Starting File System Check on Root Device...
[    1.567816] 001: systemd[1]: Starting Journal Service...
[    1.581082] 001: systemd[1]: Starting Load Kernel Modules...
[    1.592296] 001: systemd[1]: Starting udev Coldplug all Devices...
[    1.617575] 001: systemd[1]: Started RPC Bind.
[    1.618290] 001: systemd[1]: Mounted Huge Pages File System.
[    1.619001] 001: systemd[1]: Mounted POSIX Message Queue File System.
[    1.619784] 001: systemd[1]: Mounted Kernel Debug File System.
[    1.620573] 001: systemd[1]: Mounted Temporary Directory (/tmp).
[    1.623253] 001: systemd[1]: Started Create list of static device nodes for the current kernel.
[    1.678250] 001: systemd[1]: Started Load Kernel Modules.
[    1.679416] 001: systemd[1]: Condition check resulted in FUSE Control File System being skipped.
[    1.688277] 001: systemd[1]: Mounting Kernel Configuration File System...
[    1.713873] 001: systemd[1]: Starting Apply Kernel Variables...
[    1.730069] 001: systemd[1]: Started File System Check on Root Device.
[    1.731304] 001: systemd[1]: Started Journal Service.
[    1.795727] 001: EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    1.852883] 001: systemd-journald[269]: Received client request to flush runtime journal.
[    2.727455] 000: [VPU Encoder] enable mu for core[0]
[    2.735762] 000: [VPU Encoder] vpu encoder core[0] firmware version is 1.3.0
[    3.060600] 000: CAN device driver interface
[    4.276025] 000: EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[    4.332812] 001: FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    4.343777] 001: FAT-fs (mmcblk0p4): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    4.446769] 000: EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
[    5.553896] 000: Bluetooth: Core ver 2.22
[    5.557101] 000: NET: Registered protocol family 31
[    5.557117] 000: Bluetooth: HCI device and connection manager initialized
[    5.557136] 000: Bluetooth: HCI socket layer initialized
[    5.557144] 000: Bluetooth: L2CAP socket layer initialized
[    5.557172] 000: Bluetooth: SCO socket layer initialized
[    5.738858] 001: Micrel KSZ8041 5b040000.ethernet-1:01: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=5b040000.ethernet-1:01, irq=POLL)
[    5.768589] 001: Micrel KSZ8041 5b040000.ethernet-1:02: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=5b040000.ethernet-1:02, irq=POLL)
[    6.752404] 001: fec 5b050000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[    6.752459] 001: IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[    7.808405] 000: fec 5b040000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[    7.808459] 000: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   31.711638] 001: 3.3V: disabling
[   46.978714] 000: audit: type=1006 audit(1690518737.548:2): pid=697 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=1 res=1
[   47.324868] 000: audit: type=1006 audit(1690518737.896:3): pid=702 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=2 res=1
root@colibri-imx8x-14714445:~#

Hi @xMark94

I’m not sure if I got it correctly, if you do an:

ifconfig eth1 down
ifconfig eth1 up

Then the led-mode is set correctly? If so, I assume that the phy is already up when the Linux driver loads and therefore it will not do a reconfiguration of it. Do you have a reset pin that you could use to reset the PHY via GPIO? Most likely if you keep it in reset and just release it by assigning a reset-gpio could help:

		ethphy1: ethernet-phy@1 {
			compatible = "ethernet-phy-ieee802.3-c22";
			max-speed = <100>;
			micrel,led-mode = <1>;
			reset-gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
			reg = <1>;
		};

Regards,
Stefan