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)
164 /* PIIX3 ISA bridge */
167 Name (_ADR, 0x00010000)
169 /* PIIX PCI to ISA irq remapping */
170 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
173 /* Keyboard seems to be important for WinXP install */
176 Name (_HID, EisaId ("PNP0303"))
177 Method (_STA, 0, NotSerialized)
182 Method (_CRS, 0, NotSerialized)
184 Name (TMP, ResourceTemplate ()
187 0x0060, // Address Range Minimum
188 0x0060, // Address Range Maximum
189 0x01, // Address Alignment
190 0x01, // Address Length
193 0x0064, // Address Range Minimum
194 0x0064, // Address Range Maximum
195 0x01, // Address Alignment
196 0x01, // Address Length
207 Name (_HID, EisaId ("PNP0F13"))
208 Method (_STA, 0, NotSerialized)
213 Method (_CRS, 0, NotSerialized)
215 Name (TMP, ResourceTemplate ()
227 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
236 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
238 Name(_PRS, ResourceTemplate(){
239 IRQ (Level, ActiveLow, Shared)
240 {3,4,5,6,7,9,10,11,12}
242 Method (_STA, 0, NotSerialized)
245 If (And (0x80, PRQ0, Local1))
251 Method (_DIS, 0, NotSerialized)
253 Or (PRQ0, 0x80, PRQ0)
255 Method (_CRS, 0, NotSerialized)
257 Name (PRR0, ResourceTemplate ()
259 IRQ (Level, ActiveLow, Shared)
262 CreateWordField (PRR0, 0x01, TMP)
264 If (LLess (Local0, 0x80))
266 ShiftLeft (One, Local0, TMP)
274 Method (_SRS, 1, NotSerialized)
276 CreateWordField (Arg0, 0x01, TMP)
277 FindSetRightBit (TMP, Local0)
283 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
285 Name(_PRS, ResourceTemplate(){
286 IRQ (Level, ActiveLow, Shared)
287 {3,4,5,6,7,9,10,11,12}
289 Method (_STA, 0, NotSerialized)
292 If (And (0x80, PRQ1, Local1))
298 Method (_DIS, 0, NotSerialized)
300 Or (PRQ1, 0x80, PRQ1)
302 Method (_CRS, 0, NotSerialized)
304 Name (PRR0, ResourceTemplate ()
306 IRQ (Level, ActiveLow, Shared)
309 CreateWordField (PRR0, 0x01, TMP)
311 If (LLess (Local0, 0x80))
313 ShiftLeft (One, Local0, TMP)
321 Method (_SRS, 1, NotSerialized)
323 CreateWordField (Arg0, 0x01, TMP)
324 FindSetRightBit (TMP, Local0)
330 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
332 Name(_PRS, ResourceTemplate(){
333 IRQ (Level, ActiveLow, Shared)
334 {3,4,5,6,7,9,10,11,12}
336 Method (_STA, 0, NotSerialized)
339 If (And (0x80, PRQ2, Local1))
345 Method (_DIS, 0, NotSerialized)
347 Or (PRQ2, 0x80, PRQ2)
349 Method (_CRS, 0, NotSerialized)
351 Name (PRR0, ResourceTemplate ()
353 IRQ (Level, ActiveLow, Shared)
356 CreateWordField (PRR0, 0x01, TMP)
358 If (LLess (Local0, 0x80))
360 ShiftLeft (One, Local0, TMP)
368 Method (_SRS, 1, NotSerialized)
370 CreateWordField (Arg0, 0x01, TMP)
371 FindSetRightBit (TMP, Local0)
377 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
379 Name(_PRS, ResourceTemplate(){
380 IRQ (Level, ActiveLow, Shared)
381 {3,4,5,6,7,9,10,11,12}
383 Method (_STA, 0, NotSerialized)
386 If (And (0x80, PRQ3, Local1))
392 Method (_DIS, 0, NotSerialized)
394 Or (PRQ3, 0x80, PRQ3)
396 Method (_CRS, 0, NotSerialized)
398 Name (PRR0, ResourceTemplate ()
400 IRQ (Level, ActiveLow, Shared)
403 CreateWordField (PRR0, 0x01, TMP)
405 If (LLess (Local0, 0x80))
407 ShiftLeft (One, Local0, TMP)
415 Method (_SRS, 1, NotSerialized)
417 CreateWordField (Arg0, 0x01, TMP)
418 FindSetRightBit (TMP, Local0)
425 /* S5 = power off state */
426 Name (_S5, Package (4) {
427 0x00, // PM1a_CNT.SLP_TYP
428 0x00, // PM2a_CNT.SLP_TYP