This application note explains how to configure and use Ethernet on the i.MX 8M SOM.
Ethernet Configuration
If you have several IMX8M Starter Kits in a single LAN, check that they all have different MAC addresses. Reset the system and enter the U-Boot command line interface by pressing an arbitrary key on the serial console. Check the MAC address:
u-boot=> print ethaddr
ethaddr=3C:FB:96:77:88:A0
If necessary, modify the MAC address to a unique value:
u-boot=> setenv ethaddr 3C:FB:96:77:88:A1
u-boot=> saveenv
Saving Environment to MMC...
Writing to MMC(1)... done
u-boot=>
Linux running on the i.MX 8M SOM is configured to obtain the networking parameters via DHCP client automatically. Configure a DHCP server for your LAN. Boot the i.MX 8M SOM board to the Linux shell prompt and the system should be ready to access the Internet:
root@imx8m-som:~# ping google.com
PING google.com (216.58.193.206) 56(84) bytes of data.
64 bytes from lax02s23-in-f14.1e100.net (216.58.193.206): icmp_seq=1 ttl=54
time=12.7 ms
64 bytes from lax02s23-in-f14.1e100.net (216.58.193.206): icmp_seq=2 ttl=54
time=12.5 ms
64 bytes from lax02s23-in-f14.1e100.net (216.58.193.206): icmp_seq=3 ttl=54
time=12.7 ms
Ethernet Throughput
The following session measures Ethernet throughput in a 1Gb network:
- Connect the board to a 1Gb switch with Ethernet cable.
- Boot the board to the shell prompt.
- Run the following command:
/ # dmesg
- In the demsg output, validate that the link is reported as 1Gbps:
[ 6.623958] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control rx/tx
- Measure Ethernet performance by copying a file over NFS. Measured throughput is around 74 MB per second:
root@imx8m-som:~# mount -o nolock 172.17.0.155:/work/psl /mnt/
root@imx8mqevk:~# ls -l /mnt
...
-rw-r--r-- 1 1001 pulse 108836351 Dec 12 2013 ppc-20070430.tgz
...
root@imx8m-som:~# time cp /mnt/ppc-20070430.tgz /dev/null
real 0m1.386s
user 0m0.000s
sys 0m0.208s
root@imx8m-som:~#
Similarly, the following session measures Ethernet throughput in a 100Mb network:
- Connect the board to a 100Mb switch with Ethernet cable.
- Boot the board to the shell prompt.
- Run the following command:
/ # dmesg
- In the demsg output, validate that the link is reported as 100Mbps in the following string:
[ 1229.279955] fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full -
flow control rx/tx
- Measure Ethernet performance by copying a file over NFS. Measured throughput is around 11 MB per second:
root@imx8m-som:~# mount -o nolock 172.17.0.155:/work/psl /mnt/
root@imx8mqevk:~# ls -l /mnt
...
-rw-r--r-- 1 1001 pulse 108836351 Dec 12 2013 ppc-20070430.tgz
...
root@imx8m-som:~# time cp /mnt/ppc-20070430.tgz /dev/null
real 0m9.284s
user 0m0.000s
sys 0m0.176s
root@imx8m-som:~#
Ethernet Link Detection
The Linux device driver automtically detects presence of the Ethernet link. This is illustrated by the following test scenario:
- Un-plug the Ethernet cable from the board.
- In 1-2 seconds, the following message will appear:
/ # [ 1365.471165] fec 30be0000.ethernet eth0: Link is Down
- Plug the Ethernet cable back, the following message will appear:
[ 1404.383946] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control rx/tx
- Repeat the test several times:
[ 6.112528] fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full -
flow control rx/tx
[ 147.424399] fec 30be0000.ethernet eth0: Link is Down
[ 153.569143] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control rx/tx
[ 172.000184] fec 30be0000.ethernet eth0: Link is Down
[ 174.049011] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control rx/tx
[ 183.264137] fec 30be0000.ethernet eth0: Link is Down
[ 185.312980] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control rx/tx
[ 185.403796] random: crng init done
[ 193.504109] fec 30be0000.ethernet eth0: Link is Down
[ 200.672886] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full -
flow control rx/tx