Permalink
Switch branches/tags
Nothing to show
Find file Copy path
b374547 Jan 30, 2018
1 contributor

Users who have contributed to this file

171 lines (158 sloc) 6.7 KB
From 5bb671ab322547957914e7ef6fb4b7e47fcb8900 Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Thu, 18 Jan 2018 14:53:08 -0600
Subject: [PATCH 2/2] NFM: Production: eeprom: assume device is BeagleBone
Black
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
board/ti/am335x/board.c | 6 ++++--
board/ti/am335x/board.h | 7 ++++++-
board/ti/am335x/mux.c | 7 +++++--
board/ti/common/board_detect.c | 12 ++++++++++++
configs/am335x_boneblack_defconfig | 2 +-
configs/am335x_evm_defconfig | 2 +-
include/configs/am335x_evm.h | 8 ++++++++
7 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 4942003439..258a31eb62 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -709,7 +709,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
if (board_is_evm_sk())
return &dpll_ddr3_303MHz[ind];
- else if (board_is_pb() || board_is_bone_lt() || board_is_icev2() || board_is_beaglelogic())
+ else if (board_is_pb() || board_is_bone_lt() || board_is_icev2() || board_is_beaglelogic() || board_is_blank_bone_lt())
return &dpll_ddr3_400MHz[ind];
else if (board_is_evm_15_or_later())
return &dpll_ddr3_303MHz[ind];
@@ -992,7 +992,7 @@ void sdram_init(void)
if (board_is_evm_sk())
config_ddr(303, &ioregs_evmsk, &ddr3_data,
&ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);
- else if (board_is_pb() || board_is_bone_lt() || board_is_beaglelogic())
+ else if (board_is_pb() || board_is_bone_lt() || board_is_beaglelogic() || board_is_blank_bone_lt())
config_ddr(400, &ioregs_bonelt,
&ddr3_beagleblack_data,
&ddr3_beagleblack_cmd_ctrl_data,
@@ -1356,6 +1356,7 @@ int board_eth_init(bd_t *bis)
(defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
#ifdef CONFIG_DRIVER_TI_CPSW
+ if (!board_is_blank_bone_lt()) {
if (!board_is_pb()) {
if (board_is_bone() || (board_is_bone_lt() && !board_is_bone_lt_enhanced() && !board_is_m10a()) ||
board_is_idk() || board_is_beaglelogic()) {
@@ -1383,6 +1384,7 @@ int board_eth_init(bd_t *bis)
else
n += rv;
}
+ }
#endif
/*
diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h
index e4d5daf269..75293d3151 100644
--- a/board/ti/am335x/board.h
+++ b/board/ti/am335x/board.h
@@ -101,9 +101,14 @@ static inline int board_is_os00(void)
return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "OS00", 4);
}
+static inline int board_is_blank_bone_lt(void)
+{
+ return board_ti_is("A335BLNK");
+}
+
static inline int board_is_beaglebonex(void)
{
- return board_is_pb() || board_is_bone() || (board_is_bone_lt() && !board_is_marsboard()) || board_is_e14bbbi() || board_is_bbg1() || board_is_beaglelogic() || board_is_os00();
+ return board_is_pb() || board_is_bone() || (board_is_bone_lt() && !board_is_marsboard()) || board_is_e14bbbi() || board_is_bbg1() || board_is_beaglelogic() || board_is_os00() || board_is_blank_bone_lt();
}
static inline int board_is_evm_sk(void)
diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c
index 3733246852..a27c67fb0f 100644
--- a/board/ti/am335x/mux.c
+++ b/board/ti/am335x/mux.c
@@ -426,7 +426,10 @@ void enable_board_pin_mux(void)
configure_module_pin_mux(rmii1_pin_mux);
configure_module_pin_mux(spi0_pin_mux);
} else {
- /* Unknown board. We might still be able to boot. */
- puts("Bad EEPROM or unknown board, cannot configure pinmux.");
+ puts("Unknown board: assuming BeagleBone Black.");
+ /* Beaglebone LT pinmux */
+ configure_module_pin_mux(mii1_pin_mux);
+ configure_module_pin_mux(mmc0_pin_mux);
+ configure_module_pin_mux(mmc1_pin_mux);
}
}
diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c
index 6f07ec331a..6f78497901 100644
--- a/board/ti/common/board_detect.c
+++ b/board/ti/common/board_detect.c
@@ -218,6 +218,17 @@ int __maybe_unused ti_i2c_eeprom_am_get(int bus_addr, int dev_addr)
rc = ti_i2c_eeprom_get(bus_addr, dev_addr, TI_EEPROM_HEADER_MAGIC,
sizeof(am_ep), (uint8_t *)&am_ep);
+ if (rc < 0) {
+ ep->header = TI_EEPROM_HEADER_MAGIC;
+
+ strlcpy(ep->name, "A335BLNK", TI_EEPROM_HDR_NAME_LEN + 1);
+ ti_eeprom_string_cleanup(ep->name);
+
+ strlcpy(ep->version, "EMMC", TI_EEPROM_HDR_REV_LEN + 1);
+ ti_eeprom_string_cleanup(ep->version);
+
+ goto already_read;
+ }
if (rc)
return rc;
@@ -240,6 +251,7 @@ int __maybe_unused ti_i2c_eeprom_am_get(int bus_addr, int dev_addr)
memcpy(ep->mac_addr, am_ep.mac_addr,
TI_EEPROM_HDR_NO_OF_MAC_ADDR * TI_EEPROM_HDR_ETH_ALEN);
+already_read:
return 0;
}
diff --git a/configs/am335x_boneblack_defconfig b/configs/am335x_boneblack_defconfig
index 873090a7ad..d13668e671 100644
--- a/configs/am335x_boneblack_defconfig
+++ b/configs/am335x_boneblack_defconfig
@@ -4,7 +4,7 @@ CONFIG_TI_COMMON_CMD_OPTIONS=y
CONFIG_AM33XX=y
# CONFIG_SPL_NAND_SUPPORT is not set
CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
+CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run eeprom_program; run findfdt; run init_console; run envboot; run distro_bootcmd"
# CONFIG_ENV_IS_IN_FAT is not set
CONFIG_ENV_IS_NOWHERE=y
CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 873090a7ad..d13668e671 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -4,7 +4,7 @@ CONFIG_TI_COMMON_CMD_OPTIONS=y
CONFIG_AM33XX=y
# CONFIG_SPL_NAND_SUPPORT is not set
CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
+CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run eeprom_program; run findfdt; run init_console; run envboot; run distro_bootcmd"
# CONFIG_ENV_IS_IN_FAT is not set
CONFIG_ENV_IS_NOWHERE=y
CONFIG_SYS_CONSOLE_INFO_QUIET=y
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 078a706676..304b4bc2a2 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -190,6 +190,14 @@
"setenv fdtfile am335x-boneblack.dtb; " \
"fi; " \
"fi; " \
+ "if test $board_name = A335BLNK; then " \
+ "if test -e mmc 0:1 /boot/.eeprom.txt; then " \
+ "load mmc 0:1 ${loadaddr} /boot/.eeprom.txt;" \
+ "env import -t ${loadaddr} ${filesize};" \
+ "echo Loaded environment from /boot/.eeprom.txt;" \
+ "run eeprom_program; " \
+ "fi;" \
+ "setenv fdtfile am335x-boneblack-emmc-overlay.dtb; fi; " \
"if test $board_name = BBBW; then " \
"setenv fdtfile am335x-boneblack-wireless.dtb; fi; " \
"if test $board_name = BBG1; then " \
--
2.15.1