]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: sam9x60ek: add support for MAC address retrieval
authorEugen Hristev <eugen.hristev@microchip.com>
Wed, 9 Oct 2019 09:23:43 +0000 (09:23 +0000)
committerEugen Hristev <eugen.hristev@microchip.com>
Thu, 24 Oct 2019 10:01:57 +0000 (13:01 +0300)
Retrieve mac address from i2c eeprom at boot time.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
board/atmel/sam9x60ek/sam9x60ek.c

index 182b3aeed74cc7f3279934626a37fafbfb186ddc..7be1dd54f46de74da943c4fb29a2f7a9e8382fde 100644 (file)
@@ -106,6 +106,18 @@ int board_early_init_f(void)
 }
 #endif
 
+#define MAC24AA_MAC_OFFSET     0xfa
+
+#ifdef CONFIG_MISC_INIT_R
+int misc_init_r(void)
+{
+#ifdef CONFIG_I2C_EEPROM
+       at91_set_ethaddr(MAC24AA_MAC_OFFSET);
+#endif
+       return 0;
+}
+#endif
+
 int board_init(void)
 {
        /* address of boot parameters */