aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2021-05-06 16:44:52 +0530
committerLokesh Vutla <lokeshvutla@ti.com>2021-05-12 16:32:44 +0530
commitb5425a96764e423c99dcd50e4f28a1834a5d4803 (patch)
treec4ee0a419d5ec6a6407aab3886c8d949f874e83f /arch
parent63d825e9fcc75edcf0f378995975a0b4f2632899 (diff)
downloadu-boot-b5425a96764e423c99dcd50e4f28a1834a5d4803.zip
u-boot-b5425a96764e423c99dcd50e4f28a1834a5d4803.tar.gz
u-boot-b5425a96764e423c99dcd50e4f28a1834a5d4803.tar.bz2
arm: am64x: Add support for selecting DT based on EEPROM
Enable support for selecting DTB within SPL based on EEPROM. This will help to use single defconfig for both EVM and SK Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-k3/am642_init.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index 2a38b84..885f181 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -20,6 +20,7 @@
#include <dm/uclass-internal.h>
#include <dm/pinctrl.h>
#include <mmc.h>
+#include <dm/root.h>
#if defined(CONFIG_SPL_BUILD)
@@ -82,6 +83,29 @@ void k3_mmc_stop_clock(void) {}
void k3_mmc_restart_clock(void) {}
#endif
+#ifdef CONFIG_SPL_OF_LIST
+void do_dt_magic(void)
+{
+ int ret, rescan;
+
+ if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+ do_board_detect();
+
+ /*
+ * Board detection has been done.
+ * Let us see if another dtb wouldn't be a better match
+ * for our board
+ */
+ if (IS_ENABLED(CONFIG_CPU_V7R)) {
+ ret = fdtdec_resetup(&rescan);
+ if (!ret && rescan) {
+ dm_uninit();
+ dm_init_and_scan(true);
+ }
+ }
+}
+#endif
+
void board_init_f(ulong dummy)
{
#if defined(CONFIG_K3_LOAD_SYSFW)
@@ -106,6 +130,8 @@ void board_init_f(ulong dummy)
preloader_console_init();
+ do_dt_magic();
+
#if defined(CONFIG_K3_LOAD_SYSFW)
/*
* Process pinctrl for serial3 a.k.a. MAIN UART1 module and continue