From: Roger Quadros <rogerq@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [u-boot PATCH v2 7/8] ARM: k2g: setup PRU ethernet MAC addresses
Date: Mon, 30 Jan 2017 17:15:15 +0200 [thread overview]
Message-ID: <1485789316-22216-8-git-send-email-rogerq@ti.com> (raw)
In-Reply-To: <1485789316-22216-1-git-send-email-rogerq@ti.com>
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
CONFIG_SPL_I2C_SUPPORT=y
CONFIG_SPL_POWER_SUPPORT=y
CONFIG_SPL_SERIAL_SUPPORT=y
--
2.7.4
next prev parent reply other threads:[~2017-01-30 15:15 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 15:15 [U-Boot] [u-boot PATCH v2 0/8] am57xx-idk LCD and am571x-idk 6 port ethernet pinmux Roger Quadros
2017-01-30 15:15 ` [U-Boot] [u-boot PATCH v2 1/8] ARM: OMAP5+: GPIO: Add GPIO_TO_PIN() macro Roger Quadros
2017-01-31 4:08 ` Lokesh Vutla
2017-01-30 15:15 ` [U-Boot] [u-boot PATCH v2 2/8] ti: common: board_detect: commodify ethaddr environment setting code Roger Quadros
2017-01-31 4:08 ` Lokesh Vutla
2017-01-31 21:38 ` Tom Rini
2017-01-30 15:15 ` [U-Boot] [u-boot PATCH v2 3/8] board: ti: am571x-idk: Support 6 port Ethernet or 4 port Ethernet with LCD Roger Quadros
2017-01-31 4:10 ` Lokesh Vutla
2017-01-30 15:15 ` [U-Boot] [u-boot PATCH v2 4/8] board: ti: am571x-idk: Update pinmux for ICSS2 Ethernet Roger Quadros
2017-01-31 4:10 ` Lokesh Vutla
2017-01-30 15:15 ` [U-Boot] [u-boot PATCH v2 5/8] board: ti: am57xx-idk: Auto detect LCD Panel Roger Quadros
2017-01-30 15:15 ` [U-Boot] [u-boot PATCH v2 6/8] ARM: Use Kconfig for board EEPROM's I2C bus and chip address Roger Quadros
2017-01-31 4:17 ` Lokesh Vutla
2017-02-01 9:42 ` Roger Quadros
2017-02-01 10:47 ` Lokesh Vutla
2017-02-01 12:01 ` Roger Quadros
2017-02-01 12:14 ` Tom Rini
2017-02-01 13:05 ` Roger Quadros
2017-02-01 13:44 ` Tom Rini
2017-01-30 15:15 ` Roger Quadros [this message]
2017-01-31 4:18 ` [U-Boot] [u-boot PATCH v2 7/8] ARM: k2g: setup PRU ethernet MAC addresses Lokesh Vutla
2017-01-30 15:15 ` [U-Boot] [u-boot PATCH v2 8/8] ti: common: board_detect: Rename EEPROM scratch start macro Roger Quadros
2017-01-31 21:38 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485789316-22216-8-git-send-email-rogerq@ti.com \
--to=rogerq@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox