RISC-V: Copy the fdt in dram instead of ROM
commit66b1205bc5ab8bb3f5e12fa4155bbeb56e6724e9
authorAtish Patra <atish.patra@wdc.com>
Wed, 1 Jul 2020 18:39:47 +0000 (1 11:39 -0700)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 14 Jul 2020 00:25:37 +0000 (13 17:25 -0700)
treeae9c0df216dda16062dfd1a7b598fc7d02d4d803
parent43cf723adca9a5e188c664c3b606a585192a599c
RISC-V: Copy the fdt in dram instead of ROM

Currently, the fdt is copied to the ROM after the reset vector. The firmware
has to copy it to DRAM. Instead of this, directly copy the device tree to a
pre-computed dram address. The device tree load address should be as far as
possible from kernel and initrd images. That's why it is kept at the end of
the DRAM or 4GB whichever is lesser.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20200701183949.398134-3-atish.patra@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/boot.c
hw/riscv/sifive_u.c
hw/riscv/spike.c
hw/riscv/virt.c
include/hw/riscv/boot.h