]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
toradex: common: handle third MAC address for SMARC i.MX95
authorMax Krummenacher <max.krummenacher@toradex.com>
Tue, 13 Jan 2026 12:58:23 +0000 (13:58 +0100)
committerFabio Estevam <festevam@nabladev.com>
Sat, 17 Jan 2026 18:01:18 +0000 (15:01 -0300)
The toradex_smarc_imx95 board exposes three Ethernet ports.
Set the third MAC address equal to the second MAC address.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
board/toradex/common/tdx-common.c

index f01fb369b4bb2834d718509fbbbb8ec2540f4b1d..81f7fa09002ec614365f0d898d2373ffcd7def79 100644 (file)
@@ -179,6 +179,18 @@ static int settings_r(void)
                eth_env_set_enetaddr("eth1addr", ethaddr);
        }
 
+       if (IS_ENABLED(CONFIG_TARGET_TORADEX_SMARC_IMX95) &&
+           !eth_env_get_enetaddr("eth2addr", ethaddr)) {
+               /*
+                * Third MAC address is allocated from block
+                * 0x100000 higher then the first MAC address.
+                * The same as the default for the secondary MAC.
+                */
+               memcpy(ethaddr, &tdx_eth_addr, 6);
+               ethaddr[3] += 0x10;
+               eth_env_set_enetaddr("eth2addr", ethaddr);
+       }
+
        return 0;
 }
 EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);