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 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
69 Field (PCST, DWordAcc, NoLock, WriteAsZeros)
75 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
76 Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
81 #define hotplug_slot(name, nr) \
83 Name (_ADR, nr##0000) \
85 Store(ShiftLeft(1, nr), B0EJ) \
91 hotplug_slot(1, 0x0001)
92 hotplug_slot(2, 0x0002)
93 hotplug_slot(3, 0x0003)
94 hotplug_slot(4, 0x0004)
95 hotplug_slot(5, 0x0005)
96 hotplug_slot(6, 0x0006)
97 hotplug_slot(7, 0x0007)
98 hotplug_slot(8, 0x0008)
99 hotplug_slot(9, 0x0009)
100 hotplug_slot(10, 0x000a)
101 hotplug_slot(11, 0x000b)
102 hotplug_slot(12, 0x000c)
103 hotplug_slot(13, 0x000d)
104 hotplug_slot(14, 0x000e)
105 hotplug_slot(15, 0x000f)
106 hotplug_slot(16, 0x0010)
107 hotplug_slot(17, 0x0011)
108 hotplug_slot(18, 0x0012)
109 hotplug_slot(19, 0x0013)
110 hotplug_slot(20, 0x0014)
111 hotplug_slot(21, 0x0015)
112 hotplug_slot(22, 0x0016)
113 hotplug_slot(23, 0x0017)
114 hotplug_slot(24, 0x0018)
115 hotplug_slot(25, 0x0019)
116 hotplug_slot(26, 0x001a)
117 hotplug_slot(27, 0x001b)
118 hotplug_slot(28, 0x001c)
119 hotplug_slot(29, 0x001d)
120 hotplug_slot(30, 0x001e)
121 hotplug_slot(31, 0x001f)
123 Name (_CRS, ResourceTemplate ()
125 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
126 0x0000, // Address Space Granularity
127 0x0000, // Address Range Minimum
128 0x00FF, // Address Range Maximum
129 0x0000, // Address Translation Offset
130 0x0100, // Address Length
133 0x0CF8, // Address Range Minimum
134 0x0CF8, // Address Range Maximum
135 0x01, // Address Alignment
136 0x08, // Address Length
138 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
139 0x0000, // Address Space Granularity
140 0x0000, // Address Range Minimum
141 0x0CF7, // Address Range Maximum
142 0x0000, // Address Translation Offset
143 0x0CF8, // Address Length
145 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
146 0x0000, // Address Space Granularity
147 0x0D00, // Address Range Minimum
148 0xFFFF, // Address Range Maximum
149 0x0000, // Address Translation Offset
150 0xF300, // Address Length
152 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
153 0x00000000, // Address Space Granularity
154 0x000A0000, // Address Range Minimum
155 0x000BFFFF, // Address Range Maximum
156 0x00000000, // Address Translation Offset
157 0x00020000, // Address Length
158 ,, , AddressRangeMemory, TypeStatic)
159 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
160 0x00000000, // Address Space Granularity
161 0xE0000000, // Address Range Minimum
162 0xFEBFFFFF, // Address Range Maximum
163 0x00000000, // Address Translation Offset
164 0x1EC00000, // Address Length
165 ,, , AddressRangeMemory, TypeStatic)
172 Name (_ADR, 0x00020000)
173 Method (_S1D, 0, NotSerialized)
177 Method (_S2D, 0, NotSerialized)
181 Method (_S3D, 0, NotSerialized)
187 /* PIIX3 ISA bridge */
189 Name (_ADR, 0x00010000)
191 /* PIIX PCI to ISA irq remapping */
192 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
194 /* Real-time clock */
197 Name (_HID, EisaId ("PNP0B00"))
198 Name (_CRS, ResourceTemplate ()
200 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
202 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
206 /* Keyboard seems to be important for WinXP install */
209 Name (_HID, EisaId ("PNP0303"))
210 Method (_STA, 0, NotSerialized)
215 Method (_CRS, 0, NotSerialized)
217 Name (TMP, ResourceTemplate ()
220 0x0060, // Address Range Minimum
221 0x0060, // Address Range Maximum
222 0x01, // Address Alignment
223 0x01, // Address Length
226 0x0064, // Address Range Minimum
227 0x0064, // Address Range Maximum
228 0x01, // Address Alignment
229 0x01, // Address Length
241 Name (_HID, EisaId ("PNP0F13"))
242 Method (_STA, 0, NotSerialized)
247 Method (_CRS, 0, NotSerialized)
249 Name (TMP, ResourceTemplate ()
257 /* PS/2 floppy controller */
260 Name (_HID, EisaId ("PNP0700"))
261 Method (_STA, 0, NotSerialized)
265 Method (_CRS, 0, NotSerialized)
267 Name (BUF0, ResourceTemplate ()
269 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
270 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
272 DMA (Compatibility, NotBusMaster, Transfer8) {2}
281 Name (_HID, EisaId ("PNP0400"))
282 Method (_STA, 0, NotSerialized)
284 Store (\_SB.PCI0.PX13.DRSA, Local0)
285 And (Local0, 0x80000000, Local0)
286 If (LEqual (Local0, 0))
295 Method (_CRS, 0, NotSerialized)
297 Name (BUF0, ResourceTemplate ()
299 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
309 Name (_HID, EisaId ("PNP0501"))
311 Method (_STA, 0, NotSerialized)
313 Store (\_SB.PCI0.PX13.DRSC, Local0)
314 And (Local0, 0x08000000, Local0)
315 If (LEqual (Local0, 0))
324 Method (_CRS, 0, NotSerialized)
326 Name (BUF0, ResourceTemplate ()
328 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
337 Name (_HID, EisaId ("PNP0501"))
339 Method (_STA, 0, NotSerialized)
341 Store (\_SB.PCI0.PX13.DRSC, Local0)
342 And (Local0, 0x80000000, Local0)
343 If (LEqual (Local0, 0))
352 Method (_CRS, 0, NotSerialized)
354 Name (BUF0, ResourceTemplate ()
356 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
366 Name (_ADR, 0x00010003)
368 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
369 Field (P13C, DWordAcc, NoLock, Preserve)
386 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
395 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
397 Name(_PRS, ResourceTemplate(){
398 Interrupt (, Level, ActiveHigh, Shared)
401 Method (_STA, 0, NotSerialized)
404 If (And (0x80, PRQ0, Local1))
410 Method (_DIS, 0, NotSerialized)
412 Or (PRQ0, 0x80, PRQ0)
414 Method (_CRS, 0, NotSerialized)
416 Name (PRR0, ResourceTemplate ()
418 Interrupt (, Level, ActiveHigh, Shared)
421 CreateDWordField (PRR0, 0x05, TMP)
423 If (LLess (Local0, 0x80))
433 Method (_SRS, 1, NotSerialized)
435 CreateDWordField (Arg0, 0x05, TMP)
440 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
442 Name(_PRS, ResourceTemplate(){
443 Interrupt (, Level, ActiveHigh, Shared)
446 Method (_STA, 0, NotSerialized)
449 If (And (0x80, PRQ1, Local1))
455 Method (_DIS, 0, NotSerialized)
457 Or (PRQ1, 0x80, PRQ1)
459 Method (_CRS, 0, NotSerialized)
461 Name (PRR0, ResourceTemplate ()
463 Interrupt (, Level, ActiveHigh, Shared)
466 CreateDWordField (PRR0, 0x05, TMP)
468 If (LLess (Local0, 0x80))
478 Method (_SRS, 1, NotSerialized)
480 CreateDWordField (Arg0, 0x05, TMP)
485 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
487 Name(_PRS, ResourceTemplate(){
488 Interrupt (, Level, ActiveHigh, Shared)
491 Method (_STA, 0, NotSerialized)
494 If (And (0x80, PRQ2, Local1))
500 Method (_DIS, 0, NotSerialized)
502 Or (PRQ2, 0x80, PRQ2)
504 Method (_CRS, 0, NotSerialized)
506 Name (PRR0, ResourceTemplate ()
508 Interrupt (, Level, ActiveHigh, Shared)
511 CreateDWordField (PRR0, 0x05, TMP)
513 If (LLess (Local0, 0x80))
523 Method (_SRS, 1, NotSerialized)
525 CreateDWordField (Arg0, 0x05, TMP)
530 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
532 Name(_PRS, ResourceTemplate(){
533 Interrupt (, Level, ActiveHigh, Shared)
536 Method (_STA, 0, NotSerialized)
539 If (And (0x80, PRQ3, Local1))
545 Method (_DIS, 0, NotSerialized)
547 Or (PRQ3, 0x80, PRQ3)
549 Method (_CRS, 0, NotSerialized)
551 Name (PRR0, ResourceTemplate ()
553 Interrupt (, Level, ActiveHigh, Shared)
556 CreateDWordField (PRR0, 0x05, TMP)
558 If (LLess (Local0, 0x80))
568 Method (_SRS, 1, NotSerialized)
570 CreateDWordField (Arg0, 0x05, TMP)
577 * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
578 * must match piix4 emulation.
580 Name (\_S3, Package (0x04)
582 0x01, /* PM1a_CNT.SLP_TYP */
583 0x01, /* PM1b_CNT.SLP_TYP */
587 Name (\_S4, Package (0x04)
589 Zero, /* PM1a_CNT.SLP_TYP */
590 Zero, /* PM1b_CNT.SLP_TYP */
594 Name (\_S5, Package (0x04)
596 Zero, /* PM1a_CNT.SLP_TYP */
597 Zero, /* PM1b_CNT.SLP_TYP */
604 Name(_HID, "ACPI0006")
610 #define gen_pci_hotplug(nr) \
611 If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) { \
612 Notify(\_SB.PCI0.S##nr, 1) \
614 If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) { \
615 Notify(\_SB.PCI0.S##nr, 3) \