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 ****************************************************************/
184 Name(_PRT, Package() {
185 /* PCI IRQ routing table, example from ACPI 2.0a specification,
187 /* Note: we provide the same info as the PCI routing
188 table of the Bochs BIOS */
190 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
191 Package() { nr##ffff, 0, lnk0, 0 }, \
192 Package() { nr##ffff, 1, lnk1, 0 }, \
193 Package() { nr##ffff, 2, lnk2, 0 }, \
194 Package() { nr##ffff, 3, lnk3, 0 }
196 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
197 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
198 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
199 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
202 /* Device 1 is power mgmt device, and can only use irq 9 */
203 prt_slot(0x0001, LNKS, LNKB, LNKC, LNKD),
237 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
244 Method(IQST, 1, NotSerialized) {
245 // _STA method - get status
246 If (And(0x80, Arg0)) {
251 Method(IQCR, 1, Serialized) {
252 // _CRS method - get current settings
253 Name(PRR0, ResourceTemplate() {
254 Interrupt(, Level, ActiveHigh, Shared) { 0 }
256 CreateDWordField(PRR0, 0x05, PRRI)
257 If (LLess(Arg0, 0x80)) {
263 #define define_link(link, uid, reg) \
265 Name(_HID, EISAID("PNP0C0F")) \
267 Name(_PRS, ResourceTemplate() { \
268 Interrupt(, Level, ActiveHigh, Shared) { \
272 Method(_STA, 0, NotSerialized) { \
275 Method(_DIS, 0, NotSerialized) { \
278 Method(_CRS, 0, NotSerialized) { \
281 Method(_SRS, 1, NotSerialized) { \
282 CreateDWordField(Arg0, 0x05, PRRI) \
287 define_link(LNKA, 0, PRQ0)
288 define_link(LNKB, 1, PRQ1)
289 define_link(LNKC, 2, PRQ2)
290 define_link(LNKD, 3, PRQ3)
293 Name(_HID, EISAID("PNP0C0F"))
295 Name(_PRS, ResourceTemplate() {
296 Interrupt(, Level, ActiveHigh, Shared) { 9 }
299 // The SCI cannot be disabled and is always attached to GSI 9,
300 // so these are no-ops. We only need this link to override the
301 // polarity to active high and match the content of the MADT.
302 Method(_STA, 0, NotSerialized) { Return (0x0b) }
303 Method(_DIS, 0, NotSerialized) { }
304 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
305 Method(_SRS, 1, NotSerialized) { }
309 #include "hw/acpi/cpu_hotplug_defs.h"
310 #define CPU_STATUS_BASE PIIX4_CPU_HOTPLUG_IO_BASE
311 #include "acpi-dsdt-cpu-hotplug.dsl"
314 /****************************************************************
315 * General purpose events
316 ****************************************************************/
319 Name(_HID, "ACPI0006")
325 Acquire(\_SB.PCI0.BLCK, 0xFFFF)
327 Release(\_SB.PCI0.BLCK)