summary refs log tree commit diff stats
path: root/include/hw/loongarch/virt.h
diff options
context:
space:
mode:
authorXiaojuan Yang <yangxiaojuan@loongson.cn>2022-11-07 10:09:47 +0800
committerSong Gao <gaosong@loongson.cn>2022-12-02 18:03:05 +0800
commit14dccc8ea6ece7ee63273144fb55e4770a05e0fd (patch)
tree1e8eed667125ce80d12e88c45a1fcab703e7b027 /include/hw/loongarch/virt.h
parentc4ffd91aba1c3d878e99a3e7ba8aad4826728ece (diff)
downloadfocaccia-qemu-14dccc8ea6ece7ee63273144fb55e4770a05e0fd.tar.gz
focaccia-qemu-14dccc8ea6ece7ee63273144fb55e4770a05e0fd.zip
hw/loongarch/virt: Add cfi01 pflash device
Add cfi01 pflash device for LoongArch virt machine

Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221130100647.398565-1-yangxiaojuan@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Diffstat (limited to 'include/hw/loongarch/virt.h')
-rw-r--r--include/hw/loongarch/virt.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/loongarch/virt.h b/include/hw/loongarch/virt.h
index 45c383f5a7..f5f818894e 100644
--- a/include/hw/loongarch/virt.h
+++ b/include/hw/loongarch/virt.h
@@ -12,6 +12,7 @@
 #include "hw/boards.h"
 #include "qemu/queue.h"
 #include "hw/intc/loongarch_ipi.h"
+#include "hw/block/flash.h"
 
 #define LOONGARCH_MAX_VCPUS     4
 
@@ -20,6 +21,9 @@
 #define VIRT_FWCFG_BASE         0x1e020000UL
 #define VIRT_BIOS_BASE          0x1c000000UL
 #define VIRT_BIOS_SIZE          (4 * MiB)
+#define VIRT_FLASH_SECTOR_SIZE  (128 * KiB)
+#define VIRT_FLASH_BASE         0x1d000000UL
+#define VIRT_FLASH_SIZE         (16 * MiB)
 
 #define VIRT_LOWMEM_BASE        0
 #define VIRT_LOWMEM_SIZE        0x10000000
@@ -48,6 +52,7 @@ struct LoongArchMachineState {
     int          fdt_size;
     DeviceState *platform_bus_dev;
     PCIBus       *pci_bus;
+    PFlashCFI01  *flash;
 };
 
 #define TYPE_LOONGARCH_MACHINE  MACHINE_TYPE_NAME("virt")