]> git.proxmox.com Git - mirror_qemu.git/commit
hw/riscv: sifive_u: Add QSPI0 controller and connect a flash
authorBin Meng <bin.meng@windriver.com>
Tue, 26 Jan 2021 06:00:02 +0000 (14:00 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 4 Mar 2021 14:43:29 +0000 (09:43 -0500)
commit145b299139da92fb1b1048b393865bc96597d6b9
tree133ebe15a5db2037bdeece75cbdb314d349917ea
parent0694dabe9763847f3010b54ab3ec7d367d2f0ff0
hw/riscv: sifive_u: Add QSPI0 controller and connect a flash

This adds the QSPI0 controller to the SoC, and connects an ISSI
25WP256 flash to it. The generation of corresponding device tree
source fragment is also added.

Since the direct memory-mapped mode is not supported by the SiFive
SPI model, the <reg> property does not populate the second group
which represents the memory mapped address of the SPI flash.

With this commit, upstream U-Boot for the SiFive HiFive Unleashed
board can boot on QEMU 'sifive_u' out of the box. This allows users
to develop and test the recommended RISC-V boot flow with a real
world use case: ZSBL (in QEMU) loads U-Boot SPL from SPI flash to
L2LIM, then U-Boot SPL loads the payload from SPI flash that is
combined with OpenSBI fw_dynamic firmware and U-Boot proper.

Specify machine property `msel` to 6 to allow booting from the SPI
flash. U-Boot spl is directly loaded via `-bios`, and subsequent
payload is stored in the SPI flash image. Example command line:

$ qemu-system-riscv64 -nographic -M sifive_u,msel=6 -smp 5 -m 8G \
    -bios u-boot-spl.bin -drive file=spi-nor.img,if=mtd

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210126060007.12904-5-bmeng.cn@gmail.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/Kconfig
hw/riscv/sifive_u.c
include/hw/riscv/sifive_u.h