xref: /qemu/include/hw/loongarch/virt.h (revision 3efa6fa1e629b91400e020be42e118fedd8f11ce)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Definitions for loongarch board emulation.
4  *
5  * Copyright (C) 2021 Loongson Technology Corporation Limited
6  */
7 
8 #ifndef HW_LOONGARCH_H
9 #define HW_LOONGARCH_H
10 
11 #include "target/loongarch/cpu.h"
12 #include "hw/boards.h"
13 #include "qemu/queue.h"
14 #include "hw/intc/loongarch_ipi.h"
15 
16 #define LOONGARCH_MAX_VCPUS     4
17 
18 #define LOONGARCH_ISA_IO_BASE   0x18000000UL
19 #define LOONGARCH_ISA_IO_SIZE   0x0004000
20 #define VIRT_FWCFG_BASE         0x1e020000UL
21 #define VIRT_BIOS_BASE          0x1c000000UL
22 #define VIRT_BIOS_SIZE          (4 * MiB)
23 
24 struct LoongArchMachineState {
25     /*< private >*/
26     MachineState parent_obj;
27 
28     IPICore ipi_core[MAX_IPI_CORE_NUM];
29     MemoryRegion lowmem;
30     MemoryRegion highmem;
31     MemoryRegion isa_io;
32     MemoryRegion bios;
33     bool         bios_loaded;
34     /* State for other subsystems/APIs: */
35     FWCfgState  *fw_cfg;
36     Notifier     machine_done;
37 };
38 
39 #define TYPE_LOONGARCH_MACHINE  MACHINE_TYPE_NAME("virt")
40 OBJECT_DECLARE_SIMPLE_TYPE(LoongArchMachineState, LOONGARCH_MACHINE)
41 #endif
42