Difference between revisions of "DESK-MX6-L/Peripherals/Ethernet"

From DAVE Developer's Wiki
Jump to: navigation, search
m (U0007 moved page DESK-MX6-L/Pheripherals/Ethernet to DESK-MX6-L/Peripherals/Ethernet without leaving a redirect)
m (U0009 moved page AXEL Lite SOM/DESK-MX6-L/Pheripherals/Ethernet to DESK-MX6-L/Pheripherals/Ethernet: modifica gestione DESK come prodotto a se stante)
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<section begin="History" />
+
<section begin=History/>
 
{| style="border-collapse:collapse; "
 
{| style="border-collapse:collapse; "
! colspan="4" style="width:100%; text-align:left" ; border-bottom:solid 2px #ededed" |History
+
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
 
|-  
 
|-  
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Issue Date
+
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Version
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Notes
+
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
 +
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
|-
 
|-
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |{{oldid|14103|2021/07/16}}
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|1.0.0
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |First DESK-MX6-L release
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Oct 2020
|-
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK release
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |{{oldid|16270|2022/03/03}}
 
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |DESK-MX6-L 3.0.0 release
 
|-
 
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |{{oldid|16996|2022/05/11}}
 
| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |Added info for 1Gbps connection
 
|-
 
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |2023/04/11
 
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX6-L 4.0.0 release
 
 
|-
 
|-
 
|}
 
|}
<section end="History" />
+
<section end=History/>
<section begin="Body" />
+
<section begin=Body/>
  
 
==Peripheral Ethernet ==
 
==Peripheral Ethernet ==
Line 36: Line 29:
 
     pinctrl-0 = <&pinctrl_enet_axel>;
 
     pinctrl-0 = <&pinctrl_enet_axel>;
 
     phy-mode = "rgmii";
 
     phy-mode = "rgmii";
     phy-handle = <&\ethphy>;
+
     phy-handle = <&ethphy>;
 
     status = "okay";
 
     status = "okay";
  
Line 90: Line 83:
 
...
 
...
 
...
 
...
[    3.355256] fec 2188000.ethernet eth0: registered PHC device 0
+
[    2.373438] fec 2188000.ethernet: 2188000.ethernet supply phy not found, using dummy regulator
...
+
[   2.393396] fec 2188000.ethernet eth0: registered PHC device 0
...
 
[   16.138362] Micrel KSZ9031 Gigabit PHY 2188000.ethernet-1:07: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:07, irq=POLL)
 
 
...
 
...
 
...
 
...
 +
[    5.235075] Micrel KSZ9031 Gigabit PHY 2188000.ethernet-1:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=2188000.ethernet-1:07, irq=POLL)
 +
[    5.249686] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
 
</pre>
 
</pre>
  
Line 103: Line 96:
 
...
 
...
 
...
 
...
[   18.235470] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
+
[   7.364256] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
...
+
[    7.383799] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
...
+
[    7.417007]      device=eth0, hwaddr=fa:2a:07:88:45:42, ipaddr=192.168.0.90, mask=255.255.255.0, gw=255.255.255.255
 
</pre>
 
</pre>
  
Line 112: Line 105:
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
 
root@desk-mx6:~# ifconfig eth0
 
root@desk-mx6:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
+
eth0     Link encap:Ethernet HWaddr fa:2a:07:88:45:42
        inet 192.168.4.186 netmask 255.255.255.0 broadcast 192.168.4.255
+
          inet addr:192.168.0.90  Bcast:192.168.0.255 Mask:255.255.255.0
        inet6 fe80::b8c5:33ff:fe96:eeb  prefixlen 64  scopeid 0x20<link>
+
          inet6 addr: fe80::f82a:7ff:fe88:4542/64 Scope:Link
        ether ba:c5:33:96:0e:eb  txqueuelen 1000  (Ethernet)
+
          UP BROADCAST RUNNING MULTICAST MTU:1500  Metric:1
        RX packets 355  bytes 45752 (44.6 KiB)
+
          RX packets:126363 errors:0 dropped:0 overruns:0 frame:0
        RX errors 0 dropped 75  overruns 0 frame 0
+
          TX packets:64259 errors:0 dropped:0 overruns:0 carrier:0
        TX packets 57  bytes 7691 (7.5 KiB)
+
          collisions:0 txqueuelen:1000
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
+
          RX bytes:103276957 (98.4 MiB)  TX bytes:19090409 (18.2 MiB)
</pre>
 
  
==== Test with [https://iperf.fr/ iperf] ====
+
root@desk-mx6:~#
 
 
<pre class="workstation-terminal">
 
root@desk-mx6:~# iperf3 -t 5 -c 192.168.4.47
 
Connecting to host 192.168.4.47, port 5201
 
[  5] local 192.168.4.186 port 48642 connected to 192.168.4.47 port 5201
 
[ ID] Interval          Transfer    Bitrate        Retr  Cwnd
 
[  5]  0.00-1.00  sec  11.4 MBytes  95.4 Mbits/sec    0  96.2 KBytes     
 
[  5]  1.00-2.00  sec  11.0 MBytes  92.4 Mbits/sec    0    102 KBytes     
 
[  5]  2.00-3.00  sec  11.1 MBytes  93.2 Mbits/sec    0    106 KBytes     
 
[  5]  3.00-4.00  sec  11.2 MBytes  93.8 Mbits/sec    0    106 KBytes     
 
[  5]  4.00-5.00  sec  11.0 MBytes  92.6 Mbits/sec    0    106 KBytes     
 
- - - - - - - - - - - - - - - - - - - - - - - - -
 
[ ID] Interval          Transfer    Bitrate        Retr
 
[  5]  0.00-5.00  sec  55.7 MBytes  93.5 Mbits/sec    0            sender
 
[  5]  0.00-5.05  sec  55.5 MBytes  92.3 Mbits/sec                  receiver
 
iperf Done.
 
</pre>
 
 
 
===Gigabit ethernet ===
 
AXEL LITE SOM provides the 4 twisted pair data line for interfacing a magnetic transformer supporting the Gigabit ethernet interface.
 
Due to the most popular and cheaper 100Mbps interface used in the Industrial field, the '''standard''' configuration (hardware and software) for the ethernet interface is 100Mbps. Furthermore, the 1Gps negotiation requires a longer time so, if not required, it is better to keep the interface configured at the real speed used.
 
 
 
The following paragraphs describe how to change the default configuration for supporting 1Gbps ethernet hardware and software configuration.
 
 
 
====Hardware connections====
 
The [[AXEL_Lite_SOM/AXEL_Lite_Evaluation_Kit/Electrical_and_Mechanical_Documents/Schematics#Schematics |AXEL Lite EVK schematics]] show how to connect the ethernet physical interface to a 10/100Mbs or 1Gbps connectors.
 
For a 1Gbps connection, it is enough to connect all 4 pair lines (in the EVK schematics there is an optional R-Pack RP2 to be mounted)
 
 
 
====Software configuration====
 
Standard [[DESK-MX6-L | DESK-MX6-L]] BSP is configured for a 100Mbps interface configuration. For enabling 1Gbps, the following u-boot environment variable has to be defined (and saved) in the environment:
 
<pre class="workstation-terminal">
 
=> setenv disable_giga 0
 
=> saveenv
 
</pre>
 
 
 
U-Boot network driver for the ethernet PHY <code>drivers/net/phy/micrel_ksz90x1.c</code> uses this variable for enabling/disabling the speed and autonegotiation for the ''1000 speed''.
 
 
 
Moreover, the following device tree entry in the <code>imx6dl-axellite.dtsi</code> (or <code>imx6q-axellite.dtsi</code> if the SOC is a i.MX6Q) file, should be changed from:
 
<pre>
 
&ethphy {
 
max-speed = <100>;
 
};
 
</pre>
 
to:
 
<pre>
 
&ethphy {
 
max-speed = <1000>;
 
};
 
</pre>
 
 
 
====Limitations====
 
As per official NXP Chip errata documentation [https://www.nxp.com/docs/en/errata/IMX6SDLCE.pdf ERR004512], the i.MX6S/DL/Q have a maximum performance limited to '''470Mpbs''':
 
 
 
''The theoretical maximum performance of 1 Gbps ENET is limited to 470 Mbps (total for Tx and Rx). The actual measured performance in an optimized environment is up to 400 Mbps''
 
 
 
====Linux messages at boot time====
 
Cable connection:
 
 
 
<pre class="workstation-terminal">
 
...
 
...
 
[  15.360433] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
 
[  15.368136] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
 
...
 
...
 
 
</pre>
 
</pre>
  
 
==== Test with [https://iperf.fr/ iperf] ====
 
==== Test with [https://iperf.fr/ iperf] ====
The following test shows a ''real case'' with a 390Mbps transfer rate (depending on the testbed) but a >=400Mbps (limited to 470Mbps) can be obtained:
 
  
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
root@desk-mx6:~# iperf3 -c 192.168.8.125
+
root@imx6qdlxelk:~# iperf3 -t 5 -c 192.168.0.125
Connecting to host 192.168.8.125, port 5201
+
Connecting to host 192.168.0.125, port 5201
[  5] local 192.168.8.106 port 35804 connected to 192.168.8.125 port 5201
+
[  5] local 192.168.0.90 port 45808 connected to 192.168.0.125 port 5201
 
[ ID] Interval          Transfer    Bitrate        Retr  Cwnd
 
[ ID] Interval          Transfer    Bitrate        Retr  Cwnd
[  5]  0.00-1.00  sec  46.5 MBytes   390 Mbits/sec    0    352 KBytes
+
[  5]  0.00-1.00  sec  11.5 MBytes 96.4 Mbits/sec    0    156 KBytes
[  5]  1.00-2.00  sec  46.4 MBytes   389 Mbits/sec    0    368 KBytes
+
[  5]  1.00-2.00  sec  11.2 MBytes 93.8 Mbits/sec    0    191 KBytes
[  5]  2.00-3.00  sec  46.5 MBytes   390 Mbits/sec    0    443 KBytes
+
[  5]  2.00-3.00  sec  11.2 MBytes 93.8 Mbits/sec    0    212 KBytes
[  5]  3.00-4.00  sec  47.0 MBytes   394 Mbits/sec    0    443 KBytes
+
[  5]  3.00-4.00  sec  11.2 MBytes  93.8 Mbits/sec    0    212 KBytes
[ 5]  4.00-5.00  sec  46.8 MBytes  393 Mbits/sec    0    462 KBytes
+
[  5]  4.00-5.00  sec  11.3 MBytes  94.9 Mbits/sec    0    242 KBytes
[  5]  5.00-6.00  sec  45.4 MBytes  381 Mbits/sec    0    387 KBytes
 
[  5]  6.00-7.00  sec  46.4 MBytes  389 Mbits/sec    0    410 KBytes
 
5]  7.00-8.00  sec  45.9 MBytes   385 Mbits/sec    0    461 KBytes
 
[ 5]  8.00-9.00  sec  47.4 MBytes  397 Mbits/sec    0    474 KBytes
 
[  5]  9.00-10.00  sec  46.4 MBytes  389 Mbits/sec    0    495 KBytes
 
 
- - - - - - - - - - - - - - - - - - - - - - - - -
 
- - - - - - - - - - - - - - - - - - - - - - - - -
 
[ ID] Interval          Transfer    Bitrate        Retr
 
[ ID] Interval          Transfer    Bitrate        Retr
[  5]  0.00-10.00  sec  465 MBytes   390 Mbits/sec    0            sender
+
[  5]  0.00-5.00   sec 56.4 MBytes 94.6 Mbits/sec    0            sender
[  5]  0.00-10.00  sec  463 MBytes   389 Mbits/sec                  receiver
+
[  5]  0.00-5.00   sec 55.7 MBytes 93.5 Mbits/sec                  receiver
  
 
iperf Done.
 
iperf Done.
root@desk-mx6:~#
+
root@imx6qdlxelk:~#
 
</pre>
 
</pre>
  
<section end="Body" />
+
<section end=Body/>
 
 
  
 
----
 
----
  
 
[[Category:AXEL Lite]]
 
[[Category:AXEL Lite]]

Revision as of 14:23, 16 July 2021

History
Version Issue Date Notes
1.0.0 Oct 2020 First DESK release


Peripheral Ethernet[edit | edit source]

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

Device tree configuration[edit | edit source]

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

From imx6qdl-axelcommon.dtsi :

&fec {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_enet_axel>;
    phy-mode = "rgmii";
    phy-handle = <&ethphy>;
    status = "okay";

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

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

&iomuxc {
...
...
    enet {
        pinctrl_enet_axel: enetgrp-1 {
            fsl,pins = <
                MX6QDL_PAD_ENET_MDIO__ENET_MDIO       0x1b0b0
                MX6QDL_PAD_ENET_MDC__ENET_MDC         0x1b0b0
                MX6QDL_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
                MX6QDL_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
                MX6QDL_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
                MX6QDL_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
                MX6QDL_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
                MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
                MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
                MX6QDL_PAD_RGMII_RXC__RGMII_RXC       0x1b0b0
                MX6QDL_PAD_RGMII_RD0__RGMII_RD0       0x1b0b0
                MX6QDL_PAD_RGMII_RD1__RGMII_RD1       0x1b0b0
                MX6QDL_PAD_RGMII_RD2__RGMII_RD2       0x1b0b0
                MX6QDL_PAD_RGMII_RD3__RGMII_RD3       0x1b0b0
                MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
                MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28     0xb0b1
                MX6QDL_PAD_SD4_DAT3__GPIO2_IO11        0xb0b1
                MX6QDL_PAD_SD4_DAT2__GPIO2_IO10        0xb0b1
            >;
        };
    };
...
...
};

Accessing the peripheral[edit | edit source]

AXEL LITE SOM provides the network interface mapped at eth0.

Linux messages at boot time[edit | edit source]

...
...
[    2.373438] fec 2188000.ethernet: 2188000.ethernet supply phy not found, using dummy regulator
[    2.393396] fec 2188000.ethernet eth0: registered PHC device 0
...
...
[    5.235075] Micrel KSZ9031 Gigabit PHY 2188000.ethernet-1:07: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=2188000.ethernet-1:07, irq=POLL)
[    5.249686] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

Cable connection:

...
...
[    7.364256] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[    7.383799] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    7.417007]      device=eth0, hwaddr=fa:2a:07:88:45:42, ipaddr=192.168.0.90, mask=255.255.255.0, gw=255.255.255.255

Check the interface with ifconfig[edit | edit source]

root@desk-mx6:~# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr fa:2a:07:88:45:42
          inet addr:192.168.0.90  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::f82a:7ff:fe88:4542/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:126363 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64259 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:103276957 (98.4 MiB)  TX bytes:19090409 (18.2 MiB)

root@desk-mx6:~#

Test with iperf[edit | edit source]

root@imx6qdlxelk:~#  iperf3 -t 5 -c 192.168.0.125
Connecting to host 192.168.0.125, port 5201
[  5] local 192.168.0.90 port 45808 connected to 192.168.0.125 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.5 MBytes  96.4 Mbits/sec    0    156 KBytes
[  5]   1.00-2.00   sec  11.2 MBytes  93.8 Mbits/sec    0    191 KBytes
[  5]   2.00-3.00   sec  11.2 MBytes  93.8 Mbits/sec    0    212 KBytes
[  5]   3.00-4.00   sec  11.2 MBytes  93.8 Mbits/sec    0    212 KBytes
[  5]   4.00-5.00   sec  11.3 MBytes  94.9 Mbits/sec    0    242 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-5.00   sec  56.4 MBytes  94.6 Mbits/sec    0             sender
[  5]   0.00-5.00   sec  55.7 MBytes  93.5 Mbits/sec                  receiver

iperf Done.
root@imx6qdlxelk:~#