The Qemu platform emulator generates a device tree blob and places it
at the start of the dram, which is then used by u-boot. Use this dtb
only if CONFIG_OF_BOARD is defined. This allows using a different
device tree, using the CONFIG_OF_SEPARATE option. This dtb is attached
to the u-boot binary as a u-boot-fdt.bin file

Signed-off-by: Sughosh Ganu <sughosh.g...@linaro.org>
---
 board/emulation/qemu-arm/qemu-arm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/board/emulation/qemu-arm/qemu-arm.c 
b/board/emulation/qemu-arm/qemu-arm.c
index f18f2ed7da..e146d1cc50 100644
--- a/board/emulation/qemu-arm/qemu-arm.c
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -89,11 +89,13 @@ int dram_init_banksize(void)
        return 0;
 }
 
+#if defined(CONFIG_OF_BOARD)
 void *board_fdt_blob_setup(void)
 {
        /* QEMU loads a generated DTB for us at the start of RAM. */
        return (void *)CONFIG_SYS_SDRAM_BASE;
 }
+#endif
 
 void enable_caches(void)
 {
-- 
2.17.1

Reply via email to