]> git.sur5r.net Git - u-boot/commitdiff
ARM: k2g: setup PRU ethernet MAC addresses
authorRoger Quadros <rogerq@ti.com>
Mon, 13 Mar 2017 13:04:32 +0000 (15:04 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 20 Mar 2017 21:57:15 +0000 (17:57 -0400)
PRU ethernet MAC address range is present in the
board EEPROM. Parse it and setup eth?addr
environment variables.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-keystone/Kconfig
board/ti/ks2_evm/board_k2g.c

index e1962c779a6ad24d32c020ab08b491e3553ddd22..67f5fa0265fc1a3925af3074c8e4c1ecc638d5b2 100644 (file)
@@ -15,6 +15,8 @@ config TARGET_K2L_EVM
 
 config TARGET_K2G_EVM
        bool "TI Keystone 2 Galileo EVM"
+        select BOARD_LATE_INIT
+        select TI_I2C_BOARD_DETECT
 
 endchoice
 
index 372fc35a5c666144c179784bb480b62eaed2b850..79e110ef48ad0e77d62ca789dbcbeec0ad6f87c2 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/arch/psc_defs.h>
 #include <asm/arch/mmc_host_def.h>
 #include "mux-k2g.h"
+#include "../common/board_detect.h"
 
 #define SYS_CLK                24000000
 
@@ -149,6 +150,24 @@ int board_early_init_f(void)
 }
 #endif
 
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_TI_I2C_BOARD_DETECT)
+       int rc;
+
+       rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
+                       CONFIG_EEPROM_CHIP_ADDRESS);
+       if (rc)
+               printf("ti_i2c_eeprom_init failed %d\n", rc);
+
+       board_ti_set_ethaddr(1);
+#endif
+
+       return 0;
+}
+#endif
+
 #ifdef CONFIG_SPL_BUILD
 void spl_init_keystone_plls(void)
 {