Jason Baron | e516572 | 2012-11-22 22:05:06 -0500 | [diff] [blame] | 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 | |
| 24 | #include "acpi.h" |
| 25 | |
| 26 | typedef struct ICH9LPCPMRegs { |
| 27 | /* |
| 28 | * In ich9 spec says that pm1_cnt register is 32bit width and |
| 29 | * that the upper 16bits are reserved and unused. |
| 30 | * PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t. |
| 31 | */ |
| 32 | ACPIREGS acpi_regs; |
Gerd Hoffmann | 503b19f | 2012-12-11 09:42:18 +0100 | [diff] [blame] | 33 | |
Gerd Hoffmann | cacaab8 | 2012-11-22 12:08:22 +0100 | [diff] [blame] | 34 | MemoryRegion io; |
Gerd Hoffmann | 76a7daf | 2012-11-22 13:43:17 +0100 | [diff] [blame] | 35 | MemoryRegion io_gpe; |
Gerd Hoffmann | 10cc69b | 2012-11-22 13:51:35 +0100 | [diff] [blame] | 36 | MemoryRegion io_smi; |
Gerd Hoffmann | 503b19f | 2012-12-11 09:42:18 +0100 | [diff] [blame] | 37 | |
Jason Baron | e516572 | 2012-11-22 22:05:06 -0500 | [diff] [blame] | 38 | uint32_t smi_en; |
| 39 | uint32_t smi_sts; |
| 40 | |
| 41 | qemu_irq irq; /* SCI */ |
| 42 | |
| 43 | uint32_t pm_io_base; |
| 44 | Notifier powerdown_notifier; |
| 45 | } ICH9LPCPMRegs; |
| 46 | |
Gerd Hoffmann | 503b19f | 2012-12-11 09:42:18 +0100 | [diff] [blame] | 47 | void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, |
Jason Baron | e516572 | 2012-11-22 22:05:06 -0500 | [diff] [blame] | 48 | qemu_irq sci_irq, qemu_irq cmos_s3_resume); |
| 49 | void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base); |
| 50 | extern const VMStateDescription vmstate_ich9_pm; |
| 51 | |
| 52 | #endif /* HW_ACPI_ICH9_H */ |