DESK-MX6UL-L/Peripherals/Ethernet

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2021/07/20

First DESK-MX6UL-L release

2022/03/16

DESK-MX6UL-L 3.0.0 release

2023/05/04

DESK-MX6UL-L 4.0.0 release
2024/08/07 DESK-MX6UL-L 4.2.x release



Peripheral Ethernet[edit | edit source]

The ethernet interface is made available through the i.MX6UL fec interface which should be initialized on the device tree.

Device tree configuration[edit | edit source]

Axel ULite SOM[edit | edit source]

Here below is an example of device tree configuration used on standard DAVE's kit for the AXEL ULite SOM:

From imx6ul-axelulite.dtsi:

&fec1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet1>;
        phy-mode = "rmii";
        phy-handle = <&ethphy0>;
        status = "okay";

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

                ethphy0: ethernet-phy@3 {
                        compatible = "ethernet-phy-ieee802.3-c22";
                        reg = <3>;
			micrel,led-mode = <1>;
			clocks = <&clks IMX6UL_CLK_ENET_REF>;
			clock-names = "rmii-ref";
                };
        };
};
...
...
&iomuxc {
...
...
                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  0x4001b0a8
                                MX6UL_PAD_GPIO1_IO07__ENET1_MDC         0x1b0b0
                                MX6UL_PAD_GPIO1_IO06__ENET1_MDIO        0x1b0b0
                                MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01      0x1b0b0         /* ETH_PHY_RST */
                                MX6UL_PAD_SNVS_TAMPER2__GPIO5_IO02      0x1b0b0         /* ETH_INT */
                        >;
                };

...
...
};

RIALTO SBC[edit | edit source]

Here below is an example of device tree configuration used on standard DAVE's kit for the RIALTO SBC:

From imx6ul-lynx-som0022.dtsi:

...
...
&fec1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_enet1>;
	phy-mode = "rmii";
	phy-handle = <&ethphy0>;
	phy-reset-gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
	phy-reset-post-delay = <50>;
	status = "okay";
	fsl,dev_id = <0>;

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

		ethphy0: ethernet-phy@3 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <0x03>;
			micrel,led-mode = <1>;
			clocks = <&clks IMX6UL_CLK_ENET_REF>;
			clock-names = "rmii-ref";
		};
	};
};
...
...
&iomuxc {
...
...
		pinctrl_enet1: enet1grp-1 {
			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_GPIO1_IO07__ENET1_MDC		0x1b0b0
				MX6UL_PAD_GPIO1_IO06__ENET1_MDIO	0x1b0b0
			>;
		};
...
...
		pinctrl_enet2: enet2grp {
			fsl,pins = <
				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
			>;
		};
...
...
}
...
...

From imx6ul-lynx-som0022-cb0090.dts:

...
...
&fec2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet2>;
        phy-mode = "rmii";
        phy-handle = <&ethphy1>;
        status = "okay";
};

&mdio {
        ethphy1: ethernet-phy@0 {
                compatible = "ethernet-phy-ieee802.3-c22";
                reg = <0>;
                micrel,led-mode = <1>;
                clocks = <&clks IMX6UL_CLK_ENET2_REF>;
                clock-names = "rmii-ref";
        };
};
...
...

Accessing the peripheral in Axel ULite SOM[edit | edit source]

AXEL ULite SOM provides the primary network interface mapped at eth0.

Linux messages at boot time[edit | edit source]

...
...
[    1.771162] fec 2188000.ethernet eth0: registered PHC device 0
[   23.370105] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
...
...
[   20.262485] Micrel KSZ8081 or KSZ8091 2188000.ethernet-1:03: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:03, irq=POLL)
...
...

Cable connection:

...
...
[   93.046409] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
...
...

Check the interface with ifconfig[edit | edit source]

root@desk-mx6ul-axelulite:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.4.159  netmask 255.255.255.0  broadcast 192.168.4.255
        inet6 fe80::bc0a:b6ff:fe9b:b0f8  prefixlen 64  scopeid 0x20<link>
        ether be:0a:b6:9b:b0:f8  txqueuelen 1000  (Ethernet)
        RX packets 331  bytes 36636 (35.7 KiB)
        RX errors 0  dropped 47  overruns 0  frame 0
        TX packets 77  bytes 11278 (11.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Test with iperf[edit | edit source]

root@desk-mx6ul-axelulite:~# iperf3 -t 5 -c 192.168.4.47
Connecting to host 192.168.4.47, port 5201
[  5] local 192.168.4.159 port 56244 connected to 192.168.4.47 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.3 MBytes  94.7 Mbits/sec    0    143 KBytes       
[  5]   1.00-2.00   sec  10.8 MBytes  90.4 Mbits/sec    0    143 KBytes       
[  5]   2.00-3.00   sec  10.8 MBytes  90.1 Mbits/sec    0    150 KBytes       
[  5]   3.00-4.00   sec  10.9 MBytes  91.2 Mbits/sec    0    150 KBytes       
[  5]   4.00-5.00   sec  10.8 MBytes  90.3 Mbits/sec    0    157 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec  54.4 MBytes  91.3 Mbits/sec    0             sender
[  5]   0.00-5.05   sec  54.1 MBytes  89.9 Mbits/sec                  receiver

iperf Done.


Accessing the peripheral in RIALTO SBC[edit | edit source]

RIALTO SBC provides the primary network interface mapped at eth0.

Linux messages at boot time[edit | edit source]

...
...
[    2.501689] fec 2188000.ethernet eth0: registered PHC device 0
[    3.215129] fec 20b4000.ethernet eth1: registered PHC device 1
...
...
[   22.091756] Micrel KSZ8081 or KSZ8091 2188000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL)
[   22.201649] Micrel KSZ8081 or KSZ8091 2188000.ethernet-1:03: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:03, irq=POLL)
...
...
[   25.209227] fec 20b4000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[   25.289308] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
...
...

Check the interface with ifconfig[edit | edit source]

root@desk-mx6ul-rialto:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.89  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::72b3:d5ff:fe3e:ad88  prefixlen 64  scopeid 0x20<link>
        ether 70:b3:d5:3e:ad:88  txqueuelen 1000  (Ethernet)
        RX packets 46  bytes 4780 (4.6 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 24  bytes 3909 (3.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.11.89  netmask 255.255.255.0  broadcast 192.168.11.255
        inet6 fe80::72b3:d5ff:fe3e:ad89  prefixlen 64  scopeid 0x20<link>
        ether 70:b3:d5:3e:ad:89  txqueuelen 1000  (Ethernet)
        RX packets 49  bytes 5633 (5.5 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 25  bytes 4007 (3.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
...
...

root@desk-mx6ul-rialto:~#

Test with iperf[edit | edit source]

root@desk-mx6ul-rialto:~# iperf3 -t 5 -c 192.168.0.99
Connecting to host 192.168.0.99, port 5201
[  5] local 192.168.0.89 port 39480 connected to 192.168.0.99 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.2 MBytes  94.0 Mbits/sec    0    147 KBytes
[  5]   1.00-2.00   sec  10.9 MBytes  91.1 Mbits/sec    0    147 KBytes
[  5]   2.00-3.00   sec  10.7 MBytes  89.8 Mbits/sec    0    147 KBytes
[  5]   3.00-4.00   sec  10.8 MBytes  90.7 Mbits/sec    0    156 KBytes
[  5]   4.00-5.00   sec  10.8 MBytes  90.2 Mbits/sec    0    156 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec  54.4 MBytes  91.2 Mbits/sec    0             sender
[  5]   0.00-5.04   sec  54.0 MBytes  89.9 Mbits/sec                  receiver

iperf Done.
root@desk-mx6ul-rialto:~# iperf3 -t 5 -c 192.168.11.99
Connecting to host 192.168.11.99, port 5201
[  5] local 192.168.11.89 port 40244 connected to 192.168.11.99 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.3 MBytes  94.7 Mbits/sec    0    143 KBytes
[  5]   1.00-2.00   sec  10.8 MBytes  90.7 Mbits/sec    0    143 KBytes
[  5]   2.00-3.00   sec  10.8 MBytes  90.6 Mbits/sec    0    157 KBytes
[  5]   3.00-4.00   sec  10.6 MBytes  89.1 Mbits/sec    0    158 KBytes
[  5]   4.00-5.00   sec  10.8 MBytes  91.0 Mbits/sec    0    158 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec  54.4 MBytes  91.2 Mbits/sec    0             sender
[  5]   0.00-5.04   sec  54.1 MBytes  90.0 Mbits/sec                  receiver

iperf Done.
root@desk-mx6ul-rialto:~#