]> git.sur5r.net Git - u-boot/commitdiff
board: ti: am43xx: Define embedded_dtb_select for runtime DTB selection in U-boot
authorVignesh R <vigneshr@ti.com>
Mon, 26 Mar 2018 07:57:01 +0000 (13:27 +0530)
committerTom Rini <trini@konsulko.com>
Sat, 7 Apr 2018 00:45:44 +0000 (20:45 -0400)
AM437x QSPI boot is a single stage boot and hence needs runtime DTB
selection to support AM437x-SK and AM437x-IDK with DM enabled. This is
required to move am43xx_evm_qspiboot_defconfig to use DM/DT.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
board/ti/am43xx/board.c

index d8944ea8162e06f9f9e8db29a620500d2b301027..0564df2c00b8e887408e0997388a42eb6eb5463d 100644 (file)
@@ -908,10 +908,14 @@ int ft_board_setup(void *blob, bd_t *bd)
 }
 #endif
 
-#ifdef CONFIG_SPL_LOAD_FIT
+#if defined(CONFIG_SPL_LOAD_FIT) || defined(CONFIG_DTB_RESELECT)
 int board_fit_config_name_match(const char *name)
 {
-       if (board_is_evm() && !strcmp(name, "am437x-gp-evm"))
+       bool eeprom_read = board_ti_was_eeprom_read();
+
+       if (!strcmp(name, "am4372-generic") && !eeprom_read)
+               return 0;
+       else if (board_is_evm() && !strcmp(name, "am437x-gp-evm"))
                return 0;
        else if (board_is_sk() && !strcmp(name, "am437x-sk-evm"))
                return 0;
@@ -924,6 +928,16 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
+#ifdef CONFIG_DTB_RESELECT
+int embedded_dtb_select(void)
+{
+       do_board_detect();
+       fdtdec_setup();
+
+       return 0;
+}
+#endif
+
 #ifdef CONFIG_TI_SECURE_DEVICE
 void board_fit_image_post_process(void **p_image, size_t *p_size)
 {