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"))
86 #include "acpi-dsdt-pci-crs.dsl"
87 #include "acpi-dsdt-hpet.dsl"
90 /****************************************************************
92 ****************************************************************/
96 Name(_ADR, 0x00020000)
97 OperationRegion(PCIC, PCI_Config, Zero, 0x4)
98 Field(PCIC, DWordAcc, NoLock, Preserve) {
101 Method(_S1D, 0, NotSerialized) {
104 Method(_S2D, 0, NotSerialized) {
107 Method(_S3D, 0, NotSerialized) {
108 If (LEqual(VEND, 0x1001b36)) {
118 /****************************************************************
120 ****************************************************************/
124 Name(_ADR, 0x00010003)
125 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
130 /****************************************************************
132 ****************************************************************/
136 Name(_ADR, 0x00010000)
138 /* PIIX PCI to ISA irq remapping */
139 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
142 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
156 #define DSDT_APPLESMC_STA piix_dsdt_applesmc_sta
157 #include "acpi-dsdt-isa.dsl"
160 /****************************************************************
162 ****************************************************************/
165 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
166 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
171 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
172 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
176 OperationRegion(BNMR, SystemIO, 0xae10, 0x04)
177 Field(BNMR, DWordAcc, NoLock, WriteAsZeros) {
181 /* Lock to protect access to fields above. */
184 /* Methods called by bulk generated PCI devices below */
186 /* Methods called by hotplug devices */
187 Method(PCEJ, 2, NotSerialized) {
188 // _EJ0 method - eject callback
189 Acquire(BLCK, 0xFFFF)
191 Store(ShiftLeft(1, Arg1), B0EJ)
196 /* Hotplug notification method supplied by SSDT */
197 External(\_SB.PCI0.PCNT, MethodObj)
201 /****************************************************************
203 ****************************************************************/
207 Name(_PRT, Package() {
208 /* PCI IRQ routing table, example from ACPI 2.0a specification,
210 /* Note: we provide the same info as the PCI routing
211 table of the Bochs BIOS */
213 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
214 Package() { nr##ffff, 0, lnk0, 0 }, \
215 Package() { nr##ffff, 1, lnk1, 0 }, \
216 Package() { nr##ffff, 2, lnk2, 0 }, \
217 Package() { nr##ffff, 3, lnk3, 0 }
219 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
220 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
221 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
222 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
225 /* Device 1 is power mgmt device, and can only use irq 9 */
226 prt_slot(0x0001, LNKS, LNKB, LNKC, LNKD),
260 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
267 Method(IQST, 1, NotSerialized) {
268 // _STA method - get status
269 If (And(0x80, Arg0)) {
274 Method(IQCR, 1, Serialized) {
275 // _CRS method - get current settings
276 Name(PRR0, ResourceTemplate() {
277 Interrupt(, Level, ActiveHigh, Shared) { 0 }
279 CreateDWordField(PRR0, 0x05, PRRI)
280 If (LLess(Arg0, 0x80)) {
286 #define define_link(link, uid, reg) \
288 Name(_HID, EISAID("PNP0C0F")) \
290 Name(_PRS, ResourceTemplate() { \
291 Interrupt(, Level, ActiveHigh, Shared) { \
295 Method(_STA, 0, NotSerialized) { \
298 Method(_DIS, 0, NotSerialized) { \
301 Method(_CRS, 0, NotSerialized) { \
304 Method(_SRS, 1, NotSerialized) { \
305 CreateDWordField(Arg0, 0x05, PRRI) \
310 define_link(LNKA, 0, PRQ0)
311 define_link(LNKB, 1, PRQ1)
312 define_link(LNKC, 2, PRQ2)
313 define_link(LNKD, 3, PRQ3)
316 Name(_HID, EISAID("PNP0C0F"))
318 Name(_PRS, ResourceTemplate() {
319 Interrupt(, Level, ActiveHigh, Shared) { 9 }
322 // The SCI cannot be disabled and is always attached to GSI 9,
323 // so these are no-ops. We only need this link to override the
324 // polarity to active high and match the content of the MADT.
325 Method(_STA, 0, NotSerialized) { Return (0x0b) }
326 Method(_DIS, 0, NotSerialized) { }
327 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
328 Method(_SRS, 1, NotSerialized) { }
332 #include "hw/acpi/cpu_hotplug_defs.h"
333 #define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
334 #include "acpi-dsdt-cpu-hotplug.dsl"
337 /****************************************************************
338 * General purpose events
339 ****************************************************************/
342 Name(_HID, "ACPI0006")
348 Acquire(\_SB.PCI0.BLCK, 0xFFFF)
350 Release(\_SB.PCI0.BLCK)