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-dsdt.aml", // Output Filename
22 0x01, // DSDT Compliance Revision
31 OperationRegion (DBG, SystemIO, 0xb044, 0x04)
32 Field (DBG, DWordAcc, NoLock, Preserve)
39 /* PCI Bus definition */
42 Name (_HID, EisaId ("PNP0A03"))
45 Name(_PRT, Package() {
46 /* PCI IRQ routing table, example from ACPI 2.0a specification,
48 /* Note: we provide the same info as the PCI routing
49 table of the Bochs BIOS */
50 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
51 Package() { nr##ffff, 0, lnk0, 0 }, \
52 Package() { nr##ffff, 1, lnk1, 0 }, \
53 Package() { nr##ffff, 2, lnk2, 0 }, \
54 Package() { nr##ffff, 3, lnk3, 0 }
56 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
57 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
58 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
59 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
68 Name (_CRS, ResourceTemplate ()
70 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
71 0x0000, // Address Space Granularity
72 0x0000, // Address Range Minimum
73 0x00FF, // Address Range Maximum
74 0x0000, // Address Translation Offset
75 0x0100, // Address Length
78 0x0CF8, // Address Range Minimum
79 0x0CF8, // Address Range Maximum
80 0x01, // Address Alignment
81 0x08, // Address Length
83 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
84 0x0000, // Address Space Granularity
85 0x0000, // Address Range Minimum
86 0x0CF7, // Address Range Maximum
87 0x0000, // Address Translation Offset
88 0x0CF8, // Address Length
90 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
91 0x0000, // Address Space Granularity
92 0x0D00, // Address Range Minimum
93 0xFFFF, // Address Range Maximum
94 0x0000, // Address Translation Offset
95 0xF300, // Address Length
97 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
98 0x00000000, // Address Space Granularity
99 0x000A0000, // Address Range Minimum
100 0x000BFFFF, // Address Range Maximum
101 0x00000000, // Address Translation Offset
102 0x00020000, // Address Length
103 ,, , AddressRangeMemory, TypeStatic)
104 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
105 0x00000000, // Address Space Granularity
106 0xE0000000, // Address Range Minimum
107 0xFEBFFFFF, // Address Range Maximum
108 0x00000000, // Address Translation Offset
109 0x1EC00000, // Address Length
110 ,, , AddressRangeMemory, TypeStatic)
117 Name (_ADR, 0x00020000)
118 Method (_S1D, 0, NotSerialized)
122 Method (_S2D, 0, NotSerialized)
126 Method (_S3D, 0, NotSerialized)
132 /* PIIX3 ISA bridge */
134 Name (_ADR, 0x00010000)
136 /* PIIX PCI to ISA irq remapping */
137 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
139 /* Real-time clock */
142 Name (_HID, EisaId ("PNP0B00"))
143 Name (_CRS, ResourceTemplate ()
145 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
147 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
151 /* Keyboard seems to be important for WinXP install */
154 Name (_HID, EisaId ("PNP0303"))
155 Method (_STA, 0, NotSerialized)
160 Method (_CRS, 0, NotSerialized)
162 Name (TMP, ResourceTemplate ()
165 0x0060, // Address Range Minimum
166 0x0060, // Address Range Maximum
167 0x01, // Address Alignment
168 0x01, // Address Length
171 0x0064, // Address Range Minimum
172 0x0064, // Address Range Maximum
173 0x01, // Address Alignment
174 0x01, // Address Length
186 Name (_HID, EisaId ("PNP0F13"))
187 Method (_STA, 0, NotSerialized)
192 Method (_CRS, 0, NotSerialized)
194 Name (TMP, ResourceTemplate ()
202 /* PS/2 floppy controller */
205 Name (_HID, EisaId ("PNP0700"))
206 Method (_STA, 0, NotSerialized)
210 Method (_CRS, 0, NotSerialized)
212 Name (BUF0, ResourceTemplate ()
214 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
215 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
217 DMA (Compatibility, NotBusMaster, Transfer8) {2}
226 Name (_HID, EisaId ("PNP0400"))
227 Method (_STA, 0, NotSerialized)
229 Store (\_SB.PCI0.PX13.DRSA, Local0)
230 And (Local0, 0x80000000, Local0)
231 If (LEqual (Local0, 0))
240 Method (_CRS, 0, NotSerialized)
242 Name (BUF0, ResourceTemplate ()
244 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
254 Name (_HID, EisaId ("PNP0501"))
256 Method (_STA, 0, NotSerialized)
258 Store (\_SB.PCI0.PX13.DRSC, Local0)
259 And (Local0, 0x08000000, Local0)
260 If (LEqual (Local0, 0))
269 Method (_CRS, 0, NotSerialized)
271 Name (BUF0, ResourceTemplate ()
273 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
282 Name (_HID, EisaId ("PNP0501"))
284 Method (_STA, 0, NotSerialized)
286 Store (\_SB.PCI0.PX13.DRSC, Local0)
287 And (Local0, 0x80000000, Local0)
288 If (LEqual (Local0, 0))
297 Method (_CRS, 0, NotSerialized)
299 Name (BUF0, ResourceTemplate ()
301 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
311 Name (_ADR, 0x00010003)
313 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
314 Field (P13C, DWordAcc, NoLock, Preserve)
331 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
340 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
342 Name(_PRS, ResourceTemplate(){
343 IRQ (Level, ActiveLow, Shared)
344 {3,4,5,6,7,9,10,11,12}
346 Method (_STA, 0, NotSerialized)
349 If (And (0x80, PRQ0, Local1))
355 Method (_DIS, 0, NotSerialized)
357 Or (PRQ0, 0x80, PRQ0)
359 Method (_CRS, 0, NotSerialized)
361 Name (PRR0, ResourceTemplate ()
363 IRQ (Level, ActiveLow, Shared)
366 CreateWordField (PRR0, 0x01, TMP)
368 If (LLess (Local0, 0x80))
370 ShiftLeft (One, Local0, TMP)
378 Method (_SRS, 1, NotSerialized)
380 CreateWordField (Arg0, 0x01, TMP)
381 FindSetRightBit (TMP, Local0)
387 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
389 Name(_PRS, ResourceTemplate(){
390 IRQ (Level, ActiveLow, Shared)
391 {3,4,5,6,7,9,10,11,12}
393 Method (_STA, 0, NotSerialized)
396 If (And (0x80, PRQ1, Local1))
402 Method (_DIS, 0, NotSerialized)
404 Or (PRQ1, 0x80, PRQ1)
406 Method (_CRS, 0, NotSerialized)
408 Name (PRR0, ResourceTemplate ()
410 IRQ (Level, ActiveLow, Shared)
413 CreateWordField (PRR0, 0x01, TMP)
415 If (LLess (Local0, 0x80))
417 ShiftLeft (One, Local0, TMP)
425 Method (_SRS, 1, NotSerialized)
427 CreateWordField (Arg0, 0x01, TMP)
428 FindSetRightBit (TMP, Local0)
434 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
436 Name(_PRS, ResourceTemplate(){
437 IRQ (Level, ActiveLow, Shared)
438 {3,4,5,6,7,9,10,11,12}
440 Method (_STA, 0, NotSerialized)
443 If (And (0x80, PRQ2, Local1))
449 Method (_DIS, 0, NotSerialized)
451 Or (PRQ2, 0x80, PRQ2)
453 Method (_CRS, 0, NotSerialized)
455 Name (PRR0, ResourceTemplate ()
457 IRQ (Level, ActiveLow, Shared)
460 CreateWordField (PRR0, 0x01, TMP)
462 If (LLess (Local0, 0x80))
464 ShiftLeft (One, Local0, TMP)
472 Method (_SRS, 1, NotSerialized)
474 CreateWordField (Arg0, 0x01, TMP)
475 FindSetRightBit (TMP, Local0)
481 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
483 Name(_PRS, ResourceTemplate(){
484 IRQ (Level, ActiveLow, Shared)
485 {3,4,5,6,7,9,10,11,12}
487 Method (_STA, 0, NotSerialized)
490 If (And (0x80, PRQ3, Local1))
496 Method (_DIS, 0, NotSerialized)
498 Or (PRQ3, 0x80, PRQ3)
500 Method (_CRS, 0, NotSerialized)
502 Name (PRR0, ResourceTemplate ()
504 IRQ (Level, ActiveLow, Shared)
507 CreateWordField (PRR0, 0x01, TMP)
509 If (LLess (Local0, 0x80))
511 ShiftLeft (One, Local0, TMP)
519 Method (_SRS, 1, NotSerialized)
521 CreateWordField (Arg0, 0x01, TMP)
522 FindSetRightBit (TMP, Local0)
530 * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
531 * must match piix4 emulation.
533 Name (\_S3, Package (0x04)
535 0x01, /* PM1a_CNT.SLP_TYP */
536 0x01, /* PM1b_CNT.SLP_TYP */
540 Name (\_S4, Package (0x04)
542 Zero, /* PM1a_CNT.SLP_TYP */
543 Zero, /* PM1b_CNT.SLP_TYP */
547 Name (\_S5, Package (0x04)
549 Zero, /* PM1a_CNT.SLP_TYP */
550 Zero, /* PM1b_CNT.SLP_TYP */