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)}}
70 /* CMOS memory access */
71 OperationRegion (CMS, SystemIO, 0x70, 0x02)
72 Field (CMS, ByteAcc, NoLock, Preserve)
77 Method (CMRD, 1, NotSerialized)
85 OperationRegion (DBG, SystemIO, 0xb044, 0x04)
86 Field (DBG, DWordAcc, NoLock, Preserve)
93 /* PCI Bus definition */
96 Name (_HID, EisaId ("PNP0A03"))
99 Name(_PRT, Package() {
100 /* PCI IRQ routing table, example from ACPI 2.0a specification,
102 /* Note: we provide the same info as the PCI routing
103 table of the Bochs BIOS */
105 #define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
106 Package() { nr##ffff, 0, lnk0, 0 }, \
107 Package() { nr##ffff, 1, lnk1, 0 }, \
108 Package() { nr##ffff, 2, lnk2, 0 }, \
109 Package() { nr##ffff, 3, lnk3, 0 }
111 #define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
112 #define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
113 #define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
114 #define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
150 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
151 Field (PCST, DWordAcc, NoLock, WriteAsZeros)
157 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
158 Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
163 #define hotplug_slot(name, nr) \
165 Name (_ADR, nr##0000) \
167 Store(ShiftLeft(1, nr), B0EJ) \
173 hotplug_slot(1, 0x0001)
174 hotplug_slot(2, 0x0002)
175 hotplug_slot(3, 0x0003)
176 hotplug_slot(4, 0x0004)
177 hotplug_slot(5, 0x0005)
178 hotplug_slot(6, 0x0006)
179 hotplug_slot(7, 0x0007)
180 hotplug_slot(8, 0x0008)
181 hotplug_slot(9, 0x0009)
182 hotplug_slot(10, 0x000a)
183 hotplug_slot(11, 0x000b)
184 hotplug_slot(12, 0x000c)
185 hotplug_slot(13, 0x000d)
186 hotplug_slot(14, 0x000e)
187 hotplug_slot(15, 0x000f)
188 hotplug_slot(16, 0x0010)
189 hotplug_slot(17, 0x0011)
190 hotplug_slot(18, 0x0012)
191 hotplug_slot(19, 0x0013)
192 hotplug_slot(20, 0x0014)
193 hotplug_slot(21, 0x0015)
194 hotplug_slot(22, 0x0016)
195 hotplug_slot(23, 0x0017)
196 hotplug_slot(24, 0x0018)
197 hotplug_slot(25, 0x0019)
198 hotplug_slot(26, 0x001a)
199 hotplug_slot(27, 0x001b)
200 hotplug_slot(28, 0x001c)
201 hotplug_slot(29, 0x001d)
202 hotplug_slot(30, 0x001e)
203 hotplug_slot(31, 0x001f)
205 Method (_CRS, 0, NotSerialized)
207 Name (MEMP, ResourceTemplate ()
209 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
210 0x0000, // Address Space Granularity
211 0x0000, // Address Range Minimum
212 0x00FF, // Address Range Maximum
213 0x0000, // Address Translation Offset
214 0x0100, // Address Length
217 0x0CF8, // Address Range Minimum
218 0x0CF8, // Address Range Maximum
219 0x01, // Address Alignment
220 0x08, // Address Length
222 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
223 0x0000, // Address Space Granularity
224 0x0000, // Address Range Minimum
225 0x0CF7, // Address Range Maximum
226 0x0000, // Address Translation Offset
227 0x0CF8, // Address Length
229 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
230 0x0000, // Address Space Granularity
231 0x0D00, // Address Range Minimum
232 0xFFFF, // Address Range Maximum
233 0x0000, // Address Translation Offset
234 0xF300, // Address Length
236 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
237 0x00000000, // Address Space Granularity
238 0x000A0000, // Address Range Minimum
239 0x000BFFFF, // Address Range Maximum
240 0x00000000, // Address Translation Offset
241 0x00020000, // Address Length
242 ,, , AddressRangeMemory, TypeStatic)
243 DWordMemory (ResourceProducer, PosDecode, MinNotFixed, MaxFixed, NonCacheable, ReadWrite,
244 0x00000000, // Address Space Granularity
245 0x00000000, // Address Range Minimum
246 0xFEBFFFFF, // Address Range Maximum
247 0x00000000, // Address Translation Offset
248 0x00000000, // Address Length
249 ,, MEMF, AddressRangeMemory, TypeStatic)
251 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MIN, PMIN)
252 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._MAX, PMAX)
253 CreateDWordField (MEMP, \_SB.PCI0._CRS.MEMF._LEN, PLEN)
254 /* compute available RAM */
255 Add(CMRD(0x34), ShiftLeft(CMRD(0x35), 8), Local0)
256 ShiftLeft(Local0, 16, Local0)
257 Add(Local0, 0x1000000, Local0)
258 /* update field of last region */
260 Subtract (PMAX, PMIN, PLEN)
269 /* PIIX3 ISA bridge */
271 Name (_ADR, 0x00010000)
273 /* PIIX PCI to ISA irq remapping */
274 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
276 /* Real-time clock */
279 Name (_HID, EisaId ("PNP0B00"))
280 Name (_CRS, ResourceTemplate ()
282 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
284 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
288 /* Keyboard seems to be important for WinXP install */
291 Name (_HID, EisaId ("PNP0303"))
292 Method (_STA, 0, NotSerialized)
297 Method (_CRS, 0, NotSerialized)
299 Name (TMP, ResourceTemplate ()
302 0x0060, // Address Range Minimum
303 0x0060, // Address Range Maximum
304 0x01, // Address Alignment
305 0x01, // Address Length
308 0x0064, // Address Range Minimum
309 0x0064, // Address Range Maximum
310 0x01, // Address Alignment
311 0x01, // Address Length
323 Name (_HID, EisaId ("PNP0F13"))
324 Method (_STA, 0, NotSerialized)
329 Method (_CRS, 0, NotSerialized)
331 Name (TMP, ResourceTemplate ()
339 /* PS/2 floppy controller */
342 Name (_HID, EisaId ("PNP0700"))
343 Method (_STA, 0, NotSerialized)
347 Method (_CRS, 0, NotSerialized)
349 Name (BUF0, ResourceTemplate ()
351 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
352 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
354 DMA (Compatibility, NotBusMaster, Transfer8) {2}
363 Name (_HID, EisaId ("PNP0400"))
364 Method (_STA, 0, NotSerialized)
366 Store (\_SB.PCI0.PX13.DRSA, Local0)
367 And (Local0, 0x80000000, Local0)
368 If (LEqual (Local0, 0))
377 Method (_CRS, 0, NotSerialized)
379 Name (BUF0, ResourceTemplate ()
381 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
391 Name (_HID, EisaId ("PNP0501"))
393 Method (_STA, 0, NotSerialized)
395 Store (\_SB.PCI0.PX13.DRSC, Local0)
396 And (Local0, 0x08000000, Local0)
397 If (LEqual (Local0, 0))
406 Method (_CRS, 0, NotSerialized)
408 Name (BUF0, ResourceTemplate ()
410 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
419 Name (_HID, EisaId ("PNP0501"))
421 Method (_STA, 0, NotSerialized)
423 Store (\_SB.PCI0.PX13.DRSC, Local0)
424 And (Local0, 0x80000000, Local0)
425 If (LEqual (Local0, 0))
434 Method (_CRS, 0, NotSerialized)
436 Name (BUF0, ResourceTemplate ()
438 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
448 Name (_ADR, 0x00010003)
450 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
451 Field (P13C, DWordAcc, NoLock, Preserve)
468 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
477 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
479 Name(_PRS, ResourceTemplate(){
480 Interrupt (, Level, ActiveHigh, Shared)
483 Method (_STA, 0, NotSerialized)
486 If (And (0x80, PRQ0, Local1))
492 Method (_DIS, 0, NotSerialized)
494 Or (PRQ0, 0x80, PRQ0)
496 Method (_CRS, 0, NotSerialized)
498 Name (PRR0, ResourceTemplate ()
500 Interrupt (, Level, ActiveHigh, Shared)
503 CreateDWordField (PRR0, 0x05, TMP)
505 If (LLess (Local0, 0x80))
515 Method (_SRS, 1, NotSerialized)
517 CreateDWordField (Arg0, 0x05, TMP)
522 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
524 Name(_PRS, ResourceTemplate(){
525 Interrupt (, Level, ActiveHigh, Shared)
528 Method (_STA, 0, NotSerialized)
531 If (And (0x80, PRQ1, Local1))
537 Method (_DIS, 0, NotSerialized)
539 Or (PRQ1, 0x80, PRQ1)
541 Method (_CRS, 0, NotSerialized)
543 Name (PRR0, ResourceTemplate ()
545 Interrupt (, Level, ActiveHigh, Shared)
548 CreateDWordField (PRR0, 0x05, TMP)
550 If (LLess (Local0, 0x80))
560 Method (_SRS, 1, NotSerialized)
562 CreateDWordField (Arg0, 0x05, TMP)
567 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
569 Name(_PRS, ResourceTemplate(){
570 Interrupt (, Level, ActiveHigh, Shared)
573 Method (_STA, 0, NotSerialized)
576 If (And (0x80, PRQ2, Local1))
582 Method (_DIS, 0, NotSerialized)
584 Or (PRQ2, 0x80, PRQ2)
586 Method (_CRS, 0, NotSerialized)
588 Name (PRR0, ResourceTemplate ()
590 Interrupt (, Level, ActiveHigh, Shared)
593 CreateDWordField (PRR0, 0x05, TMP)
595 If (LLess (Local0, 0x80))
605 Method (_SRS, 1, NotSerialized)
607 CreateDWordField (Arg0, 0x05, TMP)
612 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
614 Name(_PRS, ResourceTemplate(){
615 Interrupt (, Level, ActiveHigh, Shared)
618 Method (_STA, 0, NotSerialized)
621 If (And (0x80, PRQ3, Local1))
627 Method (_DIS, 0, NotSerialized)
629 Or (PRQ3, 0x80, PRQ3)
631 Method (_CRS, 0, NotSerialized)
633 Name (PRR0, ResourceTemplate ()
635 Interrupt (, Level, ActiveHigh, Shared)
638 CreateDWordField (PRR0, 0x05, TMP)
640 If (LLess (Local0, 0x80))
650 Method (_SRS, 1, NotSerialized)
652 CreateDWordField (Arg0, 0x05, TMP)
658 /* S5 = power off state */
659 Name (_S5, Package (4) {
660 0x00, // PM1a_CNT.SLP_TYP
661 0x00, // PM2a_CNT.SLP_TYP
668 #define gen_cpu_hotplug(name, nr) \
669 If (And(\_PR.PRU, ShiftLeft(1, nr))) { \
670 Notify(\_PR.CPU##name, 1) \
672 If (And(\_PR.PRD, ShiftLeft(1, nr))) { \
673 Notify(\_PR.CPU##name, 3) \
677 gen_cpu_hotplug(1, 1)
678 gen_cpu_hotplug(2, 2)
679 gen_cpu_hotplug(3, 3)
680 gen_cpu_hotplug(4, 4)
681 gen_cpu_hotplug(5, 5)
682 gen_cpu_hotplug(6, 6)
683 gen_cpu_hotplug(7, 7)
684 gen_cpu_hotplug(8, 8)
685 gen_cpu_hotplug(9, 9)
686 gen_cpu_hotplug(A, 10)
687 gen_cpu_hotplug(B, 11)
688 gen_cpu_hotplug(C, 12)
689 gen_cpu_hotplug(D, 13)
690 gen_cpu_hotplug(E, 14)
695 #define gen_pci_hotplug(nr) \
696 If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) { \
697 Notify(\_SB.PCI0.S##nr, 1) \
699 If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) { \
700 Notify(\_SB.PCI0.S##nr, 3) \