Hi,
Our customer is using i.MX6ULL to develop their product, and needs two enets to work symultaneously.
Pins of enet0 an enet1 are configured same as EVK, and enable the enet1 in uboot (v2021.04, linux kernel is L5.4.200) same as enet0 initial code, but enet1 will switch back from up and down.
Below is the log, can you help to check this problem?
Thanks very much.
----log:
eth0 RJ45网口灯情况与eth1的相同
root@ATK-IMX6U:~# [ 28.443753] random: nonblocking pool is initialized
[ 32.003116] ICM20608 ID = 0XFF
[ 36.264418] fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[ 36.272316] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 38.264169] fec 2188000.ethernet eth1: Link is Down
[ 38.347731] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 39.264233] fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[ 39.272135] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 45.264011] fec 2188000.ethernet eth1: Link is Down
[ 45.337306] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 46.264339] fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[ 46.272237] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 48.264175] fec 2188000.ethernet eth1: Link is Down
[ 48.335074] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 50.264338] fec 2188000.ethernet eth1: Link is Up - 10Mbps/Full - flow control rx/tx
[ 50.272148] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
root@ATK-IMX6U:~#
root@ATK-IMX6U:~#
root@ATK-IMX6U:~# ifconfig
eth0 Link encap:Ethernet HWaddr 88:44:86:a4:dd:32
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 88:6b:33:84:25:6e
inet6 addr: fe80::8a6b:33ff:fe84:256e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:162 errors:26 dropped:0 overruns:0 frame:26
TX packets:119 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14617 (14.2 KiB) TX bytes:22473 (21.9 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:290 errors:0 dropped:0 overruns:0 frame:0
TX packets:290 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20072 (19.6 KiB) TX bytes:20072 (19.6 KiB)
root@ATK-IMX6U:~# [ 80.264172] fec 2188000.ethernet eth1: Link is Down
[ 80.353972] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 80.754214] fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 80.762115] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
ifconfig
eth0 Link encap:Ethernet HWaddr 88:44:86:a4:dd:32
inet addr:10.110.110.122 Bcast:10.110.110.255 Mask:255.255.255.0
inet6 addr: fe80::8a44:86ff:fea4:dd32/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:60 errors:3 dropped:0 overruns:0 frame:3
TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7545 (7.3 KiB) TX bytes:8890 (8.6 KiB)
eth1 Link encap:Ethernet HWaddr 88:6b:33:84:25:6e
UP BROADCAST MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:186 errors:30 dropped:0 overruns:0 frame:30
TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16274 (15.8 KiB) TX bytes:23063 (22.5 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:290 errors:0 dropped:0 overruns:0 frame:0
TX packets:290 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20072 (19.6 KiB) TX bytes:20072 (19.6 KiB)
uboot启动后网口提示内容:
主要能看出找不到 phy
U-Boot 2021.04-dirty (Oct 25 2023 - 14:44:23 +0800)
CPU: i.MX6ULL rev1.1 528 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 49C
Reset cause: POR
Model: i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment
[*]-Video Link 0 (480 x 272)
[0] lcdif@21c8000, video
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc1(part 0) is current device
flash target is MMC:1
Net:
Error: ethernet@20b4000 address not set.
Error: ethernet@20b4000 address not set.
Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle
Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2
Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle
Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2
No ethernet found.
uboot设备树对两个网口的配置:
&fec1 {
pinctrl-names = "default";
// pinctrl-0 = <&pinctrl_enet1>;
pinctrl-0 = <&pinctrl_enet1 &pinctrl_enet1_reset>;
phy-mode = "rmii";
phy-handle = <ðphy0>;
phy-reset-gpios = <&gpio5 7 GPIO_ACTIVE_LOW>;
phy-reset-duration = <200>;
status = "okay";
};
&fec2 {
pinctrl-names = "default";
// pinctrl-0 = <&pinctrl_enet2>;
pinctrl-0 = <&pinctrl_enet2 &pinctrl_enet2_reset>;
phy-mode = "rmii";
phy-handle = <ðphy1>;
phy-reset-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
phy-reset-duration = <200>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@2 {
reg = <2>;
micrel,led-mode = <1>;
clocks = <&clks IMX6UL_CLK_ENET_REF>;
clock-names = "rmii-ref";
};
ethphy1: ethernet-phy@1 {
reg = <1>;
micrel,led-mode = <1>;
clocks = <&clks IMX6UL_CLK_ENET2_REF>;
clock-names = "rmii-ref";
};
};
};
/*enet1 reset zuozhongkai*/
pinctrl_enet1_reset: enet1resetgrp {
fsl,pins = <
/* used for enet1 reset */
MX6UL_PAD_SNVS_TAMPER7__GPIO5_IO07 0x10B0 /* ENET1 RESET */
>;
};
/*enet2 reset zuozhongkai*/
pinctrl_enet2_reset: enet2resetgrp {
fsl,pins = <
/* used for enet2 reset */
MX6UL_PAD_SNVS_TAMPER8__GPIO5_IO08 0x10B0 /* ENET2 RESET */
>;
};
pinctrl_enet1: enet1grp {
fsl,pins = <
MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0
MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x1b0b0
MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0
MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0
MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0
MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0
MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b031
/* MX6UL_PAD_SNVS_TAMPER7__GPIO5_IO07 0x10b0 */
MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b009
>;
};
pinctrl_enet2: enet2grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0
MX6UL_PAD_GPIO1_IO06__ENET2_MDIO 0x1b0b0
MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0
MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0
MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0
MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0
MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031
/*MX6UL_PAD_SNVS_TAMPER8__GPIO5_IO08 0x10b0 */
MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b009
>;
};
内核设备树对网口的配置除了fec的配置不相同其余都相同:
&fec1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet1
&pinctrl_enet1_reset>;
phy-mode = "rmii";
phy-handle = <ðphy0>;
phy-reset-gpios = <&gpio5 7 GPIO_ACTIVE_LOW>;
phy-reset-duration = <200>;
status = "okay";
};
/*ETH1:恢复双网口,且共用一个reset引脚 2023-06-14 */
&fec2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_enet2
&pinctrl_enet2_reset>;
phy-mode = "rmii";
phy-handle = <ðphy1>;
phy-reset-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
phy-reset-duration = <200>;
status = "okay";
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethphy0: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};
ethphy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};
};
};