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 #define gen_processor(nr, name) \
38 Processor (CPU##name, nr, 0x0000b010, 0x06) { \
39 Name (TMP, Buffer(0x8) {0x0, 0x8, nr, nr, 0x1, 0x0, 0x0, 0x0}) \
41 If (And(\_PR.PRU, ShiftLeft(1, nr))) { Return(TMP) } \
42 Else { Return(0x0) } \
51 Processor (CPU0, 0x00, 0x0000b010, 0x06) {Method (_STA) { Return(0xF)}}
71 OperationRegion (DBG, SystemIO, 0xb044, 0x04)
72 Field (DBG, DWordAcc, NoLock, Preserve)
79 /* PCI Bus definition */
82 Name (_HID, EisaId ("PNP0A03"))
85 Name(_PRT, Package() {
86 /* PCI IRQ routing table, example from ACPI 2.0a specification,
88 /* Note: we provide the same info as the PCI routing
89 table of the Bochs BIOS */
91 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
92 Package() { nr##ffff, 0, lnk0, 0 }, \
93 Package() { nr##ffff, 1, lnk1, 0 }, \
94 Package() { nr##ffff, 2, lnk2, 0 }, \
95 Package() { nr##ffff, 3, lnk3, 0 }
97 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
98 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
99 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
100 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
136 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
137 Field (PCST, DWordAcc, NoLock, WriteAsZeros)
143 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
144 Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
149 #define hotplug_slot(name, nr) \
151 Name (_ADR, nr##0000) \
153 Store(ShiftLeft(1, nr), B0EJ) \
159 hotplug_slot(1, 0x0001)
160 hotplug_slot(2, 0x0002)
161 hotplug_slot(3, 0x0003)
162 hotplug_slot(4, 0x0004)
163 hotplug_slot(5, 0x0005)
164 hotplug_slot(6, 0x0006)
165 hotplug_slot(7, 0x0007)
166 hotplug_slot(8, 0x0008)
167 hotplug_slot(9, 0x0009)
168 hotplug_slot(10, 0x000a)
169 hotplug_slot(11, 0x000b)
170 hotplug_slot(12, 0x000c)
171 hotplug_slot(13, 0x000d)
172 hotplug_slot(14, 0x000e)
173 hotplug_slot(15, 0x000f)
174 hotplug_slot(16, 0x0010)
175 hotplug_slot(17, 0x0011)
176 hotplug_slot(18, 0x0012)
177 hotplug_slot(19, 0x0013)
178 hotplug_slot(20, 0x0014)
179 hotplug_slot(21, 0x0015)
180 hotplug_slot(22, 0x0016)
181 hotplug_slot(23, 0x0017)
182 hotplug_slot(24, 0x0018)
183 hotplug_slot(25, 0x0019)
184 hotplug_slot(26, 0x001a)
185 hotplug_slot(27, 0x001b)
186 hotplug_slot(28, 0x001c)
187 hotplug_slot(29, 0x001d)
188 hotplug_slot(30, 0x001e)
189 hotplug_slot(31, 0x001f)
191 Name (_CRS, ResourceTemplate ()
193 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
194 0x0000, // Address Space Granularity
195 0x0000, // Address Range Minimum
196 0x00FF, // Address Range Maximum
197 0x0000, // Address Translation Offset
198 0x0100, // Address Length
201 0x0CF8, // Address Range Minimum
202 0x0CF8, // Address Range Maximum
203 0x01, // Address Alignment
204 0x08, // Address Length
206 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
207 0x0000, // Address Space Granularity
208 0x0000, // Address Range Minimum
209 0x0CF7, // Address Range Maximum
210 0x0000, // Address Translation Offset
211 0x0CF8, // Address Length
213 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
214 0x0000, // Address Space Granularity
215 0x0D00, // Address Range Minimum
216 0xFFFF, // Address Range Maximum
217 0x0000, // Address Translation Offset
218 0xF300, // Address Length
220 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
221 0x00000000, // Address Space Granularity
222 0x000A0000, // Address Range Minimum
223 0x000BFFFF, // Address Range Maximum
224 0x00000000, // Address Translation Offset
225 0x00020000, // Address Length
226 ,, , AddressRangeMemory, TypeStatic)
227 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
228 0x00000000, // Address Space Granularity
229 0xE0000000, // Address Range Minimum
230 0xFEBFFFFF, // Address Range Maximum
231 0x00000000, // Address Translation Offset
232 0x1EC00000, // Address Length
233 ,, , AddressRangeMemory, TypeStatic)
240 /* PIIX3 ISA bridge */
242 Name (_ADR, 0x00010000)
244 /* PIIX PCI to ISA irq remapping */
245 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
247 /* Real-time clock */
250 Name (_HID, EisaId ("PNP0B00"))
251 Name (_CRS, ResourceTemplate ()
253 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
255 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
259 /* Keyboard seems to be important for WinXP install */
262 Name (_HID, EisaId ("PNP0303"))
263 Method (_STA, 0, NotSerialized)
268 Method (_CRS, 0, NotSerialized)
270 Name (TMP, ResourceTemplate ()
273 0x0060, // Address Range Minimum
274 0x0060, // Address Range Maximum
275 0x01, // Address Alignment
276 0x01, // Address Length
279 0x0064, // Address Range Minimum
280 0x0064, // Address Range Maximum
281 0x01, // Address Alignment
282 0x01, // Address Length
294 Name (_HID, EisaId ("PNP0F13"))
295 Method (_STA, 0, NotSerialized)
300 Method (_CRS, 0, NotSerialized)
302 Name (TMP, ResourceTemplate ()
310 /* PS/2 floppy controller */
313 Name (_HID, EisaId ("PNP0700"))
314 Method (_STA, 0, NotSerialized)
318 Method (_CRS, 0, NotSerialized)
320 Name (BUF0, ResourceTemplate ()
322 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
323 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
325 DMA (Compatibility, NotBusMaster, Transfer8) {2}
334 Name (_HID, EisaId ("PNP0400"))
335 Method (_STA, 0, NotSerialized)
337 Store (\_SB.PCI0.PX13.DRSA, Local0)
338 And (Local0, 0x80000000, Local0)
339 If (LEqual (Local0, 0))
348 Method (_CRS, 0, NotSerialized)
350 Name (BUF0, ResourceTemplate ()
352 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
362 Name (_HID, EisaId ("PNP0501"))
364 Method (_STA, 0, NotSerialized)
366 Store (\_SB.PCI0.PX13.DRSC, Local0)
367 And (Local0, 0x08000000, Local0)
368 If (LEqual (Local0, 0))
377 Method (_CRS, 0, NotSerialized)
379 Name (BUF0, ResourceTemplate ()
381 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
390 Name (_HID, EisaId ("PNP0501"))
392 Method (_STA, 0, NotSerialized)
394 Store (\_SB.PCI0.PX13.DRSC, Local0)
395 And (Local0, 0x80000000, Local0)
396 If (LEqual (Local0, 0))
405 Method (_CRS, 0, NotSerialized)
407 Name (BUF0, ResourceTemplate ()
409 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
419 Name (_ADR, 0x00010003)
421 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
422 Field (P13C, DWordAcc, NoLock, Preserve)
439 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
448 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
450 Name(_PRS, ResourceTemplate(){
451 Interrupt (, Level, ActiveHigh, Shared)
454 Method (_STA, 0, NotSerialized)
457 If (And (0x80, PRQ0, Local1))
463 Method (_DIS, 0, NotSerialized)
465 Or (PRQ0, 0x80, PRQ0)
467 Method (_CRS, 0, NotSerialized)
469 Name (PRR0, ResourceTemplate ()
471 Interrupt (, Level, ActiveHigh, Shared)
474 CreateDWordField (PRR0, 0x05, TMP)
476 If (LLess (Local0, 0x80))
486 Method (_SRS, 1, NotSerialized)
488 CreateDWordField (Arg0, 0x05, TMP)
493 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
495 Name(_PRS, ResourceTemplate(){
496 Interrupt (, Level, ActiveHigh, Shared)
499 Method (_STA, 0, NotSerialized)
502 If (And (0x80, PRQ1, Local1))
508 Method (_DIS, 0, NotSerialized)
510 Or (PRQ1, 0x80, PRQ1)
512 Method (_CRS, 0, NotSerialized)
514 Name (PRR0, ResourceTemplate ()
516 Interrupt (, Level, ActiveHigh, Shared)
519 CreateDWordField (PRR0, 0x05, TMP)
521 If (LLess (Local0, 0x80))
531 Method (_SRS, 1, NotSerialized)
533 CreateDWordField (Arg0, 0x05, TMP)
538 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
540 Name(_PRS, ResourceTemplate(){
541 Interrupt (, Level, ActiveHigh, Shared)
544 Method (_STA, 0, NotSerialized)
547 If (And (0x80, PRQ2, Local1))
553 Method (_DIS, 0, NotSerialized)
555 Or (PRQ2, 0x80, PRQ2)
557 Method (_CRS, 0, NotSerialized)
559 Name (PRR0, ResourceTemplate ()
561 Interrupt (, Level, ActiveHigh, Shared)
564 CreateDWordField (PRR0, 0x05, TMP)
566 If (LLess (Local0, 0x80))
576 Method (_SRS, 1, NotSerialized)
578 CreateDWordField (Arg0, 0x05, TMP)
583 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
585 Name(_PRS, ResourceTemplate(){
586 Interrupt (, Level, ActiveHigh, Shared)
589 Method (_STA, 0, NotSerialized)
592 If (And (0x80, PRQ3, Local1))
598 Method (_DIS, 0, NotSerialized)
600 Or (PRQ3, 0x80, PRQ3)
602 Method (_CRS, 0, NotSerialized)
604 Name (PRR0, ResourceTemplate ()
606 Interrupt (, Level, ActiveHigh, Shared)
609 CreateDWordField (PRR0, 0x05, TMP)
611 If (LLess (Local0, 0x80))
621 Method (_SRS, 1, NotSerialized)
623 CreateDWordField (Arg0, 0x05, TMP)
629 /* S5 = power off state */
630 Name (_S5, Package (4) {
631 0x00, // PM1a_CNT.SLP_TYP
632 0x00, // PM2a_CNT.SLP_TYP
639 #define gen_cpu_hotplug(name, nr) \
640 If (And(\_PR.PRU, ShiftLeft(1, nr))) { \
641 Notify(\_PR.CPU##name, 1) \
643 If (And(\_PR.PRD, ShiftLeft(1, nr))) { \
644 Notify(\_PR.CPU##name, 3) \
648 gen_cpu_hotplug(1, 1)
649 gen_cpu_hotplug(2, 2)
650 gen_cpu_hotplug(3, 3)
651 gen_cpu_hotplug(4, 4)
652 gen_cpu_hotplug(5, 5)
653 gen_cpu_hotplug(6, 6)
654 gen_cpu_hotplug(7, 7)
655 gen_cpu_hotplug(8, 8)
656 gen_cpu_hotplug(9, 9)
657 gen_cpu_hotplug(A, 10)
658 gen_cpu_hotplug(B, 11)
659 gen_cpu_hotplug(C, 12)
660 gen_cpu_hotplug(D, 13)
661 gen_cpu_hotplug(E, 14)
666 #define gen_pci_hotplug(nr) \
667 If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) { \
668 Notify(\_SB.PCI0.S##nr, 1) \
670 If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) { \
671 Notify(\_SB.PCI0.S##nr, 3) \