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"
46 /****************************************************************
48 ****************************************************************/
52 Name(_ADR, 0x00010003)
53 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
58 /****************************************************************
60 ****************************************************************/
64 External(ISA, DeviceObj)
67 Name(_ADR, 0x00010000)
69 /* PIIX PCI to ISA irq remapping */
70 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
73 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
87 #include "acpi-dsdt-isa.dsl"
90 /****************************************************************
92 ****************************************************************/
95 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
96 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
101 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
102 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
106 OperationRegion(BNMR, SystemIO, 0xae10, 0x04)
107 Field(BNMR, DWordAcc, NoLock, WriteAsZeros) {
111 /* Lock to protect access to fields above. */
114 /* Methods called by bulk generated PCI devices below */
116 /* Methods called by hotplug devices */
117 Method(PCEJ, 2, NotSerialized) {
118 // _EJ0 method - eject callback
119 Acquire(BLCK, 0xFFFF)
121 Store(ShiftLeft(1, Arg1), B0EJ)
126 /* Hotplug notification method supplied by SSDT */
127 External(\_SB.PCI0.PCNT, MethodObj)
131 /****************************************************************
133 ****************************************************************/
138 Store(Package(128) {}, Local0)
140 While(LLess(Local1, 128)) {
142 Store(ShiftRight(Local1, 2), Local2)
144 // lnk = (slot + pin) & 3
145 Store(And(Add(Local1, Local2), 3), Local3)
146 If (LEqual(Local3, 0)) {
147 Store(Package(4) { Zero, Zero, LNKD, Zero }, Local4)
149 If (LEqual(Local3, 1)) {
150 // device 1 is the power-management device, needs SCI
151 If (LEqual(Local1, 4)) {
152 Store(Package(4) { Zero, Zero, LNKS, Zero }, Local4)
154 Store(Package(4) { Zero, Zero, LNKA, Zero }, Local4)
157 If (LEqual(Local3, 2)) {
158 Store(Package(4) { Zero, Zero, LNKB, Zero }, Local4)
160 If (LEqual(Local3, 3)) {
161 Store(Package(4) { Zero, Zero, LNKC, Zero }, Local4)
164 // Complete the interrupt routing entry:
165 // Package(4) { 0x[slot]FFFF, [pin], [link], 0) }
167 Store(Or(ShiftLeft(Local2, 16), 0xFFFF), Index(Local4, 0))
168 Store(And(Local1, 3), Index(Local4, 1))
169 Store(Local4, Index(Local0, Local1))
178 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
185 Method(IQST, 1, NotSerialized) {
186 // _STA method - get status
187 If (And(0x80, Arg0)) {
192 Method(IQCR, 1, Serialized) {
193 // _CRS method - get current settings
194 Name(PRR0, ResourceTemplate() {
195 Interrupt(, Level, ActiveHigh, Shared) { 0 }
197 CreateDWordField(PRR0, 0x05, PRRI)
198 If (LLess(Arg0, 0x80)) {
204 #define define_link(link, uid, reg) \
206 Name(_HID, EISAID("PNP0C0F")) \
208 Name(_PRS, ResourceTemplate() { \
209 Interrupt(, Level, ActiveHigh, Shared) { \
213 Method(_STA, 0, NotSerialized) { \
216 Method(_DIS, 0, NotSerialized) { \
219 Method(_CRS, 0, NotSerialized) { \
222 Method(_SRS, 1, NotSerialized) { \
223 CreateDWordField(Arg0, 0x05, PRRI) \
228 define_link(LNKA, 0, PRQ0)
229 define_link(LNKB, 1, PRQ1)
230 define_link(LNKC, 2, PRQ2)
231 define_link(LNKD, 3, PRQ3)
234 Name(_HID, EISAID("PNP0C0F"))
236 Name(_PRS, ResourceTemplate() {
237 Interrupt(, Level, ActiveHigh, Shared) { 9 }
240 // The SCI cannot be disabled and is always attached to GSI 9,
241 // so these are no-ops. We only need this link to override the
242 // polarity to active high and match the content of the MADT.
243 Method(_STA, 0, NotSerialized) { Return (0x0b) }
244 Method(_DIS, 0, NotSerialized) { }
245 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
246 Method(_SRS, 1, NotSerialized) { }
250 #include "hw/acpi/pc-hotplug.h"
251 #define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
252 #include "acpi-dsdt-cpu-hotplug.dsl"
255 /****************************************************************
256 * General purpose events
257 ****************************************************************/
259 Name(_HID, "ACPI0006")
265 Acquire(\_SB.PCI0.BLCK, 0xFFFF)
267 Release(\_SB.PCI0.BLCK)
271 \_SB.CPU_SCAN_METHOD()