summaryrefslogtreecommitdiffstats
path: root/include/hw
diff options
context:
space:
mode:
authorAlistair Francis2019-10-09 01:32:25 +0200
committerPalmer Dabbelt2019-10-28 15:47:28 +0100
commit71eb522c406342c3cefa7a2837c7417eeb430ae1 (patch)
tree1554f1199005d42d3d2f51b14bcd94aa18c26782 /include/hw
parentriscv/virt: Manually define the machine (diff)
downloadqemu-71eb522c406342c3cefa7a2837c7417eeb430ae1.tar.gz
qemu-71eb522c406342c3cefa7a2837c7417eeb430ae1.tar.xz
qemu-71eb522c406342c3cefa7a2837c7417eeb430ae1.zip
riscv/virt: Add the PFlash CFI01 device
Add the CFI01 PFlash to the RISC-V virt board. This is the same PFlash from the ARM Virt board and the implementation is based on the ARM Virt board. This allows users to specify flash files from the command line. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/riscv/virt.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
index 3d875305d3..b17048a93a 100644
--- a/include/hw/riscv/virt.h
+++ b/include/hw/riscv/virt.h
@@ -21,6 +21,7 @@
#include "hw/riscv/riscv_hart.h"
#include "hw/sysbus.h"
+#include "hw/block/flash.h"
#define TYPE_RISCV_VIRT_MACHINE MACHINE_TYPE_NAME("virt")
#define RISCV_VIRT_MACHINE(obj) \
@@ -33,6 +34,7 @@ typedef struct {
/*< public >*/
RISCVHartArrayState soc;
DeviceState *plic;
+ PFlashCFI01 *flash[2];
void *fdt;
int fdt_size;
@@ -46,6 +48,7 @@ enum {
VIRT_PLIC,
VIRT_UART0,
VIRT_VIRTIO,
+ VIRT_FLASH,
VIRT_DRAM,
VIRT_PCIE_MMIO,
VIRT_PCIE_PIO,