<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.somlabs.com/index.php?action=history&amp;feed=atom&amp;title=Setting_MAC_address_on_VisionSOM-8Mmini</id>
	<title>Setting MAC address on VisionSOM-8Mmini - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.somlabs.com/index.php?action=history&amp;feed=atom&amp;title=Setting_MAC_address_on_VisionSOM-8Mmini"/>
	<link rel="alternate" type="text/html" href="https://wiki.somlabs.com/index.php?title=Setting_MAC_address_on_VisionSOM-8Mmini&amp;action=history"/>
	<updated>2026-04-28T06:05:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.somlabs.com/index.php?title=Setting_MAC_address_on_VisionSOM-8Mmini&amp;diff=3152&amp;oldid=prev</id>
		<title>KrzysztofChojnowski: Created page with &quot;{{PageHeader|Setting MAC address on VisionSOM-8Mmini}}  __toc__  This article describes a couple of methods to set the board MAC address and avoid the assignment its random va...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.somlabs.com/index.php?title=Setting_MAC_address_on_VisionSOM-8Mmini&amp;diff=3152&amp;oldid=prev"/>
		<updated>2023-02-03T15:34:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{PageHeader|Setting MAC address on VisionSOM-8Mmini}}  __toc__  This article describes a couple of methods to set the board MAC address and avoid the assignment its random va...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PageHeader|Setting MAC address on VisionSOM-8Mmini}}&lt;br /&gt;
&lt;br /&gt;
__toc__&lt;br /&gt;
&lt;br /&gt;
This article describes a couple of methods to set the board MAC address and avoid the assignment its random value after device reboot.&lt;br /&gt;
&lt;br /&gt;
== Setting MAC address in systemd-networkd service files ==&lt;br /&gt;
&lt;br /&gt;
The systemd-networkd interface configuration is stored in the *.network files within the &amp;#039;&amp;#039;/etc/systemd/network&amp;#039;&amp;#039; directory. To assign a MAC address to the chosen interface a new configuration file should be created (if it does not exist already). For the &amp;#039;&amp;#039;eth0&amp;#039;&amp;#039; interface a file named &amp;#039;&amp;#039;25-eth.network&amp;#039;&amp;#039; may be created with the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Match]&lt;br /&gt;
Name=eth0&lt;br /&gt;
&lt;br /&gt;
[Link]&lt;br /&gt;
MACAddress=fe:51:11:6c:62:e8&lt;br /&gt;
&lt;br /&gt;
[Network]&lt;br /&gt;
DHCP=ipv4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file will assign the given address to the &amp;#039;&amp;#039;eth0&amp;#039;&amp;#039; interface and enable the DHCP client for IPv4 address setting. More information may be found on the systemd-networkd service documentation.&lt;br /&gt;
&lt;br /&gt;
== U-Boot env variable ==&lt;br /&gt;
&lt;br /&gt;
The default U-Boot configuration for VisionSOM boards generates a random MAC address for the ETH interface. This behaviour may be changed by adding a new env variable to the U-Boot. For VisionSOM-8Mmini, the environment variables are stored in &amp;#039;&amp;#039;include/configs/visionsom_8mm.h&amp;#039;&amp;#039; file. A new MAC address may be set by adding the following variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ethaddr=fe:51:11:6c:62:e8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Linux device tree file ==&lt;br /&gt;
&lt;br /&gt;
A MAC address may be defined in the dtb file used by the Linux kernel. The address definition should be added in the device tree source in the following section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;fec1 {&lt;br /&gt;
    local-mac-address = [ 70 b3 d5 1a 70 06 ];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code configures given MAC address for the &amp;#039;&amp;#039;fec1&amp;#039;&amp;#039; interface.&lt;br /&gt;
&lt;br /&gt;
To prevent overwriting this value by u-boot, a random address generation should be disabled in the bootloader defconfig &amp;#039;&amp;#039;configs/visionsom_8mm_defconfig&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CONFIG_NET_RANDOM_ETHADDR=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Processor OTP memory ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;frame-green&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;NOTE!&amp;#039;&amp;#039;&amp;#039; The described operation may be performed only once and cannot be reversed!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The iMX8MM processor has an OTP memory area that is used by default to store the permanent MAC address. The registers responsible for this are described in the Reference Manual:&lt;br /&gt;
&lt;br /&gt;
* OTP Bank9 Word0 (MAC Address) (OCOTP_HW_OCOTP_MAC_ADDR0)&lt;br /&gt;
* OTP Bank9 Word1 (MAC Address) (OCOTP_HW_OCOTP_MAC_ADDR1)&lt;br /&gt;
* OTP Bank9 Word2 (MAC Address) (OCOTP_HW_OCOTP_MAC_ADDR2)&lt;br /&gt;
&lt;br /&gt;
This area may be written from the U-Boot console by executing the following commands. In this example the &amp;#039;&amp;#039;&amp;#039;fe:51:11:6c:62:e8&amp;#039;&amp;#039;&amp;#039; address is stored in OTP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fuse prog 9 0 0x116c62e8&lt;br /&gt;
fuse prog 9 1 0xfe51&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>KrzysztofChojnowski</name></author>
	</entry>
</feed>