diff mbox series

[U-Boot,25/30] riscv: qemu: use device tree passed by prior boot stage

Message ID 20181019220743.15020-26-lukas.auer@aisec.fraunhofer.de
State Superseded
Delegated to: Andes
Headers show
Series General fixes / cleanup for RISC-V and improvements to qemu-riscv | expand

Commit Message

Lukas Auer Oct. 19, 2018, 10:07 p.m. UTC
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>
---

 board/emulation/qemu-riscv/qemu-riscv.c | 11 -----------
 configs/qemu-riscv32_defconfig          |  2 +-
 configs/qemu-riscv64_defconfig          |  2 +-
 3 files changed, 2 insertions(+), 13 deletions(-)

Comments

Bin Meng Oct. 22, 2018, 9:19 a.m. UTC | #1
On Sat, Oct 20, 2018 at 6:11 AM Lukas Auer
<lukas.auer@aisec.fraunhofer.de> wrote:
>
> QEMU provides a device tree, which is passed to u-boot using register

nits: U-Boot

> 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>
> ---
>
>  board/emulation/qemu-riscv/qemu-riscv.c | 11 -----------
>  configs/qemu-riscv32_defconfig          |  2 +-
>  configs/qemu-riscv64_defconfig          |  2 +-
>  3 files changed, 2 insertions(+), 13 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Rick Chen Oct. 24, 2018, 6:05 a.m. UTC | #2
> > >
> > > QEMU provides a device tree, which is passed to u-boot using register
> >
> > nits: U-Boot
> >
> > > 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>
> > > ---
> > >
> > >  board/emulation/qemu-riscv/qemu-riscv.c | 11 -----------
> > >  configs/qemu-riscv32_defconfig          |  2 +-
> > >  configs/qemu-riscv64_defconfig          |  2 +-
> > >  3 files changed, 2 insertions(+), 13 deletions(-)
> > >
> >
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Reviewed-by: Rick Chen <rick@andestech.com>
diff mbox series

Patch

diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c
index 041e716c9b..a7dc1d847e 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -6,18 +6,7 @@ 
 #include <common.h>
 #include <fdtdec.h>
 
-#define MROM_FDT_ADDR	0x1020
-
 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;
-}
diff --git a/configs/qemu-riscv32_defconfig b/configs/qemu-riscv32_defconfig
index ff1fb1f30e..72c54a3dd5 100644
--- a/configs/qemu-riscv32_defconfig
+++ b/configs/qemu-riscv32_defconfig
@@ -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
diff --git a/configs/qemu-riscv64_defconfig b/configs/qemu-riscv64_defconfig
index 60b647efe8..44766c38f6 100644
--- a/configs/qemu-riscv64_defconfig
+++ b/configs/qemu-riscv64_defconfig
@@ -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