board_f: Add new function to allow runtime DTB selection
authorCooper Jr., Franklin <fcooper@ti.com>
Fri, 16 Jun 2017 22:25:12 +0000 (17:25 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 10 Jul 2017 18:25:54 +0000 (14:25 -0400)
Runtime U-boot dtb selection is generally a two step process. First step
is to simply use an initial generic dtb. The second step is to select
the dtb and perhaps execute additional code ones U-boot knows what board
it is running on. Embedded_dtb_select handles the second step by allowing
board specific code to run and perform what ever necessary configuration
that is needed.

Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/Kconfig
common/board_f.c
include/common.h

index a5e3a6b..086b676 100644 (file)
@@ -437,6 +437,15 @@ config SYS_STDIO_DEREGISTER
 
 endmenu
 
+config DTB_RESELECT
+       bool "Support swapping dtbs at a later point in boot"
+       depends on FIT_EMBED
+       help
+         It is possible during initial boot you may need to use a generic
+         dtb until you can fully determine the board your running on. This
+         config allows boards to implement a function at a later point
+         during boot to switch to the "correct" dtb.
+
 config FIT_EMBED
        bool "Support a FIT image embedded in the U-boot image"
        help
index 2cdd12a..ffa84e3 100644 (file)
@@ -809,6 +809,9 @@ static const init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_DISPLAY_CPUINFO)
        print_cpuinfo,          /* display cpu info (and speed) */
 #endif
+#if defined(CONFIG_DTB_RESELECT)
+       embedded_dtb_select,
+#endif
 #if defined(CONFIG_DISPLAY_BOARDINFO)
        show_board_info,
 #endif
index 1a98512..751665f 100644 (file)
@@ -359,6 +359,10 @@ int get_env_id (void);
 void   pci_init      (void);
 void   pci_init_board(void);
 
+#if defined(CONFIG_DTB_RESELECT)
+int    embedded_dtb_select(void);
+#endif
+
 int    misc_init_f   (void);
 int    misc_init_r   (void);