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
30 OperationRegion( PRST, SystemIO, 0xaf00, 0x02)
31 Field (PRST, ByteAcc, NoLock, WriteAsZeros)
37 Processor (CPU0, 0x00, 0x0000b010, 0x06) {Method (_STA) { Return(0xF)}}
38 Processor (CPU1, 0x01, 0x0000b010, 0x06) {
39 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x01, 0x01, 0x1, 0x0, 0x0, 0x0})
41 If (And(\_PR.PRU, 0x2)) { Return(TMP) }
48 Processor (CPU2, 0x02, 0x0000b010, 0x06) {
49 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x02, 0x02, 0x1, 0x0, 0x0, 0x0})
51 If (And(\_PR.PRU, 0x4)) { Return(TMP) }
58 Processor (CPU3, 0x03, 0x0000b010, 0x06) {
59 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x03, 0x03, 0x1, 0x0, 0x0, 0x0})
61 If (And(\_PR.PRU, 0x8)) { Return(TMP) }
68 Processor (CPU4, 0x04, 0x0000b010, 0x06) {
69 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x04, 0x04, 0x1, 0x0, 0x0, 0x0})
71 If (And(\_PR.PRU, 0x10)) { Return(TMP) }
78 Processor (CPU5, 0x05, 0x0000b010, 0x06) {
79 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x05, 0x05, 0x1, 0x0, 0x0, 0x0})
81 If (And(\_PR.PRU, 0x20)) { Return(TMP) }
88 Processor (CPU6, 0x06, 0x0000b010, 0x06) {
89 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x06, 0x06, 0x1, 0x0, 0x0, 0x0})
91 If (And(\_PR.PRU, 0x40)) { Return(TMP) }
98 Processor (CPU7, 0x07, 0x0000b010, 0x06) {
99 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x07, 0x07, 0x1, 0x0, 0x0, 0x0})
101 If (And(\_PR.PRU, 0x80)) { Return(TMP) }
108 Processor (CPU8, 0x08, 0x0000b010, 0x06) {
109 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x08, 0x08, 0x1, 0x0, 0x0, 0x0})
111 If (And(\_PR.PRU, 0x100)) { Return(TMP) }
118 Processor (CPU9, 0x09, 0x0000b010, 0x06) {
119 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x09, 0x09, 0x1, 0x0, 0x0, 0x0})
121 If (And(\_PR.PRU, 0x200)) { Return(TMP) }
128 Processor (CPUA, 0x0a, 0x0000b010, 0x06) {
129 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x0A, 0x0A, 0x1, 0x0, 0x0, 0x0})
131 If (And(\_PR.PRU, 0x400)) { Return(TMP) }
138 Processor (CPUB, 0x0b, 0x0000b010, 0x06) {
139 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x0B, 0x0B, 0x1, 0x0, 0x0, 0x0})
141 If (And(\_PR.PRU, 0x800)) { Return(TMP) }
148 Processor (CPUC, 0x0c, 0x0000b010, 0x06) {
149 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x0C, 0x0C, 0x1, 0x0, 0x0, 0x0})
151 If (And(\_PR.PRU, 0x1000)) { Return(TMP) }
158 Processor (CPUD, 0x0d, 0x0000b010, 0x06) {
159 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x0D, 0x0D, 0x1, 0x0, 0x0, 0x0})
161 If (And(\_PR.PRU, 0x2000)) { Return(TMP) }
168 Processor (CPUE, 0x0e, 0x0000b010, 0x06) {
169 Name (TMP, Buffer(0x8) {0x0, 0x8, 0x0E, 0x0E, 0x1, 0x0, 0x0, 0x0})
171 If (And(\_PR.PRU, 0x4000)) { Return(TMP) }
182 /* CMOS memory access */
183 OperationRegion (CMS, SystemIO, 0x70, 0x02)
184 Field (CMS, ByteAcc, NoLock, Preserve)
189 Method (CMRD, 1, NotSerialized)
197 OperationRegion (DBG, SystemIO, 0xb044, 0x04)
198 Field (DBG, DWordAcc, NoLock, Preserve)
205 /* PCI Bus definition */
208 Name (_HID, EisaId ("PNP0A03"))
211 Name(_PRT, Package() {
212 /* PCI IRQ routing table, example from ACPI 2.0a specification,
214 /* Note: we provide the same info as the PCI routing
215 table of the Bochs BIOS */
218 Package() {0x0000ffff, 0, LNKD, 0},
219 Package() {0x0000ffff, 1, LNKA, 0},
220 Package() {0x0000ffff, 2, LNKB, 0},
221 Package() {0x0000ffff, 3, LNKC, 0},
224 Package() {0x0001ffff, 0, LNKA, 0},
225 Package() {0x0001ffff, 1, LNKB, 0},
226 Package() {0x0001ffff, 2, LNKC, 0},
227 Package() {0x0001ffff, 3, LNKD, 0},
230 Package() {0x0002ffff, 0, LNKB, 0},
231 Package() {0x0002ffff, 1, LNKC, 0},
232 Package() {0x0002ffff, 2, LNKD, 0},
233 Package() {0x0002ffff, 3, LNKA, 0},
236 Package() {0x0003ffff, 0, LNKC, 0},
237 Package() {0x0003ffff, 1, LNKD, 0},
238 Package() {0x0003ffff, 2, LNKA, 0},
239 Package() {0x0003ffff, 3, LNKB, 0},
242 Package() {0x0004ffff, 0, LNKD, 0},
243 Package() {0x0004ffff, 1, LNKA, 0},
244 Package() {0x0004ffff, 2, LNKB, 0},
245 Package() {0x0004ffff, 3, LNKC, 0},
248 Package() {0x0005ffff, 0, LNKA, 0},
249 Package() {0x0005ffff, 1, LNKB, 0},
250 Package() {0x0005ffff, 2, LNKC, 0},
251 Package() {0x0005ffff, 3, LNKD, 0},
254 Method (_CRS, 0, NotSerialized)
256 Name (MEMP, ResourceTemplate ()
258 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
259 0x0000, // Address Space Granularity
260 0x0000, // Address Range Minimum
261 0x00FF, // Address Range Maximum
262 0x0000, // Address Translation Offset
263 0x0100, // Address Length
266 0x0CF8, // Address Range Minimum
267 0x0CF8, // Address Range Maximum
268 0x01, // Address Alignment
269 0x08, // Address Length
271 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
272 0x0000, // Address Space Granularity
273 0x0000, // Address Range Minimum
274 0x0CF7, // Address Range Maximum
275 0x0000, // Address Translation Offset
276 0x0CF8, // Address Length
278 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
279 0x0000, // Address Space Granularity
280 0x0D00, // Address Range Minimum
281 0xFFFF, // Address Range Maximum
282 0x0000, // Address Translation Offset
283 0xF300, // Address Length
285 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
286 0x00000000, // Address Space Granularity
287 0x000A0000, // Address Range Minimum
288 0x000BFFFF, // Address Range Maximum
289 0x00000000, // Address Translation Offset
290 0x00020000, // Address Length
291 ,, , AddressRangeMemory, TypeStatic)
292 DWordMemory (ResourceProducer, PosDecode, MinNotFixed, MaxFixed, NonCacheable, ReadWrite,
293 0x00000000, // Address Space Granularity
294 0x00000000, // Address Range Minimum
295 0xFEBFFFFF, // Address Range Maximum
296 0x00000000, // Address Translation Offset
297 0x00000000, // Address Length
298 ,, MEMF, AddressRangeMemory, TypeStatic)
300 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MIN, PMIN)
301 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MAX, PMAX)
302 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._LEN, PLEN)
303 /* compute available RAM */
304 Add(CMRD(0x34), ShiftLeft(CMRD(0x35), 8), Local0)
305 ShiftLeft(Local0, 16, Local0)
306 Add(Local0, 0x1000000, Local0)
307 /* update field of last region */
309 Subtract (PMAX, PMIN, PLEN)
318 /* PIIX3 ISA bridge */
320 Name (_ADR, 0x00010000)
322 /* PIIX PCI to ISA irq remapping */
323 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
325 /* Real-time clock */
328 Name (_HID, EisaId ("PNP0B00"))
329 Name (_CRS, ResourceTemplate ()
331 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
333 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
337 /* Keyboard seems to be important for WinXP install */
340 Name (_HID, EisaId ("PNP0303"))
341 Method (_STA, 0, NotSerialized)
346 Method (_CRS, 0, NotSerialized)
348 Name (TMP, ResourceTemplate ()
351 0x0060, // Address Range Minimum
352 0x0060, // Address Range Maximum
353 0x01, // Address Alignment
354 0x01, // Address Length
357 0x0064, // Address Range Minimum
358 0x0064, // Address Range Maximum
359 0x01, // Address Alignment
360 0x01, // Address Length
372 Name (_HID, EisaId ("PNP0F13"))
373 Method (_STA, 0, NotSerialized)
378 Method (_CRS, 0, NotSerialized)
380 Name (TMP, ResourceTemplate ()
388 /* PS/2 floppy controller */
391 Name (_HID, EisaId ("PNP0700"))
392 Method (_STA, 0, NotSerialized)
396 Method (_CRS, 0, NotSerialized)
398 Name (BUF0, ResourceTemplate ()
400 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
401 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
403 DMA (Compatibility, NotBusMaster, Transfer8) {2}
412 Name (_HID, EisaId ("PNP0400"))
413 Method (_STA, 0, NotSerialized)
415 Store (\_SB.PCI0.PX13.DRSA, Local0)
416 And (Local0, 0x80000000, Local0)
417 If (LEqual (Local0, 0))
426 Method (_CRS, 0, NotSerialized)
428 Name (BUF0, ResourceTemplate ()
430 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
440 Name (_HID, EisaId ("PNP0501"))
442 Method (_STA, 0, NotSerialized)
444 Store (\_SB.PCI0.PX13.DRSC, Local0)
445 And (Local0, 0x08000000, Local0)
446 If (LEqual (Local0, 0))
455 Method (_CRS, 0, NotSerialized)
457 Name (BUF0, ResourceTemplate ()
459 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
468 Name (_HID, EisaId ("PNP0501"))
470 Method (_STA, 0, NotSerialized)
472 Store (\_SB.PCI0.PX13.DRSC, Local0)
473 And (Local0, 0x80000000, Local0)
474 If (LEqual (Local0, 0))
483 Method (_CRS, 0, NotSerialized)
485 Name (BUF0, ResourceTemplate ()
487 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
497 Name (_ADR, 0x00010003)
499 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
500 Field (P13C, DWordAcc, NoLock, Preserve)
517 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
526 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
528 Name(_PRS, ResourceTemplate(){
529 Interrupt (, Level, ActiveHigh, Shared)
532 Method (_STA, 0, NotSerialized)
535 If (And (0x80, PRQ0, Local1))
541 Method (_DIS, 0, NotSerialized)
543 Or (PRQ0, 0x80, PRQ0)
545 Method (_CRS, 0, NotSerialized)
547 Name (PRR0, ResourceTemplate ()
549 Interrupt (, Level, ActiveHigh, Shared)
552 CreateDWordField (PRR0, 0x05, TMP)
554 If (LLess (Local0, 0x80))
564 Method (_SRS, 1, NotSerialized)
566 CreateDWordField (Arg0, 0x05, TMP)
571 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
573 Name(_PRS, ResourceTemplate(){
574 Interrupt (, Level, ActiveHigh, Shared)
577 Method (_STA, 0, NotSerialized)
580 If (And (0x80, PRQ1, Local1))
586 Method (_DIS, 0, NotSerialized)
588 Or (PRQ1, 0x80, PRQ1)
590 Method (_CRS, 0, NotSerialized)
592 Name (PRR0, ResourceTemplate ()
594 Interrupt (, Level, ActiveHigh, Shared)
597 CreateDWordField (PRR0, 0x05, TMP)
599 If (LLess (Local0, 0x80))
609 Method (_SRS, 1, NotSerialized)
611 CreateDWordField (Arg0, 0x05, TMP)
616 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
618 Name(_PRS, ResourceTemplate(){
619 Interrupt (, Level, ActiveHigh, Shared)
622 Method (_STA, 0, NotSerialized)
625 If (And (0x80, PRQ2, Local1))
631 Method (_DIS, 0, NotSerialized)
633 Or (PRQ2, 0x80, PRQ2)
635 Method (_CRS, 0, NotSerialized)
637 Name (PRR0, ResourceTemplate ()
639 Interrupt (, Level, ActiveHigh, Shared)
642 CreateDWordField (PRR0, 0x05, TMP)
644 If (LLess (Local0, 0x80))
654 Method (_SRS, 1, NotSerialized)
656 CreateDWordField (Arg0, 0x05, TMP)
661 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
663 Name(_PRS, ResourceTemplate(){
664 Interrupt (, Level, ActiveHigh, Shared)
667 Method (_STA, 0, NotSerialized)
670 If (And (0x80, PRQ3, Local1))
676 Method (_DIS, 0, NotSerialized)
678 Or (PRQ3, 0x80, PRQ3)
680 Method (_CRS, 0, NotSerialized)
682 Name (PRR0, ResourceTemplate ()
684 Interrupt (, Level, ActiveHigh, Shared)
687 CreateDWordField (PRR0, 0x05, TMP)
689 If (LLess (Local0, 0x80))
699 Method (_SRS, 1, NotSerialized)
701 CreateDWordField (Arg0, 0x05, TMP)
707 /* S5 = power off state */
708 Name (_S5, Package (4) {
709 0x00, // PM1a_CNT.SLP_TYP
710 0x00, // PM2a_CNT.SLP_TYP
718 If (And(\_PR.PRU, 0x2)) {
722 If (And(\_PR.PRU, 0x4)) {
726 If (And(\_PR.PRU, 0x8)) {
730 If (And(\_PR.PRU, 0x10)) {
734 If (And(\_PR.PRU, 0x20)) {
738 If (And(\_PR.PRU, 0x40)) {
742 If (And(\_PR.PRU, 0x80)) {
746 If (And(\_PR.PRU, 0x100)) {
750 If (And(\_PR.PRU, 0x200)) {
754 If (And(\_PR.PRU, 0x400)) {
758 If (And(\_PR.PRU, 0x800)) {
762 If (And(\_PR.PRU, 0x1000)) {
766 If (And(\_PR.PRU, 0x2000)) {
770 If (And(\_PR.PRU, 0x4000)) {
775 If (And(\_PR.PRD, 0x2)) {
779 If (And(\_PR.PRD, 0x4)) {
783 If (And(\_PR.PRD, 0x8)) {
787 If (And(\_PR.PRD, 0x10)) {
791 If (And(\_PR.PRD, 0x20)) {
795 If (And(\_PR.PRD, 0x40)) {
799 If (And(\_PR.PRD, 0x80)) {
803 If (And(\_PR.PRD, 0x100)) {
807 If (And(\_PR.PRD, 0x200)) {
811 If (And(\_PR.PRD, 0x400)) {
815 If (And(\_PR.PRD, 0x800)) {
819 If (And(\_PR.PRD, 0x1000)) {
823 If (And(\_PR.PRD, 0x2000)) {
827 If (And(\_PR.PRD, 0x4000)) {