i.MX6ULL dual enets failed to work simultaneously

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

i.MX6ULL dual enets failed to work simultaneously

1,102 次查看
jimmyli
Contributor IV

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 = <&ethphy0>;
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 = <&ethphy1>;
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 = <&ethphy0>;
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 = <&ethphy1>;
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>;
};
};
};
标签 (1)
0 项奖励
回复
7 回复数

914 次查看
xisuisan
Contributor I

U-Boot version: lf_v2021.04 Kernel version: 5.4.200 Note: On my development board, eth0 and eth1 share a common PHY chip!

The modifications I made are as follows:

  1. Restored the network interface pin configuration in the U-Boot device tree without modifying the U-Boot device tree.

  2. Made the following modifications to the device tree in the kernel:

ethphy0: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <2>;
};

0 项奖励
回复

1,077 次查看
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Could you share the full part number of the i.MX that you're using?
Please note that only MCIMX6Y2xxxxxxx can support 2 Ethernet Ifs.

Saludos,
Aldo.

0 项奖励
回复

1,053 次查看
jimmyli
Contributor IV

Hello,

     The full part No. is MCIMX6Y2CVM05AB.

      Yes. As mentioned above, we are trying to enable two ENETs. Offical bsp only enable ENET0, so we try to enable another ENET1, but fail.

 

     Thanks very much.

0 项奖励
回复

1,041 次查看
AldoG
NXP TechSupport
NXP TechSupport

Hello,

I was double checking the device tree bindings you have shared, and I noticed that in here:

ethphy0: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
};

ethphy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <1>;
};

Please change the ID number for the first phy, so it looks like this:

ethphy0: ethernet-phy@2 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <2>;
};

Please try it and let me know of the results,
Saludos,
Aldo.

0 项奖励
回复

972 次查看
xisuisan
Contributor I

Dear  AIdoG,

Following your instructions, I made modifications to my kernel device tree and successfully assigned IP addresses to two network interfaces. It could be due to both interfaces sharing a single PHY chip on the hardware. After conducting my tests, I observed that eth1 needs to be brought up and assigned an IP address first. Only then can eth0 obtain an IP address via dhclient. Additionally, when I bring down either eth1 or eth0, the other interface is also set to "DOWN" at the data link layer. For detailed information, please refer to my log files.

 

0 项奖励
回复

963 次查看
AldoG
NXP TechSupport
NXP TechSupport

Hi,

Please do help me creating a new thread.

Also, please share the device tree and the changes you made.

Thank you,
Saludos,
Aldo.

0 项奖励
回复

1,032 次查看
jimmyli
Contributor IV

Dear Aldo,

        Thanks very much for your help.

        We will try again.

0 项奖励
回复