aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorJonas Karlman <jonas@kwiboo.se>2023-02-22 22:44:40 +0000
committerKever Yang <kever.yang@rock-chips.com>2023-02-28 18:07:28 +0800
commit628fb0683b65269a121c1cbc3a0d4f5adb4ecf13 (patch)
tree760463a5e3051c43a38a12584bcbee6bcf4ea8c5 /arch/arm
parentdd5684b87850ad535ec4fd6532cf675d07b73983 (diff)
downloadu-boot-628fb0683b65269a121c1cbc3a0d4f5adb4ecf13.zip
u-boot-628fb0683b65269a121c1cbc3a0d4f5adb4ecf13.tar.gz
u-boot-628fb0683b65269a121c1cbc3a0d4f5adb4ecf13.tar.bz2
rockchip: misc: Set eth1addr mac address
Set eth1addr in addition to ethaddr. Also allow fdt fixup of ethernet mac addresses when CMD_NET is disabled. Set ethaddr and eth1addr based on HASH and SHA256 options. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-rockchip/misc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/mach-rockchip/misc.c b/arch/arm/mach-rockchip/misc.c
index b350f18..849014d 100644
--- a/arch/arm/mach-rockchip/misc.c
+++ b/arch/arm/mach-rockchip/misc.c
@@ -23,7 +23,7 @@
int rockchip_setup_macaddr(void)
{
-#if IS_ENABLED(CONFIG_CMD_NET)
+#if CONFIG_IS_ENABLED(HASH) && CONFIG_IS_ENABLED(SHA256)
int ret;
const char *cpuid = env_get("cpuid#");
u8 hash[SHA256_SUM_LEN];
@@ -52,6 +52,10 @@ int rockchip_setup_macaddr(void)
mac_addr[0] &= 0xfe; /* clear multicast bit */
mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
eth_env_set_enetaddr("ethaddr", mac_addr);
+
+ /* Make a valid MAC address for ethernet1 */
+ mac_addr[5] ^= 0x01;
+ eth_env_set_enetaddr("eth1addr", mac_addr);
#endif
return 0;
}