1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Definitions for loongarch board emulation.
5 * Copyright (C) 2021 Loongson Technology Corporation Limited
11 #include "target/loongarch/cpu.h"
12 #include "hw/boards.h"
13 #include "qemu/queue.h"
14 #include "hw/intc/loongarch_ipi.h"
15 #include "hw/block/flash.h"
17 #define LOONGARCH_MAX_VCPUS 4
19 #define VIRT_ISA_IO_BASE 0x18000000UL
20 #define VIRT_ISA_IO_SIZE 0x0004000
21 #define VIRT_FWCFG_BASE 0x1e020000UL
22 #define VIRT_BIOS_BASE 0x1c000000UL
23 #define VIRT_BIOS_SIZE (4 * MiB)
24 #define VIRT_FLASH_SECTOR_SIZE (128 * KiB)
25 #define VIRT_FLASH_BASE 0x1d000000UL
26 #define VIRT_FLASH_SIZE (16 * MiB)
28 #define VIRT_LOWMEM_BASE 0
29 #define VIRT_LOWMEM_SIZE 0x10000000
30 #define VIRT_HIGHMEM_BASE 0x90000000
31 #define VIRT_GED_EVT_ADDR 0x100e0000
32 #define VIRT_GED_MEM_ADDR (VIRT_GED_EVT_ADDR + ACPI_GED_EVT_SEL_LEN)
33 #define VIRT_GED_REG_ADDR (VIRT_GED_MEM_ADDR + MEMORY_HOTPLUG_IO_LEN)
35 struct LoongArchMachineState
{
37 MachineState parent_obj
;
44 /* State for other subsystems/APIs: */
46 Notifier machine_done
;
47 Notifier powerdown_notifier
;
51 DeviceState
*acpi_ged
;
53 DeviceState
*platform_bus_dev
;
58 #define TYPE_LOONGARCH_MACHINE MACHINE_TYPE_NAME("virt")
59 OBJECT_DECLARE_SIMPLE_TYPE(LoongArchMachineState
, LOONGARCH_MACHINE
)
60 bool loongarch_is_acpi_enabled(LoongArchMachineState
*lams
);
61 void loongarch_acpi_setup(LoongArchMachineState
*lams
);