2012-11-23 04:05:06 +01:00
|
|
|
/*
|
|
|
|
* QEMU GMCH/ICH9 LPC PM Emulation
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
|
|
|
|
* VA Linux Systems Japan K.K.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_ACPI_ICH9_H
|
|
|
|
#define HW_ACPI_ICH9_H
|
|
|
|
|
2013-02-05 17:06:20 +01:00
|
|
|
#include "hw/acpi/acpi.h"
|
2014-01-09 17:36:32 +01:00
|
|
|
#include "hw/acpi/cpu_hotplug.h"
|
2016-06-14 16:02:06 +02:00
|
|
|
#include "hw/acpi/cpu.h"
|
2014-06-02 15:25:22 +02:00
|
|
|
#include "hw/acpi/memory_hotplug.h"
|
2014-06-16 19:12:27 +02:00
|
|
|
#include "hw/acpi/acpi_dev_interface.h"
|
2015-06-28 19:58:56 +02:00
|
|
|
#include "hw/acpi/tco.h"
|
2012-11-23 04:05:06 +01:00
|
|
|
|
|
|
|
typedef struct ICH9LPCPMRegs {
|
|
|
|
/*
|
|
|
|
* In ich9 spec says that pm1_cnt register is 32bit width and
|
|
|
|
* that the upper 16bits are reserved and unused.
|
|
|
|
* PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t.
|
|
|
|
*/
|
|
|
|
ACPIREGS acpi_regs;
|
2012-12-11 09:42:18 +01:00
|
|
|
|
2012-11-22 12:08:22 +01:00
|
|
|
MemoryRegion io;
|
2012-11-22 13:43:17 +01:00
|
|
|
MemoryRegion io_gpe;
|
2012-11-22 13:51:35 +01:00
|
|
|
MemoryRegion io_smi;
|
2012-12-11 09:42:18 +01:00
|
|
|
|
2012-11-23 04:05:06 +01:00
|
|
|
uint32_t smi_en;
|
2015-05-06 10:58:30 +02:00
|
|
|
uint32_t smi_en_wmask;
|
2012-11-23 04:05:06 +01:00
|
|
|
uint32_t smi_sts;
|
|
|
|
|
|
|
|
qemu_irq irq; /* SCI */
|
|
|
|
|
|
|
|
uint32_t pm_io_base;
|
|
|
|
Notifier powerdown_notifier;
|
2014-01-09 17:36:32 +01:00
|
|
|
|
2016-04-11 17:25:54 +02:00
|
|
|
bool cpu_hotplug_legacy;
|
2014-01-09 17:36:32 +01:00
|
|
|
AcpiCpuHotplug gpe_cpu;
|
2016-06-14 16:02:06 +02:00
|
|
|
CPUHotplugState cpuhp_state;
|
2014-06-02 15:25:22 +02:00
|
|
|
|
|
|
|
MemHotplugState acpi_memory_hotplug;
|
2015-01-12 13:00:14 +01:00
|
|
|
|
|
|
|
uint8_t disable_s3;
|
|
|
|
uint8_t disable_s4;
|
|
|
|
uint8_t s4_val;
|
2015-06-18 18:30:51 +02:00
|
|
|
uint8_t smm_enabled;
|
2015-06-28 19:58:56 +02:00
|
|
|
bool enable_tco;
|
|
|
|
TCOIORegs tco_regs;
|
2012-11-23 04:05:06 +01:00
|
|
|
} ICH9LPCPMRegs;
|
|
|
|
|
2017-10-17 18:44:18 +02:00
|
|
|
#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
|
|
|
|
|
2012-12-11 09:42:18 +01:00
|
|
|
void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
|
2015-06-28 19:58:56 +02:00
|
|
|
bool smm_enabled,
|
|
|
|
qemu_irq sci_irq);
|
|
|
|
|
2012-11-23 04:05:06 +01:00
|
|
|
void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base);
|
|
|
|
extern const VMStateDescription vmstate_ich9_pm;
|
|
|
|
|
2013-07-24 17:56:10 +02:00
|
|
|
void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp);
|
|
|
|
|
2019-03-01 04:35:48 +01:00
|
|
|
void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
|
|
|
|
Error **errp);
|
2016-05-31 12:01:17 +02:00
|
|
|
void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
|
|
|
|
Error **errp);
|
|
|
|
void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev,
|
|
|
|
DeviceState *dev, Error **errp);
|
|
|
|
void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
|
2015-01-28 08:45:40 +01:00
|
|
|
Error **errp);
|
2014-06-16 19:12:27 +02:00
|
|
|
|
|
|
|
void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
|
2012-11-23 04:05:06 +01:00
|
|
|
#endif /* HW_ACPI_ICH9_H */
|