Addition of second ethernet , second ethernet mac address getting changed for every time flash image to the same board

We are using tdx-reference-multimedia-image for Apalis iMX8 with Ixora carrier board and Yocto Project dunfell to build this image.
In my application requirement to have two ethernet . One is the default and the second ethernet port added. here I tried to mimic default ethernet port.

Updated the below dtsi file and below is the patch for the second Ethernet port.

diff --git a/arch/arm64/boot/dts/freescale/imx8-apalis-eval.dtsi b/arch/arm64/boot/dts/freescale/imx8-apalis-eval.dtsi
index 0a4fe3898993b…0b4376e84736f 100644
— a/arch/arm64/boot/dts/freescale/imx8-apalis-eval.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8-apalis-eval.dtsi
@@ -178,6 +178,9 @@
&fec1 {
status = “okay”;
};
&fec2 {
status = “okay”;
};

diff --git a/arch/arm64/boot/dts/freescale/imx8-apalis-v1.1.dtsi b/arch/arm64/boot/dts/freescale/imx8-apalis-v1.1.dtsi
};

/* second eth */
&fec2 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_fec2_gpios>;
phy-handle = <&ethphy1>;
phy-mode = “rmii”;
status = “okay”;

    mdio {
            #address-cells = <1>;
            #size-cells = <0>;
             ethphy1: ethernet-phy@0 {
                    compatible = "ethernet-phy-ieee802.3-c22";

/clock-frequency = <5000000>;/
micrel,led-mode = <0>;
/power-domains = <&pd IMX_SC_R_BOARD_R1>;/
/max-speed = <100>;/
reg = <1>;
};
};

}

My second ethernet is working fine. but the problem is the MAC address is getting changed when we flash the complete tdx-reference-multimedia-image to the same board.

Question : Why is the second Ethernet MAC getting changing for the same board whne we do tdx-reference-multimedia-image flash. And First default ethernet MAC is fixed for every flash of image.

How make second ethernet mac fixed as default First ethernet mac

reference files screen shot attached

  1. uboot printenv
  2. imx8-apalis-v1.1.dtsi ( fes2 updated for Second Eth)



imx8-apalis-v1.1.dtsi (47.5 KB)

Regards,
Deepak J

Hi @djewargi,

Thanks for writing to Toradex community!

Please check described method in below article. Do let us know if you already tried and still facing issue.

Best Regards
Ritesh Kumar

Thanks Ritesh,

Above mentioned MAC Address link I have already gone through it

My Question:
when we flash tdx-reference-multimedia-image using an easy installer to the same board for each flash Why Second Ethernet MAC Address getting changes and default First Ethernet MAC remain static( Fixed).

Regards,
Deepak J

Hi @djewargi,

When you flashing new image, the existing env settings are override. What you need is to add the MAC setting to u-boot environment and then flash. You will need to generate new image. Please check below post which explain how to append change with yocto

Best Regards
Ritesh Kumar