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)
61 Package() { 0x0001ffff, 0, 0, 9 },
62 Package() { 0x0001ffff, 1, LNKB, 0 },
63 Package() { 0x0001ffff, 2, LNKC, 0 },
64 Package() { 0x0001ffff, 3, LNKD, 0 },
97 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
98 Field (PCST, DWordAcc, NoLock, WriteAsZeros)
104 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
105 Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
110 #define hotplug_slot(name, nr) \
112 Name (_ADR, nr##0000) \
114 Store(ShiftLeft(1, nr), B0EJ) \
120 hotplug_slot(1, 0x0001)
121 hotplug_slot(2, 0x0002)
122 hotplug_slot(3, 0x0003)
123 hotplug_slot(4, 0x0004)
124 hotplug_slot(5, 0x0005)
125 hotplug_slot(6, 0x0006)
126 hotplug_slot(7, 0x0007)
127 hotplug_slot(8, 0x0008)
128 hotplug_slot(9, 0x0009)
129 hotplug_slot(10, 0x000a)
130 hotplug_slot(11, 0x000b)
131 hotplug_slot(12, 0x000c)
132 hotplug_slot(13, 0x000d)
133 hotplug_slot(14, 0x000e)
134 hotplug_slot(15, 0x000f)
135 hotplug_slot(16, 0x0010)
136 hotplug_slot(17, 0x0011)
137 hotplug_slot(18, 0x0012)
138 hotplug_slot(19, 0x0013)
139 hotplug_slot(20, 0x0014)
140 hotplug_slot(21, 0x0015)
141 hotplug_slot(22, 0x0016)
142 hotplug_slot(23, 0x0017)
143 hotplug_slot(24, 0x0018)
144 hotplug_slot(25, 0x0019)
145 hotplug_slot(26, 0x001a)
146 hotplug_slot(27, 0x001b)
147 hotplug_slot(28, 0x001c)
148 hotplug_slot(29, 0x001d)
149 hotplug_slot(30, 0x001e)
150 hotplug_slot(31, 0x001f)
152 Name (_CRS, ResourceTemplate ()
154 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
155 0x0000, // Address Space Granularity
156 0x0000, // Address Range Minimum
157 0x00FF, // Address Range Maximum
158 0x0000, // Address Translation Offset
159 0x0100, // Address Length
162 0x0CF8, // Address Range Minimum
163 0x0CF8, // Address Range Maximum
164 0x01, // Address Alignment
165 0x08, // Address Length
167 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
168 0x0000, // Address Space Granularity
169 0x0000, // Address Range Minimum
170 0x0CF7, // Address Range Maximum
171 0x0000, // Address Translation Offset
172 0x0CF8, // Address Length
174 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
175 0x0000, // Address Space Granularity
176 0x0D00, // Address Range Minimum
177 0xFFFF, // Address Range Maximum
178 0x0000, // Address Translation Offset
179 0xF300, // Address Length
181 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
182 0x00000000, // Address Space Granularity
183 0x000A0000, // Address Range Minimum
184 0x000BFFFF, // Address Range Maximum
185 0x00000000, // Address Translation Offset
186 0x00020000, // Address Length
187 ,, , AddressRangeMemory, TypeStatic)
188 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
189 0x00000000, // Address Space Granularity
190 0xE0000000, // Address Range Minimum
191 0xFEBFFFFF, // Address Range Maximum
192 0x00000000, // Address Translation Offset
193 0x1EC00000, // Address Length
194 ,, , AddressRangeMemory, TypeStatic)
199 Name(_HID, EISAID("PNP0103"))
201 Method (_STA, 0, NotSerialized) {
204 Name(_CRS, ResourceTemplate() {
206 ResourceConsumer, PosDecode, MinFixed, MaxFixed,
207 NonCacheable, ReadWrite,
212 0x00000400 /* 1K memory: FED00000 - FED003FF */
220 Name (_ADR, 0x00020000)
221 Method (_S1D, 0, NotSerialized)
225 Method (_S2D, 0, NotSerialized)
229 Method (_S3D, 0, NotSerialized)
235 /* PIIX3 ISA bridge */
237 Name (_ADR, 0x00010000)
239 /* PIIX PCI to ISA irq remapping */
240 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
242 /* Real-time clock */
245 Name (_HID, EisaId ("PNP0B00"))
246 Name (_CRS, ResourceTemplate ()
248 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
250 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
254 /* Keyboard seems to be important for WinXP install */
257 Name (_HID, EisaId ("PNP0303"))
258 Method (_STA, 0, NotSerialized)
263 Method (_CRS, 0, NotSerialized)
265 Name (TMP, ResourceTemplate ()
268 0x0060, // Address Range Minimum
269 0x0060, // Address Range Maximum
270 0x01, // Address Alignment
271 0x01, // Address Length
274 0x0064, // Address Range Minimum
275 0x0064, // Address Range Maximum
276 0x01, // Address Alignment
277 0x01, // Address Length
289 Name (_HID, EisaId ("PNP0F13"))
290 Method (_STA, 0, NotSerialized)
295 Method (_CRS, 0, NotSerialized)
297 Name (TMP, ResourceTemplate ()
305 /* PS/2 floppy controller */
308 Name (_HID, EisaId ("PNP0700"))
309 Method (_STA, 0, NotSerialized)
313 Method (_CRS, 0, NotSerialized)
315 Name (BUF0, ResourceTemplate ()
317 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
318 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
320 DMA (Compatibility, NotBusMaster, Transfer8) {2}
329 Name (_HID, EisaId ("PNP0400"))
330 Method (_STA, 0, NotSerialized)
332 Store (\_SB.PCI0.PX13.DRSA, Local0)
333 And (Local0, 0x80000000, Local0)
334 If (LEqual (Local0, 0))
343 Method (_CRS, 0, NotSerialized)
345 Name (BUF0, ResourceTemplate ()
347 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
357 Name (_HID, EisaId ("PNP0501"))
359 Method (_STA, 0, NotSerialized)
361 Store (\_SB.PCI0.PX13.DRSC, Local0)
362 And (Local0, 0x08000000, Local0)
363 If (LEqual (Local0, 0))
372 Method (_CRS, 0, NotSerialized)
374 Name (BUF0, ResourceTemplate ()
376 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
385 Name (_HID, EisaId ("PNP0501"))
387 Method (_STA, 0, NotSerialized)
389 Store (\_SB.PCI0.PX13.DRSC, Local0)
390 And (Local0, 0x80000000, Local0)
391 If (LEqual (Local0, 0))
400 Method (_CRS, 0, NotSerialized)
402 Name (BUF0, ResourceTemplate ()
404 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
414 Name (_ADR, 0x00010003)
416 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
417 Field (P13C, DWordAcc, NoLock, Preserve)
434 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
443 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
445 Name(_PRS, ResourceTemplate(){
446 Interrupt (, Level, ActiveHigh, Shared)
449 Method (_STA, 0, NotSerialized)
452 If (And (0x80, PRQ0, Local1))
458 Method (_DIS, 0, NotSerialized)
460 Or (PRQ0, 0x80, PRQ0)
462 Method (_CRS, 0, NotSerialized)
464 Name (PRR0, ResourceTemplate ()
466 Interrupt (, Level, ActiveHigh, Shared)
469 CreateDWordField (PRR0, 0x05, TMP)
471 If (LLess (Local0, 0x80))
481 Method (_SRS, 1, NotSerialized)
483 CreateDWordField (Arg0, 0x05, TMP)
488 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
490 Name(_PRS, ResourceTemplate(){
491 Interrupt (, Level, ActiveHigh, Shared)
494 Method (_STA, 0, NotSerialized)
497 If (And (0x80, PRQ1, Local1))
503 Method (_DIS, 0, NotSerialized)
505 Or (PRQ1, 0x80, PRQ1)
507 Method (_CRS, 0, NotSerialized)
509 Name (PRR0, ResourceTemplate ()
511 Interrupt (, Level, ActiveHigh, Shared)
514 CreateDWordField (PRR0, 0x05, TMP)
516 If (LLess (Local0, 0x80))
526 Method (_SRS, 1, NotSerialized)
528 CreateDWordField (Arg0, 0x05, TMP)
533 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
535 Name(_PRS, ResourceTemplate(){
536 Interrupt (, Level, ActiveHigh, Shared)
539 Method (_STA, 0, NotSerialized)
542 If (And (0x80, PRQ2, Local1))
548 Method (_DIS, 0, NotSerialized)
550 Or (PRQ2, 0x80, PRQ2)
552 Method (_CRS, 0, NotSerialized)
554 Name (PRR0, ResourceTemplate ()
556 Interrupt (, Level, ActiveHigh, Shared)
559 CreateDWordField (PRR0, 0x05, TMP)
561 If (LLess (Local0, 0x80))
571 Method (_SRS, 1, NotSerialized)
573 CreateDWordField (Arg0, 0x05, TMP)
578 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
580 Name(_PRS, ResourceTemplate(){
581 Interrupt (, Level, ActiveHigh, Shared)
584 Method (_STA, 0, NotSerialized)
587 If (And (0x80, PRQ3, Local1))
593 Method (_DIS, 0, NotSerialized)
595 Or (PRQ3, 0x80, PRQ3)
597 Method (_CRS, 0, NotSerialized)
599 Name (PRR0, ResourceTemplate ()
601 Interrupt (, Level, ActiveHigh, Shared)
604 CreateDWordField (PRR0, 0x05, TMP)
606 If (LLess (Local0, 0x80))
616 Method (_SRS, 1, NotSerialized)
618 CreateDWordField (Arg0, 0x05, TMP)
625 * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
626 * must match piix4 emulation.
628 Name (\_S3, Package (0x04)
630 0x01, /* PM1a_CNT.SLP_TYP */
631 0x01, /* PM1b_CNT.SLP_TYP */
635 Name (\_S4, Package (0x04)
637 Zero, /* PM1a_CNT.SLP_TYP */
638 Zero, /* PM1b_CNT.SLP_TYP */
642 Name (\_S5, Package (0x04)
644 Zero, /* PM1a_CNT.SLP_TYP */
645 Zero, /* PM1b_CNT.SLP_TYP */
652 Name(_HID, "ACPI0006")
658 #define gen_pci_hotplug(nr) \
659 If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) { \
660 Notify(\_SB.PCI0.S##nr, 1) \
662 If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) { \
663 Notify(\_SB.PCI0.S##nr, 3) \