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 #include "acpi-dsdt-isa.dsl"
120 /****************************************************************
122 ****************************************************************/
125 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
126 Field(PCST, DWordAcc, NoLock, WriteAsZeros) {
131 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
132 Field(SEJ, DWordAcc, NoLock, WriteAsZeros) {
136 /* Methods called by bulk generated PCI devices below */
138 /* Methods called by hotplug devices */
139 Method(PCEJ, 1, NotSerialized) {
140 // _EJ0 method - eject callback
141 Store(ShiftLeft(1, Arg0), B0EJ)
145 /* Hotplug notification method supplied by SSDT */
146 External(\_SB.PCI0.PCNT, MethodObj)
148 /* PCI hotplug notify method */
152 While (LLess(Local0, 31)) {
154 If (And(PCIU, ShiftLeft(1, Local0))) {
157 If (And(PCID, ShiftLeft(1, Local0))) {
165 /****************************************************************
167 ****************************************************************/
171 Name(_PRT, Package() {
172 /* PCI IRQ routing table, example from ACPI 2.0a specification,
174 /* Note: we provide the same info as the PCI routing
175 table of the Bochs BIOS */
177 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
178 Package() { nr##ffff, 0, lnk0, 0 }, \
179 Package() { nr##ffff, 1, lnk1, 0 }, \
180 Package() { nr##ffff, 2, lnk2, 0 }, \
181 Package() { nr##ffff, 3, lnk3, 0 }
183 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
184 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
185 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
186 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
189 /* Device 1 is power mgmt device, and can only use irq 9 */
190 prt_slot(0x0001, LNKS, LNKB, LNKC, LNKD),
224 Field(PCI0.ISA.P40C, ByteAcc, NoLock, Preserve) {
231 Method(IQST, 1, NotSerialized) {
232 // _STA method - get status
233 If (And(0x80, Arg0)) {
238 Method(IQCR, 1, NotSerialized) {
239 // _CRS method - get current settings
240 Name(PRR0, ResourceTemplate() {
241 Interrupt(, Level, ActiveHigh, Shared) { 0 }
243 CreateDWordField(PRR0, 0x05, PRRI)
244 If (LLess(Arg0, 0x80)) {
250 #define define_link(link, uid, reg) \
252 Name(_HID, EISAID("PNP0C0F")) \
254 Name(_PRS, ResourceTemplate() { \
255 Interrupt(, Level, ActiveHigh, Shared) { \
259 Method(_STA, 0, NotSerialized) { \
262 Method(_DIS, 0, NotSerialized) { \
265 Method(_CRS, 0, NotSerialized) { \
268 Method(_SRS, 1, NotSerialized) { \
269 CreateDWordField(Arg0, 0x05, PRRI) \
274 define_link(LNKA, 0, PRQ0)
275 define_link(LNKB, 1, PRQ1)
276 define_link(LNKC, 2, PRQ2)
277 define_link(LNKD, 3, PRQ3)
280 Name(_HID, EISAID("PNP0C0F"))
282 Name(_PRS, ResourceTemplate() {
283 Interrupt(, Level, ActiveHigh, Shared) { 9 }
286 // The SCI cannot be disabled and is always attached to GSI 9,
287 // so these are no-ops. We only need this link to override the
288 // polarity to active high and match the content of the MADT.
289 Method(_STA, 0, NotSerialized) { Return (0x0b) }
290 Method(_DIS, 0, NotSerialized) { }
291 Method(_CRS, 0, NotSerialized) { Return (_PRS) }
292 Method(_SRS, 1, NotSerialized) { }
296 #include "acpi-dsdt-cpu-hotplug.dsl"
299 /****************************************************************
300 * General purpose events
301 ****************************************************************/
304 Name(_HID, "ACPI0006")