diff mbox series

[v4,09/10] ARM: k2g: setup PRU ethernet MAC addresses

Message ID 1489410273-10159-10-git-send-email-rogerq@ti.com
State Accepted
Commit 752a8311e9c13af807ff9a32fbb2491282a41c8a
Headers show
Series am57xx-idk LCD and am571x-idk 6 port ethernet pinmux | expand

Commit Message

Roger Quadros March 13, 2017, 1:04 p.m. UTC
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 |  2 ++
 board/ti/ks2_evm/board_k2g.c   | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

Comments

Tom Rini March 21, 2017, 6:09 p.m. UTC | #1
On Mon, Mar 13, 2017 at 03:04:32PM +0200, Roger Quadros wrote:

> 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>


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
index e1962c7..67f5fa0 100644
--- a/arch/arm/mach-keystone/Kconfig
+++ b/arch/arm/mach-keystone/Kconfig
@@ -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
 
diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c
index 40edbaa..a738dd2 100644
--- a/board/ti/ks2_evm/board_k2g.c
+++ b/board/ti/ks2_evm/board_k2g.c
@@ -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)
 {