]> git.sur5r.net Git - u-boot/blobdiff - board/sunxi/board.c
Merge git://git.denx.de/u-boot-usb
[u-boot] / board / sunxi / board.c
index c2755b2c6dfd4429b65d93ea5aacffd7f9ed029a..800f412b383ddf9ac90972e50a684c534d40fea4 100644 (file)
@@ -33,6 +33,7 @@
 #include <nand.h>
 #include <net.h>
 #include <sy8106a.h>
+#include <asm/setup.h>
 
 #if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
 /* So that we can use pin names in Kconfig and sunxi_name_to_gpio() */
@@ -761,13 +762,19 @@ int ft_board_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
-       const char *cmp_str;
+       struct boot_file_head *spl = (void *)(ulong)SPL_ADDR;
+       const char *cmp_str = (void *)(ulong)SPL_ADDR;
 
+       /* Check if there is a DT name stored in the SPL header and use that. */
+       if (spl->dt_name_offset) {
+               cmp_str += spl->dt_name_offset;
+       } else {
 #ifdef CONFIG_DEFAULT_DEVICE_TREE
-       cmp_str = CONFIG_DEFAULT_DEVICE_TREE;
+               cmp_str = CONFIG_DEFAULT_DEVICE_TREE;
 #else
-       return 0;
+               return 0;
 #endif
+       };
 
 /* Differentiate the two Pine64 board DTs by their DRAM size. */
        if (strstr(name, "-pine64") && strstr(cmp_str, "-pine64")) {