Hello all.
Please we need assitance from Technical Support, urgent!
We have a Colibri module (imx6ULL) mounted in a custom carrier board and we want to use both of the ethernet interfaces available, the 1st one (with the PHY already integrated in the colibri module) and the 2nd one with an external PHY (in our case, we use the KSZ8081RNA).
We are experiencing a rare behaviour of the 2nd interface. The 2nd ethernet interface only works if the ethernet cable is connected in the 1st ethernet interface. Otherwise, the 2nd interface never comes up and doesn’t response. In other words, our sceneario is like this:
1st interface: cable connected
2nd interface: cable disconnected
=> 1st interface working just fine
1st interface: cable connected
2nd interface: cable connected
=> 1st and 2nd interface working just fine
1st interface: cable disconnected
2nd interface: cable connected
=> no activity in 2nd interface (and it doesn’t even detect the carrier)
Below is all the info regarding our SO, device tree, and console screen during and after booting.
Info about our SO and image (console screen during booting):
U-Boot 2020.07-5.7.0-devel+git.1cbeecee44a8 (Jun 27 2022 - 13:27:02 +0000)
CPU: Freescale i.MX6ULL rev1.1 900 MHz (running at 396 MHz)
CPU: Commercial temperature grade (0C to 95C) at 37C
Reset cause: POR
DRAM: 512 MiB
NAND: 512 MiB
MMC: FSL_SDHC: 0
Loading Environment from NAND… OK
In: serial
Out: serial
Err: serial
Model: Toradex Colibri iMX6ULL 512MB Wi-Fi / Bluetooth V1.1A, Serial# 06487386
Net: eth0: ethernet@20b4000
Hit any key to stop autoboot: 0
Booting from NAND…
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd5
ubi0: scanning is finished
ubi0: attached mtd5 (name “ubi”, size 508 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 4057, bad PEBs: 7, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 102/55, WL threshold: 4096, image sequence number: 657248818
ubi0: available PEBs: 0, total reserved PEBs: 4057, PEBs reserved for bad PEB handling: 73
No size specified → Using max size (6731448)
Read 6731448 bytes from volume kernel to 81000000
No size specified → Using max size (55505)
Read 55505 bytes from volume dtb to 82100000
Kernel image @ 0x81000000 [ 0x000000 - 0x66b6b8 ]
'## Flattened Device Tree blob at 82100000
Booting using the fdt blob at 0x82100000
Loading Device Tree to 8ffef000, end 8ffff8d0 … OK
Updating MTD partitions…
Device tree:
imx6ul.dtsi
...
fec1: ethernet@2188000 {
compatible = "fsl,imx6ul-fec", "fsl,imx6q-fec";
reg = <0x02188000 0x4000>;
interrupt-names = "int0", "pps";
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_ENET>,
<&clks IMX6UL_CLK_ENET_AHB>,
<&clks IMX6UL_CLK_ENET_PTP>,
<&clks IMX6UL_CLK_ENET_REF>,
<&clks IMX6UL_CLK_ENET_REF>;
clock-names = "ipg", "ahb", "ptp",
"enet_clk_ref", "enet_out";
fsl,num-tx-queues = <1>;
fsl,num-rx-queues = <1>;
stop-mode = <&gpr 0x10 3>;
fsl,magic-packet;
fsl,wakeup_irq = <0>;
status = "disabled";
};
...
fec2: ethernet@20b4000 {
compatible = "fsl,imx6ul-fec", "fsl,imx6q-fec";
reg = <0x020b4000 0x4000>;
interrupt-names = "int0", "pps";
interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_ENET>,
<&clks IMX6UL_CLK_ENET_AHB>,
<&clks IMX6UL_CLK_ENET_PTP>,
<&clks IMX6UL_CLK_ENET2_REF_125M>,
<&clks IMX6UL_CLK_ENET2_REF_125M>;
clock-names = "ipg", "ahb", "ptp",
"enet_clk_ref", "enet_out";
fsl,num-tx-queues = <1>;
fsl,num-rx-queues = <1>;
stop-mode = <&gpr 0x10 4>;
fsl,magic-packet;
fsl,wakeup_irq = <0>;
status = "disabled";
};
...
imx6ull-colibri.dtsi:
...
{
aliases {
ethernet0 = &fec2;
ethernet1 = &fec1;
};
...
&fec2 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_enet2>;
pinctrl-1 = <&pinctrl_enet2_sleep>;
phy-mode = "rmii";
phy-handle = <ðphy1>;
phy-supply = <®_eth_phy>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy1: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
max-speed = <100>;
reg = <2>;
};
};
};
...
(inside &iomuxc, among other modules):
pinctrl_enet2: enet2-grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO06__ENET2_MDIO 0x1b0b0
MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
>;
};
pinctrl_enet2_sleep: enet2sleepgrp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO06__GPIO1_IO06 0x0
MX6UL_PAD_GPIO1_IO07__GPIO1_IO07 0x0
MX6UL_PAD_ENET2_RX_DATA0__GPIO2_IO08 0x0
MX6UL_PAD_ENET2_RX_DATA1__GPIO2_IO09 0x0
MX6UL_PAD_ENET2_RX_EN__GPIO2_IO10 0x0
MX6UL_PAD_ENET2_RX_ER__GPIO2_IO15 0x0
MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11 0x0
MX6UL_PAD_ENET2_TX_DATA1__GPIO2_IO12 0x0
MX6UL_PAD_ENET2_TX_EN__GPIO2_IO13 0x0
>;
};
imx6ull-colibri-eval-v3.dtsi: (our board is a custom board, we left the name of the eval-v3, but we are not using that board)
...
&fec1 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&pinctrl_enet1>;
pinctrl-1 = <&pinctrl_enet1_sleep>;
phy-mode = "rmii";
phy-reset-gpios = <&gpio5 4 GPIO_ACTIVE_LOW>;
phy-handle = <ðphy0>;
phy-supply = <®_eth_phy>;
status = "okay";
};
&fec2 {
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
max-speed = <100>;
reg = <0>;
};
ethphy1: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
max-speed = <100>;
reg = <2>;
};
};
};
...
&iomuxc {
imx6ull-colibri {
pinctrl_enet1: enet1-grp {
fsl,pins = <
MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0
MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x1b0b0
MX6UL_PAD_GPIO1_IO04__ENET1_REF_CLK1 0x4001b031
MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0
//Reset PHY
MX6ULL_PAD_SNVS_TAMPER4__GPIO5_IO04 0xb0
>;
};
pinctrl_enet1_sleep: enet1sleepgrp {
fsl,pins = <
MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00 0x0
MX6UL_PAD_ENET1_RX_DATA1__GPIO2_IO01 0x0
MX6UL_PAD_ENET1_RX_EN__GPIO2_IO02 0x0
MX6UL_PAD_ENET1_RX_ER__GPIO2_IO07 0x0
MX6UL_PAD_GPIO1_IO04__ENET1_REF_CLK1 0x4001b031
MX6UL_PAD_ENET1_TX_DATA0__GPIO2_IO03 0x0
MX6UL_PAD_ENET1_TX_DATA1__GPIO2_IO04 0x0
MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05 0x0
>;
};
};
};
Console screen (during boot):
(some other lines)
[ 1.440329] fec 20b4000.ethernet eth0: registered PHC device 0
[ 1.451462] pps pps1: new PPS source ptp1
[ 1.458622] fec 2188000.ethernet eth1: registered PHC device 1(some other lines)
Starting WPA supplicant…
[ 17.243461] Micrel KSZ8041 20b4000.ethernet-1:02: attached PHY driver [Micrel KSZ8041] (mii_bus:phy_addr=20b4000.ethernet-1:02, irq=POLL)
[ 17.295618] Generic PHY 20b4000.ethernet-1:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=20b4000.ethernet-1:00, irq=POLL)(some other lines)
Console screen (ifconfig and networkctl commands):
(no cables connected)
ifconfig
eth0 Link encap:Ethernet HWaddr 00:14:2D:62:FD:5A
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)eth1 Link encap:Ethernet HWaddr 00:14:2D:72:FD:5A
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:696 (696.0 B) TX bytes:696 (696.0 B)root@colibri-imx6ull-06487386:~# networkctl -a
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether no-carrier unmanaged
3 eth1 ether no-carrier unmanaged3 links listed.
(1st ethernet interface with cable connected)
root@colibri-imx6ull-06487386:~# [ 95.286050] fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 95.294628] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
networkctl -a
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether routable unmanaged
3 eth1 ether no-carrier unmanaged(with the cable connected in the 1st interface, 2nd ethernet interface with cable connected)
root@colibri-imx6ull-06487386:~# [ 108.806041] fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[ 108.814591] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes readyroot@colibri-imx6ull-06487386:~# networkctl -a
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether routable unmanaged
3 eth1 ether routable unmanaged3 links listed.
root@colibri-imx6ull-06487386:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:14:2D:62:FD:5A
inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::214:2dff:fe62:fd5a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:706 errors:0 dropped:0 overruns:0 frame:0
TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:59359 (57.9 KiB) TX bytes:15887 (15.5 KiB)eth1 Link encap:Ethernet HWaddr 00:14:2D:72:FD:5A
inet addr:192.168.1.93 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::214:2dff:fe72:fd5a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:464 errors:30 dropped:0 overruns:0 frame:30
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37185 (36.3 KiB) TX bytes:9709 (9.4 KiB)lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2251 (2.1 KiB) TX bytes:2251 (2.1 KiB)(with only the 2nd interface with the cable connected)
root@colibri-imx6ull-06487386:~# networkctl -a
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether no-carrier unmanaged
3 eth1 ether no-carrier unmanaged3 links listed.
root@colibri-imx6ull-06487386:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:14:2D:62:FD:5A
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:761 errors:0 dropped:0 overruns:0 frame:0
TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:63252 (61.7 KiB) TX bytes:17091 (16.6 KiB)eth1 Link encap:Ethernet HWaddr 00:14:2D:72:FD:5A
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:516 errors:38 dropped:0 overruns:0 frame:38
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:41571 (40.5 KiB) TX bytes:9709 (9.4 KiB)lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:44 errors:0 dropped:0 overruns:0 frame:0
TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3315 (3.2 KiB) TX bytes:3315 (3.2 KiB)
It seems like the 2nd interface is correlated in some way with the 1st one. If the cable is connected in the 1st interface, the 2nd one works perfect. But alone, it doesn’t.
From the hardware point of view, there is nothing thats make us suspect there is a problem.
We really don’t know if there is a problem with the driver assigned to the 2nd PHY or in the initialization of the PHY, or something in the device tree.
Hope a soon response.
Best regards,
Martin