2 * Bochs/QEMU ACPI DSDT ASL definition
4 * Copyright (c) 2006 Fabrice Bellard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2 as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 ACPI_EXTRACT_ALL_CODE AcpiDsdtAmlCode
23 "acpi-dsdt.aml", // Output Filename
25 0x01, // DSDT Compliance Revision
32 #include "acpi-dsdt-dbug.dsl"
36 Name(_HID, EisaId("PNP0A03"))
40 // External(PX13, DeviceObj)
44 #include "acpi-dsdt-hpet.dsl"
47 /****************************************************************
49 ****************************************************************/
53 Name(_ADR, 0x00010003)
54 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
59 /****************************************************************
61 ****************************************************************/
65 External(ISA, DeviceObj)
68 Name(_ADR, 0x00010000)
70 /* PIIX PCI to ISA irq remapping */
71 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
74 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
88 #define DSDT_APPLESMC_STA piix_dsdt_applesmc_sta
89 #include "acpi-dsdt-isa.dsl"
92 /****************************************************************
94 ****************************************************************/
97 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
98 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
103 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
104 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
108 OperationRegion(BNMR, SystemIO, 0xae10, 0x04)
109 Field(BNMR, DWordAcc, NoLock, WriteAsZeros) {
113 /* Lock to protect access to fields above. */
116 /* Methods called by bulk generated PCI devices below */
118 /* Methods called by hotplug devices */
119 Method(PCEJ, 2, NotSerialized) {
120 // _EJ0 method - eject callback
121 Acquire(BLCK, 0xFFFF)
123 Store(ShiftLeft(1, Arg1), B0EJ)
128 /* Hotplug notification method supplied by SSDT */
129 External(\_SB.PCI0.PCNT, MethodObj)
133 /****************************************************************
135 ****************************************************************/
140 Store(Package(128) {}, Local0)
142 While(LLess(Local1, 128)) {
144 Store(ShiftRight(Local1, 2), Local2)
146 // lnk = (slot + pin) & 3
147 Store(And(Add(Local1, Local2), 3), Local3)
148 If (LEqual(Local3, 0)) {
149 Store(Package(4) { Zero, Zero, LNKD, Zero }, Local4)
151 If (LEqual(Local3, 1)) {
152 // device 1 is the power-management device, needs SCI
153 If (LEqual(Local1, 4)) {
154 Store(Package(4) { Zero, Zero, LNKS, Zero }, Local4)
156 Store(Package(4) { Zero, Zero, LNKA, Zero }, Local4)
159 If (LEqual(Local3, 2)) {
160 Store(Package(4) { Zero, Zero, LNKB, Zero }, Local4)
162 If (LEqual(Local3, 3)) {
163 Store(Package(4) { Zero, Zero, LNKC, Zero }, Local4)
166 // Complete the interrupt routing entry:
167 // Package(4) { 0x[slot]FFFF, [pin], [link], 0) }
169 Store(Or(ShiftLeft(Local2, 16), 0xFFFF), Index(Local4, 0))
170 Store(And(Local1, 3), Index(Local4, 1))
171 Store(Local4, Index(Local0, Local1))
180 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
187 Method(IQST, 1, NotSerialized) {
188 // _STA method - get status
189 If (And(0x80, Arg0)) {
194 Method(IQCR, 1, Serialized) {
195 // _CRS method - get current settings
196 Name(PRR0, ResourceTemplate() {
197 Interrupt(, Level, ActiveHigh, Shared) { 0 }
199 CreateDWordField(PRR0, 0x05, PRRI)
200 If (LLess(Arg0, 0x80)) {
206 #define define_link(link, uid, reg) \
208 Name(_HID, EISAID("PNP0C0F")) \
210 Name(_PRS, ResourceTemplate() { \
211 Interrupt(, Level, ActiveHigh, Shared) { \
215 Method(_STA, 0, NotSerialized) { \
218 Method(_DIS, 0, NotSerialized) { \
221 Method(_CRS, 0, NotSerialized) { \
224 Method(_SRS, 1, NotSerialized) { \
225 CreateDWordField(Arg0, 0x05, PRRI) \
230 define_link(LNKA, 0, PRQ0)
231 define_link(LNKB, 1, PRQ1)
232 define_link(LNKC, 2, PRQ2)
233 define_link(LNKD, 3, PRQ3)
236 Name(_HID, EISAID("PNP0C0F"))
238 Name(_PRS, ResourceTemplate() {
239 Interrupt(, Level, ActiveHigh, Shared) { 9 }
242 // The SCI cannot be disabled and is always attached to GSI 9,
243 // so these are no-ops. We only need this link to override the
244 // polarity to active high and match the content of the MADT.
245 Method(_STA, 0, NotSerialized) { Return (0x0b) }
246 Method(_DIS, 0, NotSerialized) { }
247 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
248 Method(_SRS, 1, NotSerialized) { }
252 #include "hw/acpi/pc-hotplug.h"
253 #define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
254 #include "acpi-dsdt-cpu-hotplug.dsl"
255 #include "acpi-dsdt-mem-hotplug.dsl"
258 /****************************************************************
259 * General purpose events
260 ****************************************************************/
262 Name(_HID, "ACPI0006")
268 Acquire(\_SB.PCI0.BLCK, 0xFFFF)
270 Release(\_SB.PCI0.BLCK)
277 // Memory hotplug event
278 \_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()