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 ****************************************************************/
41 Name(_HID, EisaId("PNP0A03"))
47 #include "acpi-dsdt-pci-crs.dsl"
48 #include "acpi-dsdt-hpet.dsl"
51 /****************************************************************
53 ****************************************************************/
57 Name(_ADR, 0x00020000)
58 OperationRegion(PCIC, PCI_Config, Zero, 0x4)
59 Field(PCIC, DWordAcc, NoLock, Preserve) {
62 Method(_S1D, 0, NotSerialized) {
65 Method(_S2D, 0, NotSerialized) {
68 Method(_S3D, 0, NotSerialized) {
69 If (LEqual(VEND, 0x1001b36)) {
79 /****************************************************************
81 ****************************************************************/
85 Name(_ADR, 0x00010003)
86 OperationRegion(P13C, PCI_Config, 0x00, 0xff)
91 /****************************************************************
93 ****************************************************************/
97 Name(_ADR, 0x00010000)
99 /* PIIX PCI to ISA irq remapping */
100 OperationRegion(P40C, PCI_Config, 0x60, 0x04)
103 Field(\_SB.PCI0.PX13.P13C, AnyAcc, NoLock, Preserve) {
117 #define DSDT_APPLESMC_STA piix_dsdt_applesmc_sta
118 #include "acpi-dsdt-isa.dsl"
121 /****************************************************************
123 ****************************************************************/
126 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
127 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
132 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
133 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
137 /* Methods called by bulk generated PCI devices below */
139 /* Methods called by hotplug devices */
140 Method(PCEJ, 1, NotSerialized) {
141 // _EJ0 method - eject callback
142 Store(ShiftLeft(1, Arg0), B0EJ)
146 /* Hotplug notification method supplied by SSDT */
147 External(\_SB.PCI0.PCNT, MethodObj)
149 /* PCI hotplug notify method */
153 While (LLess(Local0, 31)) {
155 If (And(PCIU, ShiftLeft(1, Local0))) {
158 If (And(PCID, ShiftLeft(1, Local0))) {
166 /****************************************************************
168 ****************************************************************/
172 Name(_PRT, Package() {
173 /* PCI IRQ routing table, example from ACPI 2.0a specification,
175 /* Note: we provide the same info as the PCI routing
176 table of the Bochs BIOS */
178 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
179 Package() { nr##ffff, 0, lnk0, 0 }, \
180 Package() { nr##ffff, 1, lnk1, 0 }, \
181 Package() { nr##ffff, 2, lnk2, 0 }, \
182 Package() { nr##ffff, 3, lnk3, 0 }
184 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
185 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
186 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
187 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
190 /* Device 1 is power mgmt device, and can only use irq 9 */
191 prt_slot(0x0001, LNKS, LNKB, LNKC, LNKD),
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 "acpi-dsdt-cpu-hotplug.dsl"
300 /****************************************************************
301 * General purpose events
302 ****************************************************************/
305 Name(_HID, "ACPI0006")