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 #include "acpi-dsdt-isa.dsl"
91 /****************************************************************
93 ****************************************************************/
96 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
97 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
102 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
103 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
107 OperationRegion(BNMR, SystemIO, 0xae10, 0x04)
108 Field(BNMR, DWordAcc, NoLock, WriteAsZeros) {
112 /* Lock to protect access to fields above. */
115 /* Methods called by bulk generated PCI devices below */
117 /* Methods called by hotplug devices */
118 Method(PCEJ, 2, NotSerialized) {
119 // _EJ0 method - eject callback
120 Acquire(BLCK, 0xFFFF)
122 Store(ShiftLeft(1, Arg1), B0EJ)
127 /* Hotplug notification method supplied by SSDT */
128 External(\_SB.PCI0.PCNT, MethodObj)
132 /****************************************************************
134 ****************************************************************/
139 Store(Package(128) {}, Local0)
141 While(LLess(Local1, 128)) {
143 Store(ShiftRight(Local1, 2), Local2)
145 // lnk = (slot + pin) & 3
146 Store(And(Add(Local1, Local2), 3), Local3)
147 If (LEqual(Local3, 0)) {
148 Store(Package(4) { Zero, Zero, LNKD, Zero }, Local4)
150 If (LEqual(Local3, 1)) {
151 // device 1 is the power-management device, needs SCI
152 If (LEqual(Local1, 4)) {
153 Store(Package(4) { Zero, Zero, LNKS, Zero }, Local4)
155 Store(Package(4) { Zero, Zero, LNKA, Zero }, Local4)
158 If (LEqual(Local3, 2)) {
159 Store(Package(4) { Zero, Zero, LNKB, Zero }, Local4)
161 If (LEqual(Local3, 3)) {
162 Store(Package(4) { Zero, Zero, LNKC, Zero }, Local4)
165 // Complete the interrupt routing entry:
166 // Package(4) { 0x[slot]FFFF, [pin], [link], 0) }
168 Store(Or(ShiftLeft(Local2, 16), 0xFFFF), Index(Local4, 0))
169 Store(And(Local1, 3), Index(Local4, 1))
170 Store(Local4, Index(Local0, Local1))
179 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
186 Method(IQST, 1, NotSerialized) {
187 // _STA method - get status
188 If (And(0x80, Arg0)) {
193 Method(IQCR, 1, Serialized) {
194 // _CRS method - get current settings
195 Name(PRR0, ResourceTemplate() {
196 Interrupt(, Level, ActiveHigh, Shared) { 0 }
198 CreateDWordField(PRR0, 0x05, PRRI)
199 If (LLess(Arg0, 0x80)) {
205 #define define_link(link, uid, reg) \
207 Name(_HID, EISAID("PNP0C0F")) \
209 Name(_PRS, ResourceTemplate() { \
210 Interrupt(, Level, ActiveHigh, Shared) { \
214 Method(_STA, 0, NotSerialized) { \
217 Method(_DIS, 0, NotSerialized) { \
220 Method(_CRS, 0, NotSerialized) { \
223 Method(_SRS, 1, NotSerialized) { \
224 CreateDWordField(Arg0, 0x05, PRRI) \
229 define_link(LNKA, 0, PRQ0)
230 define_link(LNKB, 1, PRQ1)
231 define_link(LNKC, 2, PRQ2)
232 define_link(LNKD, 3, PRQ3)
235 Name(_HID, EISAID("PNP0C0F"))
237 Name(_PRS, ResourceTemplate() {
238 Interrupt(, Level, ActiveHigh, Shared) { 9 }
241 // The SCI cannot be disabled and is always attached to GSI 9,
242 // so these are no-ops. We only need this link to override the
243 // polarity to active high and match the content of the MADT.
244 Method(_STA, 0, NotSerialized) { Return (0x0b) }
245 Method(_DIS, 0, NotSerialized) { }
246 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
247 Method(_SRS, 1, NotSerialized) { }
251 #include "hw/acpi/pc-hotplug.h"
252 #define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
253 #include "acpi-dsdt-cpu-hotplug.dsl"
254 #include "acpi-dsdt-mem-hotplug.dsl"
257 /****************************************************************
258 * General purpose events
259 ****************************************************************/
261 Name(_HID, "ACPI0006")
267 Acquire(\_SB.PCI0.BLCK, 0xFFFF)
269 Release(\_SB.PCI0.BLCK)
276 // Memory hotplug event
277 \_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()