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"
35 /****************************************************************
37 ****************************************************************/
38 #define BOARD_SPECIFIC_PCI_RESOURSES \
39 WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
46 WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
53 /* 0xae00-0xae0e hole for PCI hotplug, hw/acpi/piix4.c:PCI_HOTPLUG_ADDR */ \
54 WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
61 /* 0xaf00-0xaf1f hole for CPU hotplug, hw/acpi/piix4.c:PIIX4_PROC_BASE */ \
62 WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
69 /* 0xafe0-0xafe3 hole for ACPI.GPE0, hw/acpi/piix4.c:GPE_BASE */ \
70 WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange, \
80 Name(_HID, EisaId("PNP0A03"))
84 // External(PX13, DeviceObj)
88 #include "acpi-dsdt-pci-crs.dsl"
89 #include "acpi-dsdt-hpet.dsl"
92 /****************************************************************
94 ****************************************************************/
98 Name(_ADR, 0x00010003)
99 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
104 /****************************************************************
106 ****************************************************************/
110 External(ISA, DeviceObj)
113 Name(_ADR, 0x00010000)
115 /* PIIX PCI to ISA irq remapping */
116 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
119 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
133 #define DSDT_APPLESMC_STA piix_dsdt_applesmc_sta
134 #include "acpi-dsdt-isa.dsl"
137 /****************************************************************
139 ****************************************************************/
142 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
143 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
148 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
149 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
153 OperationRegion(BNMR, SystemIO, 0xae10, 0x04)
154 Field(BNMR, DWordAcc, NoLock, WriteAsZeros) {
158 /* Lock to protect access to fields above. */
161 /* Methods called by bulk generated PCI devices below */
163 /* Methods called by hotplug devices */
164 Method(PCEJ, 2, NotSerialized) {
165 // _EJ0 method - eject callback
166 Acquire(BLCK, 0xFFFF)
168 Store(ShiftLeft(1, Arg1), B0EJ)
173 /* Hotplug notification method supplied by SSDT */
174 External(\_SB.PCI0.PCNT, MethodObj)
178 /****************************************************************
180 ****************************************************************/
185 Store(Package(128) {}, Local0)
187 While(LLess(Local1, 128)) {
189 Store(ShiftRight(Local1, 2), Local2)
191 // lnk = (slot + pin) & 3
192 Store(And(Add(Local1, Local2), 3), Local3)
193 If (LEqual(Local3, 0)) {
194 Store(Package(4) { Zero, Zero, LNKD, Zero }, Local4)
196 If (LEqual(Local3, 1)) {
197 // device 1 is the power-management device, needs SCI
198 If (LEqual(Local1, 4)) {
199 Store(Package(4) { Zero, Zero, LNKS, Zero }, Local4)
201 Store(Package(4) { Zero, Zero, LNKA, Zero }, Local4)
204 If (LEqual(Local3, 2)) {
205 Store(Package(4) { Zero, Zero, LNKB, Zero }, Local4)
207 If (LEqual(Local3, 3)) {
208 Store(Package(4) { Zero, Zero, LNKC, Zero }, Local4)
211 // Complete the interrupt routing entry:
212 // Package(4) { 0x[slot]FFFF, [pin], [link], 0) }
214 Store(Or(ShiftLeft(Local2, 16), 0xFFFF), Index(Local4, 0))
215 Store(And(Local1, 3), Index(Local4, 1))
216 Store(Local4, Index(Local0, Local1))
225 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
232 Method(IQST, 1, NotSerialized) {
233 // _STA method - get status
234 If (And(0x80, Arg0)) {
239 Method(IQCR, 1, Serialized) {
240 // _CRS method - get current settings
241 Name(PRR0, ResourceTemplate() {
242 Interrupt(, Level, ActiveHigh, Shared) { 0 }
244 CreateDWordField(PRR0, 0x05, PRRI)
245 If (LLess(Arg0, 0x80)) {
251 #define define_link(link, uid, reg) \
253 Name(_HID, EISAID("PNP0C0F")) \
255 Name(_PRS, ResourceTemplate() { \
256 Interrupt(, Level, ActiveHigh, Shared) { \
260 Method(_STA, 0, NotSerialized) { \
263 Method(_DIS, 0, NotSerialized) { \
266 Method(_CRS, 0, NotSerialized) { \
269 Method(_SRS, 1, NotSerialized) { \
270 CreateDWordField(Arg0, 0x05, PRRI) \
275 define_link(LNKA, 0, PRQ0)
276 define_link(LNKB, 1, PRQ1)
277 define_link(LNKC, 2, PRQ2)
278 define_link(LNKD, 3, PRQ3)
281 Name(_HID, EISAID("PNP0C0F"))
283 Name(_PRS, ResourceTemplate() {
284 Interrupt(, Level, ActiveHigh, Shared) { 9 }
287 // The SCI cannot be disabled and is always attached to GSI 9,
288 // so these are no-ops. We only need this link to override the
289 // polarity to active high and match the content of the MADT.
290 Method(_STA, 0, NotSerialized) { Return (0x0b) }
291 Method(_DIS, 0, NotSerialized) { }
292 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
293 Method(_SRS, 1, NotSerialized) { }
297 #include "hw/acpi/pc-hotplug.h"
298 #define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
299 #include "acpi-dsdt-cpu-hotplug.dsl"
302 /****************************************************************
303 * General purpose events
304 ****************************************************************/
305 External(\_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD, MethodObj)
308 Name(_HID, "ACPI0006")
314 Acquire(\_SB.PCI0.BLCK, 0xFFFF)
316 Release(\_SB.PCI0.BLCK)
323 // Memory hotplug event
324 \_SB.PCI0.MEMORY_HOTPLUG_DEVICE.MEMORY_SLOT_SCAN_METHOD()