hw/loongarch: Add acpi ged support
[qemu/rayw.git] / include / hw / loongarch / virt.h
blobfb4a4f4e7b194a95a72f8d3f5dde37a0243b96a9
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Definitions for loongarch board emulation.
5 * Copyright (C) 2021 Loongson Technology Corporation Limited
6 */
8 #ifndef HW_LOONGARCH_H
9 #define HW_LOONGARCH_H
11 #include "target/loongarch/cpu.h"
12 #include "hw/boards.h"
13 #include "qemu/queue.h"
14 #include "hw/intc/loongarch_ipi.h"
16 #define LOONGARCH_MAX_VCPUS 4
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)
24 #define VIRT_LOWMEM_BASE 0
25 #define VIRT_LOWMEM_SIZE 0x10000000
26 #define VIRT_HIGHMEM_BASE 0x90000000
27 #define VIRT_GED_EVT_ADDR 0x100e0000
28 #define VIRT_GED_MEM_ADDR (VIRT_GED_EVT_ADDR + ACPI_GED_EVT_SEL_LEN)
29 #define VIRT_GED_REG_ADDR (VIRT_GED_MEM_ADDR + MEMORY_HOTPLUG_IO_LEN)
31 struct LoongArchMachineState {
32 /*< private >*/
33 MachineState parent_obj;
35 IPICore ipi_core[MAX_IPI_CORE_NUM];
36 MemoryRegion lowmem;
37 MemoryRegion highmem;
38 MemoryRegion isa_io;
39 MemoryRegion bios;
40 bool bios_loaded;
41 /* State for other subsystems/APIs: */
42 FWCfgState *fw_cfg;
43 Notifier machine_done;
44 OnOffAuto acpi;
45 char *oem_id;
46 char *oem_table_id;
47 DeviceState *acpi_ged;
50 #define TYPE_LOONGARCH_MACHINE MACHINE_TYPE_NAME("virt")
51 OBJECT_DECLARE_SIMPLE_TYPE(LoongArchMachineState, LOONGARCH_MACHINE)
52 bool loongarch_is_acpi_enabled(LoongArchMachineState *lams);
53 void loongarch_acpi_setup(LoongArchMachineState *lams);
54 #endif