diff options
Diffstat (limited to 'board/xilinx/common/board.c')
-rw-r--r-- | board/xilinx/common/board.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 62dafe0f90..ae5fe2729f 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -5,6 +5,7 @@ */ #include <common.h> +#include <asm/sections.h> #include <dm/uclass.h> #include <i2c.h> @@ -37,16 +38,32 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) return ret; } -#if defined(CONFIG_OF_BOARD) +#if defined(CONFIG_OF_BOARD) || defined(CONFIG_OF_SEPARATE) void *board_fdt_blob_setup(void) { static void *fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR; - if (fdt_magic(fdt_blob) != FDT_MAGIC) { - printf("DTB is not passed via %p\n", fdt_blob); - return NULL; - } + if (fdt_magic(fdt_blob) == FDT_MAGIC) + return fdt_blob; - return fdt_blob; + debug("DTB is not passed via %p\n", fdt_blob); + +#ifdef CONFIG_SPL_BUILD + /* FDT is at end of BSS unless it is in a different memory region */ + if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) + fdt_blob = (ulong *)&_image_binary_end; + else + fdt_blob = (ulong *)&__bss_end; +#else + /* FDT is at end of image */ + fdt_blob = (ulong *)&_end; +#endif + + if (fdt_magic(fdt_blob) == FDT_MAGIC) + return fdt_blob; + + debug("DTB is also not passed via %p\n", fdt_blob); + + return NULL; } #endif |