VAR-SOM-MX6 Eth MAC address: Difference between revisions

From Variscite Wiki
(Created page with "{{PageHeader|VAR-SOM-MX6 - Ethernet MAC address}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__ = The default MAC address = By default, Variscite provides its SOM...")
 
No edit summary
Line 1: Line 1:
{{PageHeader|VAR-SOM-MX6 - Ethernet MAC address}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__
{{PageHeader|VAR-SOM-MX6 - Ethernet MAC address}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__
= The default MAC address =
= The default MAC address =
By default, Variscite provides its SOMs with the a unique MAC address (starting with its F8:DC:7A OUI) already written to the SOC's appropriate On-Chip One Time Programmable eFuses (OCOTP).<br>
By default, Variscite provides its SOMs with a unique MAC address (starting with its F8:DC:7A OUI) already written to the SOC's appropriate On-Chip One Time Programmable eFuses (OCOTP).<br>
U-Boot and the kernel automatically reads it from the OCOTP and uses it.<br>
U-Boot and the kernel automatically reads it from the OCOTP and uses it.<br>



Revision as of 12:21, 21 March 2018

VAR-SOM-MX6 - Ethernet MAC address

The default MAC address

By default, Variscite provides its SOMs with a unique MAC address (starting with its F8:DC:7A OUI) already written to the SOC's appropriate On-Chip One Time Programmable eFuses (OCOTP).
U-Boot and the kernel automatically reads it from the OCOTP and uses it.

Using your own MAC address

In case you want to ignore the default MAC address, and use your own (e.g. 01:23:45:67:89:ab), you can do so by setting the following U-Boot environment variables.
To set the MAC address for U-Boot itself, set the ethaddr env. variable to your desired address, 01:23:45:67:89:ab.

When using recent kernel versions (v4+), the above is enough, as the kernel will also use this address.
When using older kernel versions, to set the MAC address for the kernel, add it to the kernel command line in a form of fec.macaddr=0x01,0x23,0x45,0x67,0x89,0xab.

You can either set the U-Boot environment variables from the U-Boot command line (boot the board, and hit any key to stop autoboot to get to it):

=> setenv ethaddr 01:23:45:67:89:ab
=> setenv kernelargs fec.macaddr=0x01,0x23,0x45,0x67,0x89,0xab   # Can be skipped for kernel versions > 4
=> saveenv

Or, you can do it from Linux, with u-boot-fw-utils (the set MAC address will be used starting from the following boot):

# fw_setenv ethaddr 01:23:45:67:89:ab
# fw_setenv kernelargs fec.macaddr=0x01,0x23,0x45,0x67,0x89,0xab   # Can be skipped for kernel versions > 4


Notes:

  • In case you wipe the U-Boot environment, for any reason, make sure to rewrite the MAC address to it.
  • To avoid having to rewrite the MAC address in case of wiping the environment, you can use an EEPROM on your carrier board to keep the MAC address and set the U-Boot environment automatically at U-Boot runtime, by reading the address from it.