summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/hwinit-common.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-12-10 07:16:33 -0500
committerTom Rini <trini@konsulko.com>2018-12-10 07:16:33 -0500
commit7ff485c68b7e5573e5a4a877066e98398283a24f (patch)
tree8070ad8de0b18240ee67e1c8b847afc37bdb2d5d /arch/arm/mach-omap2/hwinit-common.c
parent7504e9e75f76a5101b47cd32851ad7bd4ea8ff70 (diff)
parent19f8c4dfb6e744a31da59bdd23b24d144152f1dc (diff)
Merge branch 'master' of git://git.denx.de/u-boot-i2c
- DM_I2C_COMPAT removal for all ti platforms from Jean-Jacques Hiblot - Fix in i2c command help output from Chirstoph Muellner.
Diffstat (limited to 'arch/arm/mach-omap2/hwinit-common.c')
-rw-r--r--arch/arm/mach-omap2/hwinit-common.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/hwinit-common.c b/arch/arm/mach-omap2/hwinit-common.c
index 1a24acb7481..772b4c4db5d 100644
--- a/arch/arm/mach-omap2/hwinit-common.c
+++ b/arch/arm/mach-omap2/hwinit-common.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
#include <debug_uart.h>
+#include <fdtdec.h>
#include <spl.h>
#include <asm/arch/sys_proto.h>
#include <linux/sizes.h>
@@ -19,6 +20,7 @@
#include <asm/omap_common.h>
#include <linux/compiler.h>
#include <asm/system.h>
+#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -171,6 +173,10 @@ void __weak init_package_revision(void)
*/
void early_system_init(void)
{
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_MULTI_DTB_FIT)
+ int ret;
+ int rescan;
+#endif
init_omap_revision();
hw_data_init();
init_package_revision();
@@ -186,6 +192,7 @@ void early_system_init(void)
do_io_settings();
#endif
setup_early_clocks();
+
#ifdef CONFIG_SPL_BUILD
/*
* Save the boot parameters passed from romcode.
@@ -193,11 +200,23 @@ void early_system_init(void)
* to prevent overwrites.
*/
save_omap_boot_params();
+ spl_early_init();
#endif
do_board_detect();
-#ifdef CONFIG_SPL_BUILD
- spl_early_init();
+
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_MULTI_DTB_FIT)
+ /*
+ * Board detection has been done.
+ * Let us see if another dtb wouldn't be a better match
+ * for our board
+ */
+ ret = fdtdec_resetup(&rescan);
+ if (!ret && rescan) {
+ dm_uninit();
+ dm_init_and_scan(true);
+ }
#endif
+
vcores_init();
#ifdef CONFIG_DEBUG_UART_OMAP
debug_uart_init();