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)
94 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
95 Field (PCST, DWordAcc, NoLock, WriteAsZeros)
101 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
102 Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
107 #define hotplug_slot(name, nr) \
109 Name (_ADR, nr##0000) \
111 Store(ShiftLeft(1, nr), B0EJ) \
117 hotplug_slot(1, 0x0001)
118 hotplug_slot(2, 0x0002)
119 hotplug_slot(3, 0x0003)
120 hotplug_slot(4, 0x0004)
121 hotplug_slot(5, 0x0005)
122 hotplug_slot(6, 0x0006)
123 hotplug_slot(7, 0x0007)
124 hotplug_slot(8, 0x0008)
125 hotplug_slot(9, 0x0009)
126 hotplug_slot(10, 0x000a)
127 hotplug_slot(11, 0x000b)
128 hotplug_slot(12, 0x000c)
129 hotplug_slot(13, 0x000d)
130 hotplug_slot(14, 0x000e)
131 hotplug_slot(15, 0x000f)
132 hotplug_slot(16, 0x0010)
133 hotplug_slot(17, 0x0011)
134 hotplug_slot(18, 0x0012)
135 hotplug_slot(19, 0x0013)
136 hotplug_slot(20, 0x0014)
137 hotplug_slot(21, 0x0015)
138 hotplug_slot(22, 0x0016)
139 hotplug_slot(23, 0x0017)
140 hotplug_slot(24, 0x0018)
141 hotplug_slot(25, 0x0019)
142 hotplug_slot(26, 0x001a)
143 hotplug_slot(27, 0x001b)
144 hotplug_slot(28, 0x001c)
145 hotplug_slot(29, 0x001d)
146 hotplug_slot(30, 0x001e)
147 hotplug_slot(31, 0x001f)
149 Name (_CRS, ResourceTemplate ()
151 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
152 0x0000, // Address Space Granularity
153 0x0000, // Address Range Minimum
154 0x00FF, // Address Range Maximum
155 0x0000, // Address Translation Offset
156 0x0100, // Address Length
159 0x0CF8, // Address Range Minimum
160 0x0CF8, // Address Range Maximum
161 0x01, // Address Alignment
162 0x08, // Address Length
164 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
165 0x0000, // Address Space Granularity
166 0x0000, // Address Range Minimum
167 0x0CF7, // Address Range Maximum
168 0x0000, // Address Translation Offset
169 0x0CF8, // Address Length
171 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
172 0x0000, // Address Space Granularity
173 0x0D00, // Address Range Minimum
174 0xFFFF, // Address Range Maximum
175 0x0000, // Address Translation Offset
176 0xF300, // Address Length
178 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
179 0x00000000, // Address Space Granularity
180 0x000A0000, // Address Range Minimum
181 0x000BFFFF, // Address Range Maximum
182 0x00000000, // Address Translation Offset
183 0x00020000, // Address Length
184 ,, , AddressRangeMemory, TypeStatic)
185 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
186 0x00000000, // Address Space Granularity
187 0xE0000000, // Address Range Minimum
188 0xFEBFFFFF, // Address Range Maximum
189 0x00000000, // Address Translation Offset
190 0x1EC00000, // Address Length
191 ,, , AddressRangeMemory, TypeStatic)
196 Name(_HID, EISAID("PNP0103"))
198 Method (_STA, 0, NotSerialized) {
201 Name(_CRS, ResourceTemplate() {
203 ResourceConsumer, PosDecode, MinFixed, MaxFixed,
204 NonCacheable, ReadWrite,
209 0x00000400 /* 1K memory: FED00000 - FED003FF */
217 Name (_ADR, 0x00020000)
218 Method (_S1D, 0, NotSerialized)
222 Method (_S2D, 0, NotSerialized)
226 Method (_S3D, 0, NotSerialized)
232 /* PIIX3 ISA bridge */
234 Name (_ADR, 0x00010000)
236 /* PIIX PCI to ISA irq remapping */
237 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
239 /* Real-time clock */
242 Name (_HID, EisaId ("PNP0B00"))
243 Name (_CRS, ResourceTemplate ()
245 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
247 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
251 /* Keyboard seems to be important for WinXP install */
254 Name (_HID, EisaId ("PNP0303"))
255 Method (_STA, 0, NotSerialized)
260 Method (_CRS, 0, NotSerialized)
262 Name (TMP, ResourceTemplate ()
265 0x0060, // Address Range Minimum
266 0x0060, // Address Range Maximum
267 0x01, // Address Alignment
268 0x01, // Address Length
271 0x0064, // Address Range Minimum
272 0x0064, // Address Range Maximum
273 0x01, // Address Alignment
274 0x01, // Address Length
286 Name (_HID, EisaId ("PNP0F13"))
287 Method (_STA, 0, NotSerialized)
292 Method (_CRS, 0, NotSerialized)
294 Name (TMP, ResourceTemplate ()
302 /* PS/2 floppy controller */
305 Name (_HID, EisaId ("PNP0700"))
306 Method (_STA, 0, NotSerialized)
310 Method (_CRS, 0, NotSerialized)
312 Name (BUF0, ResourceTemplate ()
314 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
315 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
317 DMA (Compatibility, NotBusMaster, Transfer8) {2}
326 Name (_HID, EisaId ("PNP0400"))
327 Method (_STA, 0, NotSerialized)
329 Store (\_SB.PCI0.PX13.DRSA, Local0)
330 And (Local0, 0x80000000, Local0)
331 If (LEqual (Local0, 0))
340 Method (_CRS, 0, NotSerialized)
342 Name (BUF0, ResourceTemplate ()
344 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
354 Name (_HID, EisaId ("PNP0501"))
356 Method (_STA, 0, NotSerialized)
358 Store (\_SB.PCI0.PX13.DRSC, Local0)
359 And (Local0, 0x08000000, Local0)
360 If (LEqual (Local0, 0))
369 Method (_CRS, 0, NotSerialized)
371 Name (BUF0, ResourceTemplate ()
373 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
382 Name (_HID, EisaId ("PNP0501"))
384 Method (_STA, 0, NotSerialized)
386 Store (\_SB.PCI0.PX13.DRSC, Local0)
387 And (Local0, 0x80000000, Local0)
388 If (LEqual (Local0, 0))
397 Method (_CRS, 0, NotSerialized)
399 Name (BUF0, ResourceTemplate ()
401 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
411 Name (_ADR, 0x00010003)
413 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
414 Field (P13C, DWordAcc, NoLock, Preserve)
431 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
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, PRQ0, Local1))
455 Method (_DIS, 0, NotSerialized)
457 Or (PRQ0, 0x80, PRQ0)
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, PRQ1, Local1))
500 Method (_DIS, 0, NotSerialized)
502 Or (PRQ1, 0x80, PRQ1)
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, PRQ2, Local1))
545 Method (_DIS, 0, NotSerialized)
547 Or (PRQ2, 0x80, PRQ2)
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)
575 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
577 Name(_PRS, ResourceTemplate(){
578 Interrupt (, Level, ActiveHigh, Shared)
581 Method (_STA, 0, NotSerialized)
584 If (And (0x80, PRQ3, Local1))
590 Method (_DIS, 0, NotSerialized)
592 Or (PRQ3, 0x80, PRQ3)
594 Method (_CRS, 0, NotSerialized)
596 Name (PRR0, ResourceTemplate ()
598 Interrupt (, Level, ActiveHigh, Shared)
601 CreateDWordField (PRR0, 0x05, TMP)
603 If (LLess (Local0, 0x80))
613 Method (_SRS, 1, NotSerialized)
615 CreateDWordField (Arg0, 0x05, TMP)
622 * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
623 * must match piix4 emulation.
625 Name (\_S3, Package (0x04)
627 0x01, /* PM1a_CNT.SLP_TYP */
628 0x01, /* PM1b_CNT.SLP_TYP */
632 Name (\_S4, Package (0x04)
634 Zero, /* PM1a_CNT.SLP_TYP */
635 Zero, /* PM1b_CNT.SLP_TYP */
639 Name (\_S5, Package (0x04)
641 Zero, /* PM1a_CNT.SLP_TYP */
642 Zero, /* PM1b_CNT.SLP_TYP */
649 Name(_HID, "ACPI0006")
655 #define gen_pci_hotplug(nr) \
656 If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) { \
657 Notify(\_SB.PCI0.S##nr, 1) \
659 If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) { \
660 Notify(\_SB.PCI0.S##nr, 3) \