There are 4 Ethernet ports available on the MACCHIATObin board. In order to update the MAC addresses for these Ethernet interfaces, you can setup proper variables under U-Boot and save them to SPI flash, then the new addresses will be picked up by Linux automatically.
The table below shows the mapping of the U-Boot variable to Ethernet interface under Linux. When you assign a MAC address to one of the variable, this MAC address will be used on its corresponding Ethernet port in the table.
U-Boot Variable | Linux Ethernet port | |
ethaddr | eth0 | |
eth1addr | Not Mapped | |
eth2addr | Not Mapped | |
eth3addr | eth1 | |
eth4addr | eth2 | |
eth5addr | eth3 |
The example below shows how the U-Boot variables are setup under the U-Boot command console:
Marvell>> setenv ethaddr 02:50:43:ff:ff:01 Marvell>> setenv eth1addr 02:50:43:ff:ff:01 Marvell>> setenv eth2addr 02:50:43:ff:ff:01 Marvell>> setenv eth3addr 02:50:43:ff:ff:02 Marvell>> setenv eth4addr 02:50:43:ff:ff:03 Marvell>> setenv eth5addr 02:50:43:ff:ff:04 Marvell>> save
Note
To ensure the MAC address mapping is done correctly, please setup ALL the ethXaddr variables under the U-Boot, even for the unused eth1addr and eth2addr. The future versions of the U-Boot will remove this constraint.
After the MAC addresses are saved in the U-Boot, boot to Linux and use ifconfig -a to confirm the addresses being picked up by the eth devices accordingly.
# ifconfig -a bond0 Link encap:Ethernet HWaddr 06:57:EB:C7:7D:A0 BROADCAST MASTER 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) eth0 Link encap:Ethernet HWaddr 02:50:43:FF:FF:01 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:2048 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth1 Link encap:Ethernet HWaddr 02:50:43:FF:FF:02 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:2048 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth2 Link encap:Ethernet HWaddr 02:50:43:FF:FF:03 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:2048 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth3 Link encap:Ethernet HWaddr 02:50:43:FF:FF:04 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:2048 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)