riscv: Add opensbi firmware dynamic support
commitdc144fe13d336caac2f03b57f1df738e84f984ec
authorAtish Patra <atish.patra@wdc.com>
Wed, 1 Jul 2020 18:39:48 +0000 (1 11:39 -0700)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 14 Jul 2020 00:25:37 +0000 (13 17:25 -0700)
tree5376152bbe9d1416c435af13cf5795bce7450223
parent66b1205bc5ab8bb3f5e12fa4155bbeb56e6724e9
riscv: Add opensbi firmware dynamic support

OpenSBI is the default firmware in Qemu and has various firmware loading
options. Currently, qemu loader uses fw_jump which has a compile time
pre-defined address where fdt & kernel image must reside. This puts a
constraint on image size of the Linux kernel depending on the fdt location
and available memory. However, fw_dynamic allows the loader to specify
the next stage location (i.e. Linux kernel/U-Boot) in memory and other
configurable boot options available in OpenSBI.

Add support for OpenSBI dynamic firmware loading support. This doesn't
break existing setup and fw_jump will continue to work as it is. Any
other firmware will continue to work without any issues as long as it
doesn't expect anything specific from loader in "a2" register.

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-4-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
include/hw/riscv/boot_opensbi.h [new file with mode: 0644]