[v2,7/8] ARM: k2g: setup PRU ethernet MAC addresses

Message ID 1485789316-22216-8-git-send-email-rogerq@ti.com
State New
Headers show
Series
  • am57xx-idk LCD and am571x-idk 6 port ethernet pinmux
Related show

Commit Message

Roger Quadros Jan. 30, 2017, 3:15 p.m.
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>

---
 board/ti/ks2_evm/board_k2g.c | 19 +++++++++++++++++++
 configs/k2g_evm_defconfig    |  2 ++
 2 files changed, 21 insertions(+)

-- 
2.7.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Lokesh Vutla Jan. 31, 2017, 4:18 a.m. | #1
On Monday 30 January 2017 08:45 PM, 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>

> ---

>  board/ti/ks2_evm/board_k2g.c | 19 +++++++++++++++++++

>  configs/k2g_evm_defconfig    |  2 ++

>  2 files changed, 21 insertions(+)

> 

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

>  {

> diff --git a/configs/k2g_evm_defconfig b/configs/k2g_evm_defconfig

> index 5251105..372e20b 100644

> --- a/configs/k2g_evm_defconfig

> +++ b/configs/k2g_evm_defconfig

> @@ -3,6 +3,8 @@ CONFIG_ARCH_KEYSTONE=y

>  CONFIG_SPL_LIBCOMMON_SUPPORT=y

>  CONFIG_SPL_LIBGENERIC_SUPPORT=y

>  CONFIG_TARGET_K2G_EVM=y

> +CONFIG_EEPROM_BUS_ADDRESS=0

> +CONFIG_EEPROM_CHIP_ADDRESS=0x50


This can be dropped as these are the default values. Rest looks good to me.

Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


Thanks and regards,
Lokesh
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Patch hide | download patch | download mbox

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)
 {
diff --git a/configs/k2g_evm_defconfig b/configs/k2g_evm_defconfig
index 5251105..372e20b 100644
--- a/configs/k2g_evm_defconfig
+++ b/configs/k2g_evm_defconfig
@@ -3,6 +3,8 @@  CONFIG_ARCH_KEYSTONE=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_TARGET_K2G_EVM=y
+CONFIG_EEPROM_BUS_ADDRESS=0
+CONFIG_EEPROM_CHIP_ADDRESS=0x50
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y