summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCooper Jr., Franklin <fcooper@ti.com>2017-06-16 22:25:17 (GMT)
committerTom Rini <trini@konsulko.com>2017-07-10 18:25:56 (GMT)
commite820f523d8fbe8f4765688316f2ae424d0a4ea99 (patch)
treebe140ba81ce0da3e1f556291f6a4dcd898311837
parent7234f215ccce1782968ffa1b2ce7358104177577 (diff)
downloadu-boot-fsl-qoriq-e820f523d8fbe8f4765688316f2ae424d0a4ea99.tar.xz
ks2_evm: Add EEPROM based board detection
Some K2G evms have their EEPROM programming while most do not. Therefore, add EEPROM board detection to be used as the default method and fall back to the alternative board detection when needed. Also reorder board configuration. Perform bare minimal configuration initially since board detection hasn't ran. Finish board configuration once the board has been identified. Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
-rw-r--r--board/ti/ks2_evm/board.h1
-rw-r--r--board/ti/ks2_evm/board_k2g.c44
2 files changed, 24 insertions, 21 deletions
diff --git a/board/ti/ks2_evm/board.h b/board/ti/ks2_evm/board.h
index 2bbd792..0698921 100644
--- a/board/ti/ks2_evm/board.h
+++ b/board/ti/ks2_evm/board.h
@@ -11,6 +11,7 @@
#define _KS2_BOARD
#include <asm/ti-common/keystone_net.h>
+#include "../common/board_detect.h"
extern struct eth_priv_t eth_priv_cfg[];
diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c
index 588bfff..b4765f7 100644
--- a/board/ti/ks2_evm/board_k2g.c
+++ b/board/ti/ks2_evm/board_k2g.c
@@ -246,24 +246,6 @@ static int k2g_alt_board_detect(void)
return 0;
}
-int embedded_dtb_select(void)
-{
- int rc;
-
- rc = k2g_alt_board_detect();
- if (rc) {
- printf("Unable to do board detection\n");
- return -1;
- }
-
- fdtdec_setup();
-
- return 0;
-}
-#endif
-
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-
static void k2g_reset_mux_config(void)
{
/* Unlock the reset mux register */
@@ -277,11 +259,20 @@ static void k2g_reset_mux_config(void)
setbits_le32(KS2_RSTMUX8, RSTMUX_LOCK8_MASK);
}
-int board_early_init_f(void)
+int embedded_dtb_select(void)
{
- init_plls();
+ int rc;
+ rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
+ CONFIG_EEPROM_CHIP_ADDRESS);
+ if (rc) {
+ rc = k2g_alt_board_detect();
+ if (rc) {
+ printf("Unable to do board detection\n");
+ return -1;
+ }
+ }
- k2g_mux_config();
+ fdtdec_setup();
k2g_reset_mux_config();
@@ -313,6 +304,17 @@ int board_late_init(void)
}
#endif
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+ init_plls();
+
+ k2g_mux_config();
+
+ return 0;
+}
+#endif
+
#ifdef CONFIG_SPL_BUILD
void spl_init_keystone_plls(void)
{