]>
Commit | Line | Data |
---|---|---|
e516572f JB |
1 | /* |
2 | * QEMU GMCH/ICH9 LPC PM Emulation | |
3 | * | |
4 | * Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp> | |
5 | * VA Linux Systems Japan K.K. | |
6 | * | |
7 | * This library is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU Lesser General Public | |
9 | * License as published by the Free Software Foundation; either | |
10 | * version 2 of the License, or (at your option) any later version. | |
11 | * | |
12 | * This library is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * Lesser General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU Lesser General Public | |
18 | * License along with this library; if not, see <http://www.gnu.org/licenses/> | |
19 | */ | |
20 | ||
21 | #ifndef HW_ACPI_ICH9_H | |
22 | #define HW_ACPI_ICH9_H | |
23 | ||
0d09e41a | 24 | #include "hw/acpi/acpi.h" |
d6610bc2 | 25 | #include "hw/acpi/cpu_hotplug.h" |
1f862184 | 26 | #include "hw/acpi/memory_hotplug.h" |
43f50410 | 27 | #include "hw/acpi/acpi_dev_interface.h" |
e516572f JB |
28 | |
29 | typedef struct ICH9LPCPMRegs { | |
30 | /* | |
31 | * In ich9 spec says that pm1_cnt register is 32bit width and | |
32 | * that the upper 16bits are reserved and unused. | |
33 | * PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t. | |
34 | */ | |
35 | ACPIREGS acpi_regs; | |
503b19fc | 36 | |
cacaab8b | 37 | MemoryRegion io; |
76a7daf9 | 38 | MemoryRegion io_gpe; |
10cc69b0 | 39 | MemoryRegion io_smi; |
503b19fc | 40 | |
e516572f | 41 | uint32_t smi_en; |
11e66a15 | 42 | uint32_t smi_en_wmask; |
e516572f JB |
43 | uint32_t smi_sts; |
44 | ||
45 | qemu_irq irq; /* SCI */ | |
46 | ||
47 | uint32_t pm_io_base; | |
48 | Notifier powerdown_notifier; | |
d6610bc2 IM |
49 | |
50 | AcpiCpuHotplug gpe_cpu; | |
1f862184 IM |
51 | |
52 | MemHotplugState acpi_memory_hotplug; | |
6ac0d8d4 AS |
53 | |
54 | uint8_t disable_s3; | |
55 | uint8_t disable_s4; | |
56 | uint8_t s4_val; | |
fba72476 | 57 | uint8_t smm_enabled; |
e516572f JB |
58 | } ICH9LPCPMRegs; |
59 | ||
503b19fc | 60 | void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, |
fba72476 | 61 | bool smm_enabled, qemu_irq sci_irq); |
e516572f JB |
62 | void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base); |
63 | extern const VMStateDescription vmstate_ich9_pm; | |
64 | ||
6f1426ab MT |
65 | void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp); |
66 | ||
1f862184 | 67 | void ich9_pm_device_plug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp); |
469b8ad2 TC |
68 | void ich9_pm_device_unplug_request_cb(ICH9LPCPMRegs *pm, DeviceState *dev, |
69 | Error **errp); | |
91a734a6 TC |
70 | void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, |
71 | Error **errp); | |
43f50410 IM |
72 | |
73 | void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); | |
e516572f | 74 | #endif /* HW_ACPI_ICH9_H */ |