2 * 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
24 "QEMUDSDT", // TABLE ID
30 /* CMOS memory access */
31 OperationRegion (CMS, SystemIO, 0x70, 0x02)
32 Field (CMS, ByteAcc, NoLock, Preserve)
37 Method (CMRD, 1, NotSerialized)
45 OperationRegion (DBG, SystemIO, 0xb044, 0x04)
46 Field (DBG, DWordAcc, NoLock, Preserve)
53 /* PCI Bus definition */
56 Name (_HID, EisaId ("PNP0A03"))
59 Name(_PRT, Package() {
60 /* PCI IRQ routing table, example from ACPI 2.0a specification,
62 /* Note: we provide the same info as the PCI routing
63 table of the Bochs BIOS */
66 Package() {0x0000ffff, 0, LNKD, 0},
67 Package() {0x0000ffff, 1, LNKA, 0},
68 Package() {0x0000ffff, 2, LNKB, 0},
69 Package() {0x0000ffff, 3, LNKC, 0},
72 Package() {0x0001ffff, 0, LNKA, 0},
73 Package() {0x0001ffff, 1, LNKB, 0},
74 Package() {0x0001ffff, 2, LNKC, 0},
75 Package() {0x0001ffff, 3, LNKD, 0},
78 Package() {0x0002ffff, 0, LNKB, 0},
79 Package() {0x0002ffff, 1, LNKC, 0},
80 Package() {0x0002ffff, 2, LNKD, 0},
81 Package() {0x0002ffff, 3, LNKA, 0},
84 Package() {0x0003ffff, 0, LNKC, 0},
85 Package() {0x0003ffff, 1, LNKD, 0},
86 Package() {0x0003ffff, 2, LNKA, 0},
87 Package() {0x0003ffff, 3, LNKB, 0},
90 Package() {0x0004ffff, 0, LNKD, 0},
91 Package() {0x0004ffff, 1, LNKA, 0},
92 Package() {0x0004ffff, 2, LNKB, 0},
93 Package() {0x0004ffff, 3, LNKC, 0},
96 Package() {0x0005ffff, 0, LNKA, 0},
97 Package() {0x0005ffff, 1, LNKB, 0},
98 Package() {0x0005ffff, 2, LNKC, 0},
99 Package() {0x0005ffff, 3, LNKD, 0},
102 Method (_CRS, 0, NotSerialized)
104 Name (MEMP, ResourceTemplate ()
106 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
107 0x0000, // Address Space Granularity
108 0x0000, // Address Range Minimum
109 0x00FF, // Address Range Maximum
110 0x0000, // Address Translation Offset
111 0x0100, // Address Length
114 0x0CF8, // Address Range Minimum
115 0x0CF8, // Address Range Maximum
116 0x01, // Address Alignment
117 0x08, // Address Length
119 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
120 0x0000, // Address Space Granularity
121 0x0000, // Address Range Minimum
122 0x0CF7, // Address Range Maximum
123 0x0000, // Address Translation Offset
124 0x0CF8, // Address Length
126 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
127 0x0000, // Address Space Granularity
128 0x0D00, // Address Range Minimum
129 0xFFFF, // Address Range Maximum
130 0x0000, // Address Translation Offset
131 0xF300, // Address Length
133 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
134 0x00000000, // Address Space Granularity
135 0x000A0000, // Address Range Minimum
136 0x000BFFFF, // Address Range Maximum
137 0x00000000, // Address Translation Offset
138 0x00020000, // Address Length
139 ,, , AddressRangeMemory, TypeStatic)
140 DWordMemory (ResourceProducer, PosDecode, MinNotFixed, MaxFixed, NonCacheable, ReadWrite,
141 0x00000000, // Address Space Granularity
142 0x00000000, // Address Range Minimum
143 0xFEBFFFFF, // Address Range Maximum
144 0x00000000, // Address Translation Offset
145 0x00000000, // Address Length
146 ,, MEMF, AddressRangeMemory, TypeStatic)
148 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MIN, PMIN)
149 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MAX, PMAX)
150 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._LEN, PLEN)
151 /* compute available RAM */
152 Add(CMRD(0x34), ShiftLeft(CMRD(0x35), 8), Local0)
153 ShiftLeft(Local0, 16, Local0)
154 Add(Local0, 0x1000000, Local0)
155 /* update field of last region */
157 Subtract (PMAX, PMIN, PLEN)
166 /* PIIX3 ISA bridge */
168 Name (_ADR, 0x00010000)
170 /* PIIX PCI to ISA irq remapping */
171 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
174 /* Keyboard seems to be important for WinXP install */
177 Name (_HID, EisaId ("PNP0303"))
178 Method (_STA, 0, NotSerialized)
183 Method (_CRS, 0, NotSerialized)
185 Name (TMP, ResourceTemplate ()
188 0x0060, // Address Range Minimum
189 0x0060, // Address Range Maximum
190 0x01, // Address Alignment
191 0x01, // Address Length
194 0x0064, // Address Range Minimum
195 0x0064, // Address Range Maximum
196 0x01, // Address Alignment
197 0x01, // Address Length
209 Name (_HID, EisaId ("PNP0F13"))
210 Method (_STA, 0, NotSerialized)
215 Method (_CRS, 0, NotSerialized)
217 Name (TMP, ResourceTemplate ()
225 /* PS/2 floppy controller */
228 Name (_HID, EisaId ("PNP0700"))
229 Method (_STA, 0, NotSerialized)
233 Method (_CRS, 0, NotSerialized)
235 Name (BUF0, ResourceTemplate ()
237 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
238 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
240 DMA (Compatibility, NotBusMaster, Transfer8) {2}
249 Name (_HID, EisaId ("PNP0400"))
250 Method (_STA, 0, NotSerialized)
252 Store (\_SB.PCI0.PX13.DRSA, Local0)
253 And (Local0, 0x80000000, Local0)
254 If (LEqual (Local0, 0))
263 Method (_CRS, 0, NotSerialized)
265 Name (BUF0, ResourceTemplate ()
267 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
277 Name (_HID, EisaId ("PNP0501"))
279 Method (_STA, 0, NotSerialized)
281 Store (\_SB.PCI0.PX13.DRSC, Local0)
282 And (Local0, 0x08000000, Local0)
283 If (LEqual (Local0, 0))
292 Method (_CRS, 0, NotSerialized)
294 Name (BUF0, ResourceTemplate ()
296 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
305 Name (_HID, EisaId ("PNP0501"))
307 Method (_STA, 0, NotSerialized)
309 Store (\_SB.PCI0.PX13.DRSC, Local0)
310 And (Local0, 0x80000000, Local0)
311 If (LEqual (Local0, 0))
320 Method (_CRS, 0, NotSerialized)
322 Name (BUF0, ResourceTemplate ()
324 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
334 Name (_ADR, 0x00010003)
336 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
337 Field (P13C, DWordAcc, NoLock, Preserve)
354 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
363 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
365 Name(_PRS, ResourceTemplate(){
366 IRQ (Level, ActiveLow, Shared)
367 {3,4,5,6,7,9,10,11,12}
369 Method (_STA, 0, NotSerialized)
372 If (And (0x80, PRQ0, Local1))
378 Method (_DIS, 0, NotSerialized)
380 Or (PRQ0, 0x80, PRQ0)
382 Method (_CRS, 0, NotSerialized)
384 Name (PRR0, ResourceTemplate ()
386 IRQ (Level, ActiveLow, Shared)
389 CreateWordField (PRR0, 0x01, TMP)
391 If (LLess (Local0, 0x80))
393 ShiftLeft (One, Local0, TMP)
401 Method (_SRS, 1, NotSerialized)
403 CreateWordField (Arg0, 0x01, TMP)
404 FindSetRightBit (TMP, Local0)
410 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
412 Name(_PRS, ResourceTemplate(){
413 IRQ (Level, ActiveLow, Shared)
414 {3,4,5,6,7,9,10,11,12}
416 Method (_STA, 0, NotSerialized)
419 If (And (0x80, PRQ1, Local1))
425 Method (_DIS, 0, NotSerialized)
427 Or (PRQ1, 0x80, PRQ1)
429 Method (_CRS, 0, NotSerialized)
431 Name (PRR0, ResourceTemplate ()
433 IRQ (Level, ActiveLow, Shared)
436 CreateWordField (PRR0, 0x01, TMP)
438 If (LLess (Local0, 0x80))
440 ShiftLeft (One, Local0, TMP)
448 Method (_SRS, 1, NotSerialized)
450 CreateWordField (Arg0, 0x01, TMP)
451 FindSetRightBit (TMP, Local0)
457 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
459 Name(_PRS, ResourceTemplate(){
460 IRQ (Level, ActiveLow, Shared)
461 {3,4,5,6,7,9,10,11,12}
463 Method (_STA, 0, NotSerialized)
466 If (And (0x80, PRQ2, Local1))
472 Method (_DIS, 0, NotSerialized)
474 Or (PRQ2, 0x80, PRQ2)
476 Method (_CRS, 0, NotSerialized)
478 Name (PRR0, ResourceTemplate ()
480 IRQ (Level, ActiveLow, Shared)
483 CreateWordField (PRR0, 0x01, TMP)
485 If (LLess (Local0, 0x80))
487 ShiftLeft (One, Local0, TMP)
495 Method (_SRS, 1, NotSerialized)
497 CreateWordField (Arg0, 0x01, TMP)
498 FindSetRightBit (TMP, Local0)
504 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
506 Name(_PRS, ResourceTemplate(){
507 IRQ (Level, ActiveLow, Shared)
508 {3,4,5,6,7,9,10,11,12}
510 Method (_STA, 0, NotSerialized)
513 If (And (0x80, PRQ3, Local1))
519 Method (_DIS, 0, NotSerialized)
521 Or (PRQ3, 0x80, PRQ3)
523 Method (_CRS, 0, NotSerialized)
525 Name (PRR0, ResourceTemplate ()
527 IRQ (Level, ActiveLow, Shared)
530 CreateWordField (PRR0, 0x01, TMP)
532 If (LLess (Local0, 0x80))
534 ShiftLeft (One, Local0, TMP)
542 Method (_SRS, 1, NotSerialized)
544 CreateWordField (Arg0, 0x01, TMP)
545 FindSetRightBit (TMP, Local0)
552 /* S5 = power off state */
553 Name (_S5, Package (4) {
554 0x00, // PM1a_CNT.SLP_TYP
555 0x00, // PM2a_CNT.SLP_TYP