]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
riscv: qemu: use device tree passed by prior boot stage
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>
Thu, 22 Nov 2018 10:26:30 +0000 (11:26 +0100)
committerAndes <uboot@andestech.com>
Mon, 26 Nov 2018 05:57:32 +0000 (13:57 +0800)
QEMU provides a device tree, which is passed to U-Boot using register
a1. We are now able to directly select the device tree with the
configuration CONFIG_OF_PRIOR_STAGE. Replace the hard-coded address in
qemu-riscv with it.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
board/emulation/qemu-riscv/qemu-riscv.c
configs/qemu-riscv32_defconfig
configs/qemu-riscv64_defconfig

index 2730a288fb123554ad6e1c8c06b35266332aa464..2ce093e19a92f353d9e25a789a0b6aae63787b30 100644 (file)
@@ -9,8 +9,6 @@
 #include <virtio_types.h>
 #include <virtio.h>
 
-#define MROM_FDT_ADDR  0x1020
-
 int board_init(void)
 {
        /*
@@ -21,12 +19,3 @@ int board_init(void)
 
        return 0;
 }
-
-void *board_fdt_blob_setup(void)
-{
-       /*
-        * QEMU loads a generated DTB for us immediately
-        * after the reset vectors in the MROM
-        */
-       return (void *)MROM_FDT_ADDR;
-}
index ff1fb1f30ec8da6cbf34ce52c6988792c7fb7603..72c54a3dd5c15b922cd74978f612a62d3a8ee4e4 100644 (file)
@@ -3,4 +3,4 @@ CONFIG_TARGET_QEMU_VIRT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
-CONFIG_OF_BOARD=y
+CONFIG_OF_PRIOR_STAGE=y
index 60b647efe8488bc8876c034af004b6e987e33c61..44766c38f609bb0a90fc22b8b88df291a53e4a55 100644 (file)
@@ -4,4 +4,4 @@ CONFIG_ARCH_RV64I=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
-CONFIG_OF_BOARD=y
+CONFIG_OF_PRIOR_STAGE=y