ia64/xen-unstable

view tools/firmware/hvmloader/acpi/dsdt.asl @ 19079:f3240cd3cd2b

rombios: Indirect through 32-bit jump table from within the 32-bit bios.

This gets rid of shenanigans with relocating the jump table around the
place.

Also clean up bios_info table while we are updating it.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 23 14:32:41 2009 +0000 (2009-01-23)
parents de38a475ab9e
children cd5697e00e86
line source
1 /******************************************************************************
2 * DSDT for Xen with Qemu device model
3 *
4 * Copyright (c) 2004, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 */
20 DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
21 {
22 Name (\PMBS, 0x0C00)
23 Name (\PMLN, 0x08)
24 Name (\IOB1, 0x00)
25 Name (\IOL1, 0x00)
26 Name (\APCB, 0xFEC00000)
27 Name (\APCL, 0x00010000)
28 Name (\PUID, 0x00)
30 Scope (\_PR)
31 {
32 Processor (PR00, 0x00, 0x0000, 0x00) {}
33 Processor (PR01, 0x01, 0x0000, 0x00) {}
34 Processor (PR02, 0x02, 0x0000, 0x00) {}
35 Processor (PR03, 0x03, 0x0000, 0x00) {}
36 Processor (PR04, 0x04, 0x0000, 0x00) {}
37 Processor (PR05, 0x05, 0x0000, 0x00) {}
38 Processor (PR06, 0x06, 0x0000, 0x00) {}
39 Processor (PR07, 0x07, 0x0000, 0x00) {}
40 Processor (PR08, 0x08, 0x0000, 0x00) {}
41 Processor (PR09, 0x09, 0x0000, 0x00) {}
42 Processor (PR0A, 0x0a, 0x0000, 0x00) {}
43 Processor (PR0B, 0x0b, 0x0000, 0x00) {}
44 Processor (PR0C, 0x0c, 0x0000, 0x00) {}
45 Processor (PR0D, 0x0d, 0x0000, 0x00) {}
46 Processor (PR0E, 0x0e, 0x0000, 0x00) {}
47 /* No more than 15 Processor objects, as otherwise Windows 2000
48 * experiences a BSOD of KMODE_EXCEPTION_NOT_HANDLED. If we require
49 * more in some configurations then we should move \_PR scope into a
50 * SSDT, statically compiled with a range of different numbers of
51 * processors. We can then link the appropriate one into the RSDT/XSDT
52 * at HVM guest boot time. */
53 }
55 /*
56 * S3 (suspend-to-ram), S4 (suspend-to-disc) and S5 (power-off) type codes:
57 * must match piix4 emulation.
58 */
59 Name (\_S3, Package (0x04)
60 {
61 0x05, /* PM1a_CNT.SLP_TYP */
62 0x05, /* PM1b_CNT.SLP_TYP */
63 0x0, /* reserved */
64 0x0 /* reserved */
65 })
66 Name (\_S4, Package (0x04)
67 {
68 0x06, /* PM1a_CNT.SLP_TYP */
69 0x06, /* PM1b_CNT.SLP_TYP */
70 0x00, /* reserved */
71 0x00 /* reserved */
72 })
73 Name (\_S5, Package (0x04)
74 {
75 0x07, /* PM1a_CNT.SLP_TYP */
76 0x07, /* PM1b_CNT.SLP_TYP */
77 0x00, /* reserved */
78 0x00 /* reserved */
79 })
81 Name(PICD, 0)
82 Method(_PIC, 1)
83 {
84 Store(Arg0, PICD)
85 }
87 Scope (\_SB)
88 {
89 /* BIOS_INFO_PHYSICAL_ADDRESS == 0xEA000 */
90 OperationRegion(BIOS, SystemMemory, 0xEA000, 16)
91 Field(BIOS, ByteAcc, NoLock, Preserve) {
92 UAR1, 1,
93 UAR2, 1,
94 HPET, 1,
95 Offset(4),
96 PMIN, 32,
97 PLEN, 32
98 }
100 /* Fix HCT test for 0x400 pci memory:
101 * - need to report low 640 MB mem as motherboard resource
102 */
103 Device(MEM0)
104 {
105 Name(_HID, EISAID("PNP0C02"))
106 Name(_CRS, ResourceTemplate() {
107 QWordMemory(
108 ResourceConsumer, PosDecode, MinFixed,
109 MaxFixed, Cacheable, ReadWrite,
110 0x00000000,
111 0x00000000,
112 0x0009ffff,
113 0x00000000,
114 0x000a0000)
115 })
116 }
118 Device (PCI0)
119 {
120 Name (_HID, EisaId ("PNP0A03"))
121 Name (_UID, 0x00)
122 Name (_ADR, 0x00)
123 Name (_BBN, 0x00)
125 /*
126 * Reserve the IO port ranges [0x10c0, 0x10c2] and [0xb044, 0xb047].
127 * Or else, for a hotplugged-in device, the port IO BAR assigned
128 * by guest OS may conflict with the ranges here.
129 */
130 Device(HP0)
131 {
132 Name(_HID, EISAID("PNP0C02"))
133 Name(_CRS, ResourceTemplate() {
134 IO (Decode16, 0x10c0, 0x10c0, 0x00, 0x03)
135 IO (Decode16, 0xb044, 0xb044, 0x00, 0x04)
136 })
137 }
139 Method (_CRS, 0, NotSerialized)
140 {
141 Name (PRT0, ResourceTemplate ()
142 {
143 /* bus number is from 0 - 255*/
144 WordBusNumber(
145 ResourceProducer, MinFixed, MaxFixed, SubDecode,
146 0x0000,
147 0x0000,
148 0x00FF,
149 0x0000,
150 0x0100)
151 IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
152 WordIO(
153 ResourceProducer, MinFixed, MaxFixed, PosDecode,
154 EntireRange,
155 0x0000,
156 0x0000,
157 0x0CF7,
158 0x0000,
159 0x0CF8)
160 WordIO(
161 ResourceProducer, MinFixed, MaxFixed, PosDecode,
162 EntireRange,
163 0x0000,
164 0x0D00,
165 0xFFFF,
166 0x0000,
167 0xF300)
169 /* reserve memory for pci devices */
170 DWordMemory(
171 ResourceProducer, PosDecode, MinFixed, MaxFixed,
172 Cacheable, ReadWrite,
173 0x00000000,
174 0x000A0000,
175 0x000BFFFF,
176 0x00000000,
177 0x00020000)
179 DWordMemory(
180 ResourceProducer, PosDecode, MinFixed, MaxFixed,
181 Cacheable, ReadWrite,
182 0x00000000,
183 0xF0000000,
184 0xF4FFFFFF,
185 0x00000000,
186 0x05000000,
187 ,, _Y01)
188 })
190 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
191 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MAX, MMAX)
192 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._LEN, MLEN)
194 Store(\_SB.PMIN, MMIN)
195 Store(\_SB.PLEN, MLEN)
196 Add(MMIN, MLEN, MMAX)
197 Subtract(MMAX, One, MMAX)
199 Return (PRT0)
200 }
202 Name(BUFA, ResourceTemplate() {
203 IRQ(Level, ActiveLow, Shared) { 5, 10, 11 }
204 })
206 Name(BUFB, Buffer() {
207 0x23, 0x00, 0x00, 0x18, /* IRQ descriptor */
208 0x79, 0 /* End tag, null checksum */
209 })
211 CreateWordField(BUFB, 0x01, IRQV)
213 Device(LNKA) {
214 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
215 Name(_UID, 1)
217 Method(_STA, 0) {
218 And(PIRA, 0x80, Local0)
219 If(LEqual(Local0, 0x80)) {
220 Return(0x09)
221 } Else {
222 Return(0x0B)
223 }
224 }
226 Method(_PRS) {
227 Return(BUFA)
228 }
230 Method(_DIS) {
231 Or(PIRA, 0x80, PIRA)
232 }
234 Method(_CRS) {
235 And(PIRA, 0x0f, Local0)
236 ShiftLeft(0x1, Local0, IRQV)
237 Return(BUFB)
238 }
240 Method(_SRS, 1) {
241 CreateWordField(ARG0, 0x01, IRQ1)
242 FindSetRightBit(IRQ1, Local0)
243 Decrement(Local0)
244 Store(Local0, PIRA)
245 }
246 }
248 Device(LNKB) {
249 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
250 Name(_UID, 2)
252 Method(_STA, 0) {
253 And(PIRB, 0x80, Local0)
254 If(LEqual(Local0, 0x80)) {
255 Return(0x09)
256 } Else {
257 Return(0x0B)
258 }
259 }
261 Method(_PRS) {
262 Return(BUFA)
263 }
265 Method(_DIS) {
266 Or(PIRB, 0x80, PIRB)
267 }
269 Method(_CRS) {
270 And(PIRB, 0x0f, Local0)
271 ShiftLeft(0x1, Local0, IRQV)
272 Return(BUFB)
273 }
275 Method(_SRS, 1) {
276 CreateWordField(ARG0, 0x01, IRQ1)
277 FindSetRightBit(IRQ1, Local0)
278 Decrement(Local0)
279 Store(Local0, PIRB)
280 }
281 }
283 Device(LNKC) {
284 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
285 Name(_UID, 3)
287 Method(_STA, 0) {
288 And(PIRC, 0x80, Local0)
289 If(LEqual(Local0, 0x80)) {
290 Return(0x09)
291 } Else {
292 Return(0x0B)
293 }
294 }
296 Method(_PRS) {
297 Return(BUFA)
298 }
300 Method(_DIS) {
301 Or(PIRC, 0x80, PIRC)
302 }
304 Method(_CRS) {
305 And(PIRC, 0x0f, Local0)
306 ShiftLeft(0x1, Local0, IRQV)
307 Return(BUFB)
308 }
310 Method(_SRS, 1) {
311 CreateWordField(ARG0, 0x01, IRQ1)
312 FindSetRightBit(IRQ1, Local0)
313 Decrement(Local0)
314 Store(Local0, PIRC)
315 }
316 }
318 Device(LNKD) {
319 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
320 Name(_UID, 4)
322 Method(_STA, 0) {
323 And(PIRD, 0x80, Local0)
324 If(LEqual(Local0, 0x80)) {
325 Return(0x09)
326 } Else {
327 Return(0x0B)
328 }
329 }
331 Method(_PRS) {
332 Return(BUFA)
333 }
335 Method(_DIS) {
336 Or(PIRD, 0x80, PIRD)
337 }
339 Method(_CRS) {
340 And(PIRD, 0x0f, Local0)
341 ShiftLeft(0x1, Local0, IRQV)
342 Return(BUFB)
343 }
345 Method(_SRS, 1) {
346 CreateWordField(ARG0, 0x01, IRQ1)
347 FindSetRightBit(IRQ1, Local0)
348 Decrement(Local0)
349 Store(Local0, PIRD)
350 }
351 }
353 Device(HPET) {
354 Name(_HID, EISAID("PNP0103"))
355 Name(_UID, 0)
356 Method (_STA, 0, NotSerialized) {
357 If(LEqual(\_SB.HPET, 0)) {
358 Return(0x00)
359 } Else {
360 Return(0x0F)
361 }
362 }
363 Name(_CRS, ResourceTemplate() {
364 DWordMemory(
365 ResourceConsumer, PosDecode, MinFixed, MaxFixed,
366 NonCacheable, ReadWrite,
367 0x00000000,
368 0xFED00000,
369 0xFED003FF,
370 0x00000000,
371 0x00000400 /* 1K memory: FED00000 - FED003FF */
372 )
373 })
374 }
376 Method(_PRT,0) {
377 If(PICD) {
378 Return(PRTA)
379 }
380 Return (PRTP)
381 }
383 Name(PRTP, Package() {
384 /* Device 1, INTA - INTD */
385 Package(){0x0001ffff, 0, \_SB.PCI0.LNKB, 0},
386 Package(){0x0001ffff, 1, \_SB.PCI0.LNKC, 0},
387 Package(){0x0001ffff, 2, \_SB.PCI0.LNKD, 0},
388 Package(){0x0001ffff, 3, \_SB.PCI0.LNKA, 0},
390 /* Device 2, INTA - INTD */
391 Package(){0x0002ffff, 0, \_SB.PCI0.LNKC, 0},
392 Package(){0x0002ffff, 1, \_SB.PCI0.LNKD, 0},
393 Package(){0x0002ffff, 2, \_SB.PCI0.LNKA, 0},
394 Package(){0x0002ffff, 3, \_SB.PCI0.LNKB, 0},
396 /* Device 3, INTA - INTD */
397 Package(){0x0003ffff, 0, \_SB.PCI0.LNKD, 0},
398 Package(){0x0003ffff, 1, \_SB.PCI0.LNKA, 0},
399 Package(){0x0003ffff, 2, \_SB.PCI0.LNKB, 0},
400 Package(){0x0003ffff, 3, \_SB.PCI0.LNKC, 0},
402 /* Device 4, INTA - INTD */
403 Package(){0x0004ffff, 0, \_SB.PCI0.LNKA, 0},
404 Package(){0x0004ffff, 1, \_SB.PCI0.LNKB, 0},
405 Package(){0x0004ffff, 2, \_SB.PCI0.LNKC, 0},
406 Package(){0x0004ffff, 3, \_SB.PCI0.LNKD, 0},
408 /* Device 5, INTA - INTD */
409 Package(){0x0005ffff, 0, \_SB.PCI0.LNKB, 0},
410 Package(){0x0005ffff, 1, \_SB.PCI0.LNKC, 0},
411 Package(){0x0005ffff, 2, \_SB.PCI0.LNKD, 0},
412 Package(){0x0005ffff, 3, \_SB.PCI0.LNKA, 0},
414 /* Device 6, INTA - INTD */
415 Package(){0x0006ffff, 0, \_SB.PCI0.LNKC, 0},
416 Package(){0x0006ffff, 1, \_SB.PCI0.LNKD, 0},
417 Package(){0x0006ffff, 2, \_SB.PCI0.LNKA, 0},
418 Package(){0x0006ffff, 3, \_SB.PCI0.LNKB, 0},
420 /* Device 7, INTA - INTD */
421 Package(){0x0007ffff, 0, \_SB.PCI0.LNKD, 0},
422 Package(){0x0007ffff, 1, \_SB.PCI0.LNKA, 0},
423 Package(){0x0007ffff, 2, \_SB.PCI0.LNKB, 0},
424 Package(){0x0007ffff, 3, \_SB.PCI0.LNKC, 0},
426 /* Device 8, INTA - INTD */
427 Package(){0x0008ffff, 0, \_SB.PCI0.LNKA, 0},
428 Package(){0x0008ffff, 1, \_SB.PCI0.LNKB, 0},
429 Package(){0x0008ffff, 2, \_SB.PCI0.LNKC, 0},
430 Package(){0x0008ffff, 3, \_SB.PCI0.LNKD, 0},
432 /* Device 9, INTA - INTD */
433 Package(){0x0009ffff, 0, \_SB.PCI0.LNKB, 0},
434 Package(){0x0009ffff, 1, \_SB.PCI0.LNKC, 0},
435 Package(){0x0009ffff, 2, \_SB.PCI0.LNKD, 0},
436 Package(){0x0009ffff, 3, \_SB.PCI0.LNKA, 0},
438 /* Device 10, INTA - INTD */
439 Package(){0x000affff, 0, \_SB.PCI0.LNKC, 0},
440 Package(){0x000affff, 1, \_SB.PCI0.LNKD, 0},
441 Package(){0x000affff, 2, \_SB.PCI0.LNKA, 0},
442 Package(){0x000affff, 3, \_SB.PCI0.LNKB, 0},
444 /* Device 11, INTA - INTD */
445 Package(){0x000bffff, 0, \_SB.PCI0.LNKD, 0},
446 Package(){0x000bffff, 1, \_SB.PCI0.LNKA, 0},
447 Package(){0x000bffff, 2, \_SB.PCI0.LNKB, 0},
448 Package(){0x000bffff, 3, \_SB.PCI0.LNKC, 0},
450 /* Device 12, INTA - INTD */
451 Package(){0x000cffff, 0, \_SB.PCI0.LNKA, 0},
452 Package(){0x000cffff, 1, \_SB.PCI0.LNKB, 0},
453 Package(){0x000cffff, 2, \_SB.PCI0.LNKC, 0},
454 Package(){0x000cffff, 3, \_SB.PCI0.LNKD, 0},
456 /* Device 13, INTA - INTD */
457 Package(){0x000dffff, 0, \_SB.PCI0.LNKB, 0},
458 Package(){0x000dffff, 1, \_SB.PCI0.LNKC, 0},
459 Package(){0x000dffff, 2, \_SB.PCI0.LNKD, 0},
460 Package(){0x000dffff, 3, \_SB.PCI0.LNKA, 0},
462 /* Device 14, INTA - INTD */
463 Package(){0x000effff, 0, \_SB.PCI0.LNKC, 0},
464 Package(){0x000effff, 1, \_SB.PCI0.LNKD, 0},
465 Package(){0x000effff, 2, \_SB.PCI0.LNKA, 0},
466 Package(){0x000effff, 3, \_SB.PCI0.LNKB, 0},
468 /* Device 15, INTA - INTD */
469 Package(){0x000fffff, 0, \_SB.PCI0.LNKD, 0},
470 Package(){0x000fffff, 1, \_SB.PCI0.LNKA, 0},
471 Package(){0x000fffff, 2, \_SB.PCI0.LNKB, 0},
472 Package(){0x000fffff, 3, \_SB.PCI0.LNKC, 0},
473 })
475 Name(PRTA, Package() {
476 /* Device 1, INTA - INTD */
477 Package(){0x0001ffff, 0, 0, 20},
478 Package(){0x0001ffff, 1, 0, 21},
479 Package(){0x0001ffff, 2, 0, 22},
480 Package(){0x0001ffff, 3, 0, 23},
482 /* Device 2, INTA - INTD */
483 Package(){0x0002ffff, 0, 0, 24},
484 Package(){0x0002ffff, 1, 0, 25},
485 Package(){0x0002ffff, 2, 0, 26},
486 Package(){0x0002ffff, 3, 0, 27},
488 /* Device 3, INTA - INTD */
489 Package(){0x0003ffff, 0, 0, 28},
490 Package(){0x0003ffff, 1, 0, 29},
491 Package(){0x0003ffff, 2, 0, 30},
492 Package(){0x0003ffff, 3, 0, 31},
494 /* Device 4, INTA - INTD */
495 Package(){0x0004ffff, 0, 0, 32},
496 Package(){0x0004ffff, 1, 0, 33},
497 Package(){0x0004ffff, 2, 0, 34},
498 Package(){0x0004ffff, 3, 0, 35},
500 /* Device 5, INTA - INTD */
501 Package(){0x0005ffff, 0, 0, 36},
502 Package(){0x0005ffff, 1, 0, 37},
503 Package(){0x0005ffff, 2, 0, 38},
504 Package(){0x0005ffff, 3, 0, 39},
506 /* Device 6, INTA - INTD */
507 Package(){0x0006ffff, 0, 0, 40},
508 Package(){0x0006ffff, 1, 0, 41},
509 Package(){0x0006ffff, 2, 0, 42},
510 Package(){0x0006ffff, 3, 0, 43},
512 /* Device 7, INTA - INTD */
513 Package(){0x0007ffff, 0, 0, 44},
514 Package(){0x0007ffff, 1, 0, 45},
515 Package(){0x0007ffff, 2, 0, 46},
516 Package(){0x0007ffff, 3, 0, 47},
518 /* Device 8, INTA - INTD */
519 Package(){0x0008ffff, 0, 0, 17},
520 Package(){0x0008ffff, 1, 0, 18},
521 Package(){0x0008ffff, 2, 0, 19},
522 Package(){0x0008ffff, 3, 0, 20},
524 /* Device 9, INTA - INTD */
525 Package(){0x0009ffff, 0, 0, 21},
526 Package(){0x0009ffff, 1, 0, 22},
527 Package(){0x0009ffff, 2, 0, 23},
528 Package(){0x0009ffff, 3, 0, 24},
530 /* Device 10, INTA - INTD */
531 Package(){0x000affff, 0, 0, 25},
532 Package(){0x000affff, 1, 0, 26},
533 Package(){0x000affff, 2, 0, 27},
534 Package(){0x000affff, 3, 0, 28},
536 /* Device 11, INTA - INTD */
537 Package(){0x000bffff, 0, 0, 29},
538 Package(){0x000bffff, 1, 0, 30},
539 Package(){0x000bffff, 2, 0, 31},
540 Package(){0x000bffff, 3, 0, 32},
542 /* Device 12, INTA - INTD */
543 Package(){0x000cffff, 0, 0, 33},
544 Package(){0x000cffff, 1, 0, 34},
545 Package(){0x000cffff, 2, 0, 35},
546 Package(){0x000cffff, 3, 0, 36},
548 /* Device 13, INTA - INTD */
549 Package(){0x000dffff, 0, 0, 37},
550 Package(){0x000dffff, 1, 0, 38},
551 Package(){0x000dffff, 2, 0, 39},
552 Package(){0x000dffff, 3, 0, 40},
554 /* Device 14, INTA - INTD */
555 Package(){0x000effff, 0, 0, 41},
556 Package(){0x000effff, 1, 0, 42},
557 Package(){0x000effff, 2, 0, 43},
558 Package(){0x000effff, 3, 0, 44},
560 /* Device 15, INTA - INTD */
561 Package(){0x000fffff, 0, 0, 45},
562 Package(){0x000fffff, 1, 0, 46},
563 Package(){0x000fffff, 2, 0, 47},
564 Package(){0x000fffff, 3, 0, 16},
565 })
567 Device (ISA)
568 {
569 Name (_ADR, 0x00010000) /* device 1, fn 0 */
571 OperationRegion(PIRQ, PCI_Config, 0x60, 0x4)
572 Scope(\) {
573 Field (\_SB.PCI0.ISA.PIRQ, ByteAcc, NoLock, Preserve) {
574 PIRA, 8,
575 PIRB, 8,
576 PIRC, 8,
577 PIRD, 8
578 }
579 }
580 Device (SYSR)
581 {
582 Name (_HID, EisaId ("PNP0C02"))
583 Name (_UID, 0x01)
584 Name (CRS, ResourceTemplate ()
585 {
586 /* TODO: list hidden resources */
587 IO (Decode16, 0x0010, 0x0010, 0x00, 0x10)
588 IO (Decode16, 0x0022, 0x0022, 0x00, 0x0C)
589 IO (Decode16, 0x0030, 0x0030, 0x00, 0x10)
590 IO (Decode16, 0x0044, 0x0044, 0x00, 0x1C)
591 IO (Decode16, 0x0062, 0x0062, 0x00, 0x02)
592 IO (Decode16, 0x0065, 0x0065, 0x00, 0x0B)
593 IO (Decode16, 0x0072, 0x0072, 0x00, 0x0E)
594 IO (Decode16, 0x0080, 0x0080, 0x00, 0x01)
595 IO (Decode16, 0x0084, 0x0084, 0x00, 0x03)
596 IO (Decode16, 0x0088, 0x0088, 0x00, 0x01)
597 IO (Decode16, 0x008C, 0x008C, 0x00, 0x03)
598 IO (Decode16, 0x0090, 0x0090, 0x00, 0x10)
599 IO (Decode16, 0x00A2, 0x00A2, 0x00, 0x1C)
600 IO (Decode16, 0x00E0, 0x00E0, 0x00, 0x10)
601 IO (Decode16, 0x08A0, 0x08A0, 0x00, 0x04)
602 IO (Decode16, 0x0CC0, 0x0CC0, 0x00, 0x10)
603 IO (Decode16, 0x04D0, 0x04D0, 0x00, 0x02)
604 })
605 Method (_CRS, 0, NotSerialized)
606 {
607 Return (CRS)
608 }
609 }
611 Device (PIC)
612 {
613 Name (_HID, EisaId ("PNP0000"))
614 Name (_CRS, ResourceTemplate ()
615 {
616 IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
617 IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
618 IRQNoFlags () {2}
619 })
620 }
622 Device (DMA0)
623 {
624 Name (_HID, EisaId ("PNP0200"))
625 Name (_CRS, ResourceTemplate ()
626 {
627 DMA (Compatibility, BusMaster, Transfer8) {4}
628 IO (Decode16, 0x0000, 0x0000, 0x00, 0x10)
629 IO (Decode16, 0x0081, 0x0081, 0x00, 0x03)
630 IO (Decode16, 0x0087, 0x0087, 0x00, 0x01)
631 IO (Decode16, 0x0089, 0x0089, 0x00, 0x03)
632 IO (Decode16, 0x008F, 0x008F, 0x00, 0x01)
633 IO (Decode16, 0x00C0, 0x00C0, 0x00, 0x20)
634 IO (Decode16, 0x0480, 0x0480, 0x00, 0x10)
635 })
636 }
638 Device (TMR)
639 {
640 Name (_HID, EisaId ("PNP0100"))
641 Name (_CRS, ResourceTemplate ()
642 {
643 IO (Decode16, 0x0040, 0x0040, 0x00, 0x04)
644 IRQNoFlags () {0}
645 })
646 }
648 Device (RTC)
649 {
650 Name (_HID, EisaId ("PNP0B00"))
651 Name (_CRS, ResourceTemplate ()
652 {
653 IO (Decode16, 0x0070, 0x0070, 0x00, 0x02)
654 IRQNoFlags () {8}
655 })
656 }
658 Device (SPKR)
659 {
660 Name (_HID, EisaId ("PNP0800"))
661 Name (_CRS, ResourceTemplate ()
662 {
663 IO (Decode16, 0x0061, 0x0061, 0x00, 0x01)
664 })
665 }
667 Device (PS2M)
668 {
669 Name (_HID, EisaId ("PNP0F13"))
670 Name (_CID, 0x130FD041)
671 Method (_STA, 0, NotSerialized)
672 {
673 Return (0x0F)
674 }
676 Name (_CRS, ResourceTemplate ()
677 {
678 IRQNoFlags () {12}
679 })
680 }
682 Device (PS2K)
683 {
684 Name (_HID, EisaId ("PNP0303"))
685 Name (_CID, 0x0B03D041)
686 Method (_STA, 0, NotSerialized)
687 {
688 Return (0x0F)
689 }
691 Name (_CRS, ResourceTemplate ()
692 {
693 IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
694 IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
695 IRQNoFlags () {1}
696 })
697 }
699 Device (FDC0)
700 {
701 Name (_HID, EisaId ("PNP0700"))
702 Method (_STA, 0, NotSerialized)
703 {
704 Return (0x0F)
705 }
707 Name (_CRS, ResourceTemplate ()
708 {
709 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
710 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
711 IRQNoFlags () {6}
712 DMA (Compatibility, NotBusMaster, Transfer8) {2}
713 })
714 }
716 Device (UAR1)
717 {
718 Name (_HID, EisaId ("PNP0501"))
719 Name (_UID, 0x01)
720 Method (_STA, 0, NotSerialized)
721 {
722 If(LEqual(\_SB.UAR1, 0)) {
723 Return(0x00)
724 } Else {
725 Return(0x0F)
726 }
727 }
729 Name (_CRS, ResourceTemplate()
730 {
731 IO (Decode16, 0x03F8, 0x03F8, 8, 8)
732 IRQNoFlags () {4}
733 })
734 }
736 Device (UAR2)
737 {
738 Name (_HID, EisaId ("PNP0501"))
739 Name (_UID, 0x02)
740 Method (_STA, 0, NotSerialized)
741 {
742 If(LEqual(\_SB.UAR2, 0)) {
743 Return(0x00)
744 } Else {
745 Return(0x0F)
746 }
747 }
749 Name (_CRS, ResourceTemplate()
750 {
751 IO (Decode16, 0x02F8, 0x02F8, 8, 8)
752 IRQNoFlags () {3}
753 })
754 }
756 Device (LTP1)
757 {
758 Name (_HID, EisaId ("PNP0400"))
759 Name (_UID, 0x02)
760 Method (_STA, 0, NotSerialized)
761 {
762 Return (0x0F)
763 }
765 Name (_CRS, ResourceTemplate()
766 {
767 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
768 IRQNoFlags () {7}
769 })
770 }
771 }
773 /******************************************************************
774 * Each PCI hotplug slot needs at least two methods to handle
775 * the ACPI event:
776 * _EJ0: eject a device
777 * _STA: return a device's status, e.g. enabled or removed
778 * Other methods are optional:
779 * _PS0/3: put them here for debug purpose
780 *
781 * Eject button would generate a general-purpose event, then the
782 * control method for this event uses Notify() to inform OSPM which
783 * action happened and on which device.
784 *
785 * Pls. refer "6.3 Device Insertion, Removal, and Status Objects"
786 * in ACPI spec 3.0b for details.
787 *
788 * QEMU provides a simple hotplug controller with some I/O to
789 * handle the hotplug action and status, which is beyond the ACPI
790 * scope.
791 */
793 Device (S1F0)
794 {
795 Name (_ADR, 0x00060000) /* Dev 6, Func 0 */
796 Name (_SUN, 0x00000001)
798 Method (_PS0, 0)
799 {
800 Store (0x80, \_GPE.DPT2)
801 }
803 Method (_PS3, 0)
804 {
805 Store (0x83, \_GPE.DPT2)
806 }
808 Method (_EJ0, 1)
809 {
810 Store (0x88, \_GPE.DPT2)
811 Store (0x1, \_GPE.PHP1) /* eject php slot 1*/
812 }
814 Method (_STA, 0)
815 {
816 Store (0x89, \_GPE.DPT2)
817 Return ( \_GPE.PHP1 ) /* IN status as the _STA */
818 }
819 }
821 Device (S2F0)
822 {
823 Name (_ADR, 0x00070000) /* Dev 7, Func 0 */
824 Name (_SUN, 0x00000002)
826 Method (_PS0, 0)
827 {
828 Store (0x90, \_GPE.DPT2)
829 }
831 Method (_PS3, 0)
832 {
833 Store (0x93, \_GPE.DPT2)
834 }
836 Method (_EJ0, 1)
837 {
838 Store (0x98, \_GPE.DPT2)
839 Store (0x1, \_GPE.PHP2) /* eject php slot 1*/
840 }
842 Method (_STA, 0)
843 {
844 Store (0x99, \_GPE.DPT2)
845 Return ( \_GPE.PHP2 ) /* IN status as the _STA */
846 }
847 }
848 }
849 }
851 Scope (\_GPE)
852 {
853 OperationRegion (PHP, SystemIO, 0x10c0, 0x03)
854 Field (PHP, ByteAcc, NoLock, Preserve)
855 {
856 PSTA, 8, /* hotplug controller status reg */
857 PHP1, 8, /* hotplug slot 1 control reg */
858 PHP2, 8 /* hotplug slot 2 control reg */
859 }
860 OperationRegion (DG1, SystemIO, 0xb044, 0x04)
861 Field (DG1, ByteAcc, NoLock, Preserve)
862 {
863 DPT1, 8,
864 DPT2, 8
865 }
866 Method (_L03, 0, NotSerialized)
867 {
868 /* detect slot and event(remove/add) */
869 Name (SLT, 0x0)
870 Name (EVT, 0x0)
871 Store (PSTA, Local1)
872 ShiftRight (Local1, 0x4, SLT)
873 And (Local1, 0xf, EVT)
875 /* debug */
876 Store (SLT, DPT1)
877 Store (EVT, DPT2)
879 If ( LEqual(SLT, 0x1) )
880 {
881 Notify (\_SB.PCI0.S1F0, EVT)
882 }
883 ElseIf ( LEqual(SLT, 0x2) )
884 {
885 Notify (\_SB.PCI0.S2F0, EVT)
886 }
887 }
888 }
889 }