blob: dafcf4500623009f40045d8c4d7e6bf24d563c4a [file] [log] [blame]
Kevin O'Connora4d35762008-03-08 15:43:03 -05001/*
2 * Bochs/QEMU ACPI DSDT ASL definition
3 *
4 * Copyright (c) 2006 Fabrice Bellard
5 *
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.
9 *
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.
14 *
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
18 */
19DefinitionBlock (
20 "acpi-dsdt.aml", // Output Filename
21 "DSDT", // Signature
22 0x01, // DSDT Compliance Revision
23 "BXPC", // OEMID
24 "BXDSDT", // TABLE ID
25 0x1 // OEM Revision
26 )
27{
28 Scope (\)
29 {
Kevin O'Connora4d35762008-03-08 15:43:03 -050030 /* Debug Output */
Kevin O'Connord4bded42010-09-19 22:13:18 -040031 OperationRegion (DBG, SystemIO, 0x0402, 0x01)
32 Field (DBG, ByteAcc, NoLock, Preserve)
Kevin O'Connora4d35762008-03-08 15:43:03 -050033 {
Kevin O'Connord4bded42010-09-19 22:13:18 -040034 DBGB, 8,
35 }
36
37 /* Debug method - use this method to send output to the QEMU
38 * BIOS debug port. This method handles strings, integers,
39 * and buffers. For example: DBUG("abc") DBUG(0x123) */
40 Method(DBUG, 1) {
41 ToHexString(Arg0, Local0)
42 ToBuffer(Local0, Local0)
43 Subtract(SizeOf(Local0), 1, Local1)
44 Store(Zero, Local2)
45 While (LLess(Local2, Local1)) {
46 Store(DerefOf(Index(Local0, Local2)), DBGB)
47 Increment(Local2)
48 }
49 Store(0x0A, DBGB)
Kevin O'Connora4d35762008-03-08 15:43:03 -050050 }
51 }
52
Kevin O'Connora4d35762008-03-08 15:43:03 -050053 /* PCI Bus definition */
54 Scope(\_SB) {
55 Device(PCI0) {
56 Name (_HID, EisaId ("PNP0A03"))
57 Name (_ADR, 0x00)
58 Name (_UID, 1)
59 Name(_PRT, Package() {
60 /* PCI IRQ routing table, example from ACPI 2.0a specification,
61 section 6.2.8.1 */
62 /* Note: we provide the same info as the PCI routing
63 table of the Bochs BIOS */
Kevin O'Connor1f6c48a2009-10-08 21:59:13 -040064#define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
65 Package() { nr##ffff, 0, lnk0, 0 }, \
66 Package() { nr##ffff, 1, lnk1, 0 }, \
67 Package() { nr##ffff, 2, lnk2, 0 }, \
68 Package() { nr##ffff, 3, lnk3, 0 }
Kevin O'Connora4d35762008-03-08 15:43:03 -050069
Kevin O'Connor1f6c48a2009-10-08 21:59:13 -040070#define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
71#define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
72#define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
73#define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
74 prt_slot0(0x0000),
Kevin O'Connor5c99b6c2009-12-30 12:36:22 -050075 /* Device 1 is power mgmt device, and can only use irq 9 */
Kevin O'Connor6d5a2172010-10-20 21:59:11 -040076 Package() { 0x0001ffff, 0, LNKS, 0 },
Gleb Natapov29f4b912009-12-24 14:37:16 +020077 Package() { 0x0001ffff, 1, LNKB, 0 },
78 Package() { 0x0001ffff, 2, LNKC, 0 },
79 Package() { 0x0001ffff, 3, LNKD, 0 },
Kevin O'Connor1f6c48a2009-10-08 21:59:13 -040080 prt_slot2(0x0002),
81 prt_slot3(0x0003),
82 prt_slot0(0x0004),
83 prt_slot1(0x0005),
Kevin O'Connor0fee2c92009-10-08 22:06:06 -040084 prt_slot2(0x0006),
85 prt_slot3(0x0007),
86 prt_slot0(0x0008),
87 prt_slot1(0x0009),
88 prt_slot2(0x000a),
89 prt_slot3(0x000b),
90 prt_slot0(0x000c),
91 prt_slot1(0x000d),
92 prt_slot2(0x000e),
93 prt_slot3(0x000f),
94 prt_slot0(0x0010),
95 prt_slot1(0x0011),
96 prt_slot2(0x0012),
97 prt_slot3(0x0013),
98 prt_slot0(0x0014),
99 prt_slot1(0x0015),
100 prt_slot2(0x0016),
101 prt_slot3(0x0017),
102 prt_slot0(0x0018),
103 prt_slot1(0x0019),
104 prt_slot2(0x001a),
105 prt_slot3(0x001b),
106 prt_slot0(0x001c),
107 prt_slot1(0x001d),
108 prt_slot2(0x001e),
109 prt_slot3(0x001f),
Kevin O'Connora4d35762008-03-08 15:43:03 -0500110 })
111
Kevin O'Connora56b6242009-10-08 22:04:05 -0400112 OperationRegion(PCST, SystemIO, 0xae00, 0x08)
113 Field (PCST, DWordAcc, NoLock, WriteAsZeros)
114 {
115 PCIU, 32,
116 PCID, 32,
117 }
118
119 OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
120 Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
121 {
122 B0EJ, 32,
123 }
124
125#define hotplug_slot(name, nr) \
126 Device (S##name) { \
127 Name (_ADR, nr##0000) \
128 Method (_EJ0,1) { \
129 Store(ShiftLeft(1, nr), B0EJ) \
130 Return (0x0) \
131 } \
132 Name (_SUN, name) \
133 }
134
135 hotplug_slot(1, 0x0001)
136 hotplug_slot(2, 0x0002)
137 hotplug_slot(3, 0x0003)
138 hotplug_slot(4, 0x0004)
139 hotplug_slot(5, 0x0005)
140 hotplug_slot(6, 0x0006)
141 hotplug_slot(7, 0x0007)
142 hotplug_slot(8, 0x0008)
143 hotplug_slot(9, 0x0009)
144 hotplug_slot(10, 0x000a)
145 hotplug_slot(11, 0x000b)
146 hotplug_slot(12, 0x000c)
147 hotplug_slot(13, 0x000d)
148 hotplug_slot(14, 0x000e)
149 hotplug_slot(15, 0x000f)
150 hotplug_slot(16, 0x0010)
151 hotplug_slot(17, 0x0011)
152 hotplug_slot(18, 0x0012)
153 hotplug_slot(19, 0x0013)
154 hotplug_slot(20, 0x0014)
155 hotplug_slot(21, 0x0015)
156 hotplug_slot(22, 0x0016)
157 hotplug_slot(23, 0x0017)
158 hotplug_slot(24, 0x0018)
159 hotplug_slot(25, 0x0019)
160 hotplug_slot(26, 0x001a)
161 hotplug_slot(27, 0x001b)
162 hotplug_slot(28, 0x001c)
163 hotplug_slot(29, 0x001d)
164 hotplug_slot(30, 0x001e)
165 hotplug_slot(31, 0x001f)
166
Kevin O'Connor943f3be2008-10-25 15:50:30 -0400167 Name (_CRS, ResourceTemplate ()
Kevin O'Connora4d35762008-03-08 15:43:03 -0500168 {
169 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
170 0x0000, // Address Space Granularity
171 0x0000, // Address Range Minimum
172 0x00FF, // Address Range Maximum
173 0x0000, // Address Translation Offset
174 0x0100, // Address Length
175 ,, )
176 IO (Decode16,
177 0x0CF8, // Address Range Minimum
178 0x0CF8, // Address Range Maximum
179 0x01, // Address Alignment
180 0x08, // Address Length
181 )
182 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
183 0x0000, // Address Space Granularity
184 0x0000, // Address Range Minimum
185 0x0CF7, // Address Range Maximum
186 0x0000, // Address Translation Offset
187 0x0CF8, // Address Length
188 ,, , TypeStatic)
189 WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
190 0x0000, // Address Space Granularity
191 0x0D00, // Address Range Minimum
192 0xFFFF, // Address Range Maximum
193 0x0000, // Address Translation Offset
194 0xF300, // Address Length
195 ,, , TypeStatic)
196 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
197 0x00000000, // Address Space Granularity
198 0x000A0000, // Address Range Minimum
199 0x000BFFFF, // Address Range Maximum
200 0x00000000, // Address Translation Offset
201 0x00020000, // Address Length
202 ,, , AddressRangeMemory, TypeStatic)
Kevin O'Connor943f3be2008-10-25 15:50:30 -0400203 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
Kevin O'Connora4d35762008-03-08 15:43:03 -0500204 0x00000000, // Address Space Granularity
Kevin O'Connor943f3be2008-10-25 15:50:30 -0400205 0xE0000000, // Address Range Minimum
Kevin O'Connora4d35762008-03-08 15:43:03 -0500206 0xFEBFFFFF, // Address Range Maximum
207 0x00000000, // Address Translation Offset
Kevin O'Connor943f3be2008-10-25 15:50:30 -0400208 0x1EC00000, // Address Length
209 ,, , AddressRangeMemory, TypeStatic)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500210 })
Kevin O'Connora4d35762008-03-08 15:43:03 -0500211 }
Kevin O'Connorf4343772009-10-08 22:05:21 -0400212
213 Device(HPET) {
214 Name(_HID, EISAID("PNP0103"))
215 Name(_UID, 0)
216 Method (_STA, 0, NotSerialized) {
217 Return(0x0F)
218 }
219 Name(_CRS, ResourceTemplate() {
220 DWordMemory(
221 ResourceConsumer, PosDecode, MinFixed, MaxFixed,
222 NonCacheable, ReadWrite,
223 0x00000000,
224 0xFED00000,
225 0xFED003FF,
226 0x00000000,
227 0x00000400 /* 1K memory: FED00000 - FED003FF */
228 )
229 })
230 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500231 }
232
233 Scope(\_SB.PCI0) {
Kevin O'Connor9967ab72008-12-18 21:57:33 -0500234 Device (VGA) {
235 Name (_ADR, 0x00020000)
236 Method (_S1D, 0, NotSerialized)
237 {
238 Return (0x00)
239 }
240 Method (_S2D, 0, NotSerialized)
241 {
242 Return (0x00)
243 }
244 Method (_S3D, 0, NotSerialized)
245 {
246 Return (0x00)
247 }
248 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500249
250 /* PIIX3 ISA bridge */
251 Device (ISA) {
252 Name (_ADR, 0x00010000)
253
254 /* PIIX PCI to ISA irq remapping */
255 OperationRegion (P40C, PCI_Config, 0x60, 0x04)
256
257 /* Real-time clock */
258 Device (RTC)
259 {
260 Name (_HID, EisaId ("PNP0B00"))
261 Name (_CRS, ResourceTemplate ()
262 {
263 IO (Decode16, 0x0070, 0x0070, 0x10, 0x02)
264 IRQNoFlags () {8}
265 IO (Decode16, 0x0072, 0x0072, 0x02, 0x06)
266 })
267 }
268
269 /* Keyboard seems to be important for WinXP install */
270 Device (KBD)
271 {
272 Name (_HID, EisaId ("PNP0303"))
273 Method (_STA, 0, NotSerialized)
274 {
275 Return (0x0f)
276 }
277
278 Method (_CRS, 0, NotSerialized)
279 {
280 Name (TMP, ResourceTemplate ()
281 {
282 IO (Decode16,
283 0x0060, // Address Range Minimum
284 0x0060, // Address Range Maximum
285 0x01, // Address Alignment
286 0x01, // Address Length
287 )
288 IO (Decode16,
289 0x0064, // Address Range Minimum
290 0x0064, // Address Range Maximum
291 0x01, // Address Alignment
292 0x01, // Address Length
293 )
294 IRQNoFlags ()
295 {1}
296 })
297 Return (TMP)
298 }
299 }
300
301 /* PS/2 mouse */
302 Device (MOU)
303 {
304 Name (_HID, EisaId ("PNP0F13"))
305 Method (_STA, 0, NotSerialized)
306 {
307 Return (0x0f)
308 }
309
310 Method (_CRS, 0, NotSerialized)
311 {
312 Name (TMP, ResourceTemplate ()
313 {
314 IRQNoFlags () {12}
315 })
316 Return (TMP)
317 }
318 }
319
320 /* PS/2 floppy controller */
321 Device (FDC0)
322 {
323 Name (_HID, EisaId ("PNP0700"))
324 Method (_STA, 0, NotSerialized)
325 {
326 Return (0x0F)
327 }
328 Method (_CRS, 0, NotSerialized)
329 {
330 Name (BUF0, ResourceTemplate ()
331 {
332 IO (Decode16, 0x03F2, 0x03F2, 0x00, 0x04)
333 IO (Decode16, 0x03F7, 0x03F7, 0x00, 0x01)
334 IRQNoFlags () {6}
335 DMA (Compatibility, NotBusMaster, Transfer8) {2}
336 })
337 Return (BUF0)
338 }
339 }
340
341 /* Parallel port */
342 Device (LPT)
343 {
344 Name (_HID, EisaId ("PNP0400"))
345 Method (_STA, 0, NotSerialized)
346 {
347 Store (\_SB.PCI0.PX13.DRSA, Local0)
348 And (Local0, 0x80000000, Local0)
349 If (LEqual (Local0, 0))
350 {
351 Return (0x00)
352 }
353 Else
354 {
355 Return (0x0F)
356 }
357 }
358 Method (_CRS, 0, NotSerialized)
359 {
360 Name (BUF0, ResourceTemplate ()
361 {
362 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
363 IRQNoFlags () {7}
364 })
365 Return (BUF0)
366 }
367 }
368
369 /* Serial Ports */
370 Device (COM1)
371 {
372 Name (_HID, EisaId ("PNP0501"))
373 Name (_UID, 0x01)
374 Method (_STA, 0, NotSerialized)
375 {
376 Store (\_SB.PCI0.PX13.DRSC, Local0)
377 And (Local0, 0x08000000, Local0)
378 If (LEqual (Local0, 0))
379 {
380 Return (0x00)
381 }
382 Else
383 {
384 Return (0x0F)
385 }
386 }
387 Method (_CRS, 0, NotSerialized)
388 {
389 Name (BUF0, ResourceTemplate ()
390 {
391 IO (Decode16, 0x03F8, 0x03F8, 0x00, 0x08)
392 IRQNoFlags () {4}
393 })
394 Return (BUF0)
395 }
396 }
397
398 Device (COM2)
399 {
400 Name (_HID, EisaId ("PNP0501"))
401 Name (_UID, 0x02)
402 Method (_STA, 0, NotSerialized)
403 {
404 Store (\_SB.PCI0.PX13.DRSC, Local0)
405 And (Local0, 0x80000000, Local0)
406 If (LEqual (Local0, 0))
407 {
408 Return (0x00)
409 }
410 Else
411 {
412 Return (0x0F)
413 }
414 }
415 Method (_CRS, 0, NotSerialized)
416 {
417 Name (BUF0, ResourceTemplate ()
418 {
419 IO (Decode16, 0x02F8, 0x02F8, 0x00, 0x08)
420 IRQNoFlags () {3}
421 })
422 Return (BUF0)
423 }
424 }
425 }
426
427 /* PIIX4 PM */
428 Device (PX13) {
429 Name (_ADR, 0x00010003)
430
431 OperationRegion (P13C, PCI_Config, 0x5c, 0x24)
432 Field (P13C, DWordAcc, NoLock, Preserve)
433 {
434 DRSA, 32,
435 DRSB, 32,
436 DRSC, 32,
437 DRSE, 32,
438 DRSF, 32,
439 DRSG, 32,
440 DRSH, 32,
441 DRSI, 32,
442 DRSJ, 32
443 }
444 }
445 }
446
447 /* PCI IRQs */
448 Scope(\_SB) {
449 Field (\_SB.PCI0.ISA.P40C, ByteAcc, NoLock, Preserve)
450 {
451 PRQ0, 8,
452 PRQ1, 8,
453 PRQ2, 8,
454 PRQ3, 8
455 }
456
457 Device(LNKA){
458 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
459 Name(_UID, 1)
460 Name(_PRS, ResourceTemplate(){
Kevin O'Connordff08da2009-10-08 22:01:52 -0400461 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connorcab0fbb2009-10-08 22:02:33 -0400462 { 5, 10, 11 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500463 })
464 Method (_STA, 0, NotSerialized)
465 {
466 Store (0x0B, Local0)
467 If (And (0x80, PRQ0, Local1))
468 {
469 Store (0x09, Local0)
470 }
471 Return (Local0)
472 }
473 Method (_DIS, 0, NotSerialized)
474 {
475 Or (PRQ0, 0x80, PRQ0)
476 }
477 Method (_CRS, 0, NotSerialized)
478 {
479 Name (PRR0, ResourceTemplate ()
480 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400481 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500482 {1}
483 })
Kevin O'Connordff08da2009-10-08 22:01:52 -0400484 CreateDWordField (PRR0, 0x05, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500485 Store (PRQ0, Local0)
486 If (LLess (Local0, 0x80))
487 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400488 Store (Local0, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500489 }
490 Else
491 {
492 Store (Zero, TMP)
493 }
494 Return (PRR0)
495 }
496 Method (_SRS, 1, NotSerialized)
497 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400498 CreateDWordField (Arg0, 0x05, TMP)
499 Store (TMP, PRQ0)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500500 }
501 }
502 Device(LNKB){
503 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
504 Name(_UID, 2)
505 Name(_PRS, ResourceTemplate(){
Kevin O'Connordff08da2009-10-08 22:01:52 -0400506 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connorcab0fbb2009-10-08 22:02:33 -0400507 { 5, 10, 11 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500508 })
509 Method (_STA, 0, NotSerialized)
510 {
511 Store (0x0B, Local0)
512 If (And (0x80, PRQ1, Local1))
513 {
514 Store (0x09, Local0)
515 }
516 Return (Local0)
517 }
518 Method (_DIS, 0, NotSerialized)
519 {
520 Or (PRQ1, 0x80, PRQ1)
521 }
522 Method (_CRS, 0, NotSerialized)
523 {
524 Name (PRR0, ResourceTemplate ()
525 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400526 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500527 {1}
528 })
Kevin O'Connordff08da2009-10-08 22:01:52 -0400529 CreateDWordField (PRR0, 0x05, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500530 Store (PRQ1, Local0)
531 If (LLess (Local0, 0x80))
532 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400533 Store (Local0, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500534 }
535 Else
536 {
537 Store (Zero, TMP)
538 }
539 Return (PRR0)
540 }
541 Method (_SRS, 1, NotSerialized)
542 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400543 CreateDWordField (Arg0, 0x05, TMP)
544 Store (TMP, PRQ1)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500545 }
546 }
547 Device(LNKC){
548 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
549 Name(_UID, 3)
550 Name(_PRS, ResourceTemplate(){
Kevin O'Connordff08da2009-10-08 22:01:52 -0400551 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connorcab0fbb2009-10-08 22:02:33 -0400552 { 5, 10, 11 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500553 })
554 Method (_STA, 0, NotSerialized)
555 {
556 Store (0x0B, Local0)
557 If (And (0x80, PRQ2, Local1))
558 {
559 Store (0x09, Local0)
560 }
561 Return (Local0)
562 }
563 Method (_DIS, 0, NotSerialized)
564 {
565 Or (PRQ2, 0x80, PRQ2)
566 }
567 Method (_CRS, 0, NotSerialized)
568 {
569 Name (PRR0, ResourceTemplate ()
570 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400571 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500572 {1}
573 })
Kevin O'Connordff08da2009-10-08 22:01:52 -0400574 CreateDWordField (PRR0, 0x05, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500575 Store (PRQ2, Local0)
576 If (LLess (Local0, 0x80))
577 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400578 Store (Local0, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500579 }
580 Else
581 {
582 Store (Zero, TMP)
583 }
584 Return (PRR0)
585 }
586 Method (_SRS, 1, NotSerialized)
587 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400588 CreateDWordField (Arg0, 0x05, TMP)
589 Store (TMP, PRQ2)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500590 }
591 }
592 Device(LNKD){
593 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
594 Name(_UID, 4)
595 Name(_PRS, ResourceTemplate(){
Kevin O'Connordff08da2009-10-08 22:01:52 -0400596 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connorcab0fbb2009-10-08 22:02:33 -0400597 { 5, 10, 11 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500598 })
599 Method (_STA, 0, NotSerialized)
600 {
601 Store (0x0B, Local0)
602 If (And (0x80, PRQ3, Local1))
603 {
604 Store (0x09, Local0)
605 }
606 Return (Local0)
607 }
608 Method (_DIS, 0, NotSerialized)
609 {
610 Or (PRQ3, 0x80, PRQ3)
611 }
612 Method (_CRS, 0, NotSerialized)
613 {
614 Name (PRR0, ResourceTemplate ()
615 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400616 Interrupt (, Level, ActiveHigh, Shared)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500617 {1}
618 })
Kevin O'Connordff08da2009-10-08 22:01:52 -0400619 CreateDWordField (PRR0, 0x05, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500620 Store (PRQ3, Local0)
621 If (LLess (Local0, 0x80))
622 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400623 Store (Local0, TMP)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500624 }
625 Else
626 {
627 Store (Zero, TMP)
628 }
629 Return (PRR0)
630 }
631 Method (_SRS, 1, NotSerialized)
632 {
Kevin O'Connordff08da2009-10-08 22:01:52 -0400633 CreateDWordField (Arg0, 0x05, TMP)
634 Store (TMP, PRQ3)
Kevin O'Connora4d35762008-03-08 15:43:03 -0500635 }
636 }
Kevin O'Connor6d5a2172010-10-20 21:59:11 -0400637 Device(LNKS){
638 Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
639 Name(_UID, 5)
640 Name(_PRS, ResourceTemplate(){
641 Interrupt (, Level, ActiveHigh, Shared)
642 { 9 }
643 })
644 Method (_STA, 0, NotSerialized)
645 {
646 Store (0x0B, Local0)
647 If (And (0x80, PRQ0, Local1))
648 {
649 Store (0x09, Local0)
650 }
651 Return (Local0)
652 }
653 Method (_DIS, 0, NotSerialized)
654 {
655 Or (PRQ0, 0x80, PRQ0)
656 }
657 Method (_CRS, 0, NotSerialized)
658 {
659 Name (PRR0, ResourceTemplate ()
660 {
661 Interrupt (, Level, ActiveHigh, Shared)
662 {9}
663 })
664 CreateDWordField (PRR0, 0x05, TMP)
665 Store (PRQ0, Local0)
666 If (LLess (Local0, 0x80))
667 {
668 Store (Local0, TMP)
669 }
670 Else
671 {
672 Store (Zero, TMP)
673 }
674 Return (PRR0)
675 }
676 }
Kevin O'Connora4d35762008-03-08 15:43:03 -0500677 }
678
Kevin O'Connor9967ab72008-12-18 21:57:33 -0500679 /*
680 * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
681 * must match piix4 emulation.
682 */
683 Name (\_S3, Package (0x04)
684 {
685 0x01, /* PM1a_CNT.SLP_TYP */
686 0x01, /* PM1b_CNT.SLP_TYP */
687 Zero, /* reserved */
688 Zero /* reserved */
689 })
690 Name (\_S4, Package (0x04)
691 {
692 Zero, /* PM1a_CNT.SLP_TYP */
693 Zero, /* PM1b_CNT.SLP_TYP */
694 Zero, /* reserved */
695 Zero /* reserved */
696 })
697 Name (\_S5, Package (0x04)
698 {
699 Zero, /* PM1a_CNT.SLP_TYP */
700 Zero, /* PM1b_CNT.SLP_TYP */
701 Zero, /* reserved */
702 Zero /* reserved */
Kevin O'Connora4d35762008-03-08 15:43:03 -0500703 })
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400704
Kevin O'Connore2074bf2010-08-03 21:30:03 -0400705 /* CPU hotplug */
706 Scope(\_SB) {
707 /* Objects filled in by run-time generated SSDT */
708 External(NTFY, MethodObj)
709 External(CPON, PkgObj)
710
711 /* Methods called by run-time generated SSDT Processor objects */
712 Method (CPMA, 1, NotSerialized) {
713 // _MAT method - create an madt apic buffer
714 // Local0 = CPON flag for this cpu
715 Store(DerefOf(Index(CPON, Arg0)), Local0)
716 // Local1 = Buffer (in madt apic form) to return
717 Store(Buffer(8) {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}, Local1)
718 // Update the processor id, lapic id, and enable/disable status
719 Store(Arg0, Index(Local1, 2))
720 Store(Arg0, Index(Local1, 3))
721 Store(Local0, Index(Local1, 4))
722 Return (Local1)
723 }
724 Method (CPST, 1, NotSerialized) {
725 // _STA method - return ON status of cpu
726 // Local0 = CPON flag for this cpu
727 Store(DerefOf(Index(CPON, Arg0)), Local0)
728 If (Local0) { Return(0xF) } Else { Return(0x0) }
729 }
730 Method (CPEJ, 2, NotSerialized) {
731 // _EJ0 method - eject callback
732 Sleep(200)
733 }
734
735 /* CPU hotplug notify method */
736 OperationRegion(PRST, SystemIO, 0xaf00, 32)
737 Field (PRST, ByteAcc, NoLock, Preserve)
738 {
739 PRS, 256
740 }
741 Method(PRSC, 0) {
742 // Local5 = active cpu bitmap
743 Store (PRS, Local5)
744 // Local2 = last read byte from bitmap
745 Store (Zero, Local2)
746 // Local0 = cpuid iterator
747 Store (Zero, Local0)
748 While (LLess(Local0, SizeOf(CPON))) {
749 // Local1 = CPON flag for this cpu
750 Store(DerefOf(Index(CPON, Local0)), Local1)
751 If (And(Local0, 0x07)) {
752 // Shift down previously read bitmap byte
753 ShiftRight(Local2, 1, Local2)
754 } Else {
755 // Read next byte from cpu bitmap
756 Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2)
757 }
758 // Local3 = active state for this cpu
759 Store(And(Local2, 1), Local3)
760
761 If (LNotEqual(Local1, Local3)) {
762 // State change - update CPON with new state
763 Store(Local3, Index(CPON, Local0))
764 // Do CPU notify
765 If (LEqual(Local3, 1)) {
766 NTFY(Local0, 1)
767 } Else {
768 NTFY(Local0, 3)
769 }
770 }
771 Increment(Local0)
772 }
773 Return(One)
774 }
775 }
776
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400777 Scope (\_GPE)
778 {
779 Name(_HID, "ACPI0006")
780
781 Method(_L00) {
782 Return(0x01)
783 }
Kevin O'Connora56b6242009-10-08 22:04:05 -0400784
785#define gen_pci_hotplug(nr) \
786 If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) { \
787 Notify(\_SB.PCI0.S##nr, 1) \
788 } \
789 If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) { \
790 Notify(\_SB.PCI0.S##nr, 3) \
791 }
792
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400793 Method(_L01) {
Kevin O'Connora56b6242009-10-08 22:04:05 -0400794 gen_pci_hotplug(1)
795 gen_pci_hotplug(2)
796 gen_pci_hotplug(3)
797 gen_pci_hotplug(4)
798 gen_pci_hotplug(5)
799 gen_pci_hotplug(6)
800 gen_pci_hotplug(7)
801 gen_pci_hotplug(8)
802 gen_pci_hotplug(9)
803 gen_pci_hotplug(10)
804 gen_pci_hotplug(11)
805 gen_pci_hotplug(12)
806 gen_pci_hotplug(13)
807 gen_pci_hotplug(14)
808 gen_pci_hotplug(15)
809 gen_pci_hotplug(16)
810 gen_pci_hotplug(17)
811 gen_pci_hotplug(18)
812 gen_pci_hotplug(19)
813 gen_pci_hotplug(20)
814 gen_pci_hotplug(21)
815 gen_pci_hotplug(22)
816 gen_pci_hotplug(23)
817 gen_pci_hotplug(24)
818 gen_pci_hotplug(25)
819 gen_pci_hotplug(26)
820 gen_pci_hotplug(27)
821 gen_pci_hotplug(28)
822 gen_pci_hotplug(29)
823 gen_pci_hotplug(30)
824 gen_pci_hotplug(31)
825
826 Return (0x01)
827
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400828 }
829 Method(_L02) {
Kevin O'Connore2074bf2010-08-03 21:30:03 -0400830 // CPU hotplug event
831 Return(\_SB.PRSC())
Kevin O'Connor12a490b2009-10-08 22:03:28 -0400832 }
833 Method(_L03) {
834 Return(0x01)
835 }
836 Method(_L04) {
837 Return(0x01)
838 }
839 Method(_L05) {
840 Return(0x01)
841 }
842 Method(_L06) {
843 Return(0x01)
844 }
845 Method(_L07) {
846 Return(0x01)
847 }
848 Method(_L08) {
849 Return(0x01)
850 }
851 Method(_L09) {
852 Return(0x01)
853 }
854 Method(_L0A) {
855 Return(0x01)
856 }
857 Method(_L0B) {
858 Return(0x01)
859 }
860 Method(_L0C) {
861 Return(0x01)
862 }
863 Method(_L0D) {
864 Return(0x01)
865 }
866 Method(_L0E) {
867 Return(0x01)
868 }
869 Method(_L0F) {
870 Return(0x01)
871 }
872 }
873
Kevin O'Connora4d35762008-03-08 15:43:03 -0500874}