ia64/xen-unstable

view tools/firmware/hvmloader/acpi/dsdt.asl @ 17113:746fc8fe9d75

hvmloader/acpi: Simplify Processor Object definitions.

No need to generate the correct number dynamically since
present/not-present can be determined from the MADT. What *is*
required is that we have a Processor Object for every present
processor. We statically declare 16 Objects, which should be plenty
for now.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Feb 25 10:56:23 2008 +0000 (2008-02-25)
parents c6eeb71a85cf
children 89601e8c1701
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, 0x00, 0x0000, 0x00) {}
37 Processor (PR05, 0x01, 0x0000, 0x00) {}
38 Processor (PR06, 0x02, 0x0000, 0x00) {}
39 Processor (PR07, 0x03, 0x0000, 0x00) {}
40 Processor (PR08, 0x00, 0x0000, 0x00) {}
41 Processor (PR09, 0x01, 0x0000, 0x00) {}
42 Processor (PR0A, 0x02, 0x0000, 0x00) {}
43 Processor (PR0B, 0x03, 0x0000, 0x00) {}
44 Processor (PR0C, 0x00, 0x0000, 0x00) {}
45 Processor (PR0D, 0x01, 0x0000, 0x00) {}
46 Processor (PR0E, 0x02, 0x0000, 0x00) {}
47 Processor (PR0F, 0x03, 0x0000, 0x00) {}
48 }
50 /* S4 (STD) and S5 (power-off) type codes: must match piix4 emulation. */
51 Name (\_S4, Package (0x04)
52 {
53 0x06, /* PM1a_CNT.SLP_TYP */
54 0x06, /* PM1b_CNT.SLP_TYP */
55 0x00, /* reserved */
56 0x00 /* reserved */
57 })
58 Name (\_S5, Package (0x04)
59 {
60 0x07, /* PM1a_CNT.SLP_TYP */
61 0x07, /* PM1b_CNT.SLP_TYP */
62 0x00, /* reserved */
63 0x00 /* reserved */
64 })
66 Name(PICD, 0)
67 Method(_PIC, 1)
68 {
69 Store(Arg0, PICD)
70 }
72 Scope (\_SB)
73 {
74 /* ACPI_PHYSICAL_ADDRESS == 0xEA000 */
75 OperationRegion(BIOS, SystemMemory, 0xEA000, 16)
76 Field(BIOS, ByteAcc, NoLock, Preserve) {
77 UAR1, 1,
78 UAR2, 1,
79 HPET, 1,
80 Offset(4),
81 PMIN, 32,
82 PLEN, 32
83 }
85 /* Fix HCT test for 0x400 pci memory:
86 * - need to report low 640 MB mem as motherboard resource
87 */
88 Device(MEM0)
89 {
90 Name(_HID, EISAID("PNP0C02"))
91 Name(_CRS, ResourceTemplate() {
92 QWordMemory(
93 ResourceConsumer, PosDecode, MinFixed,
94 MaxFixed, Cacheable, ReadWrite,
95 0x00000000,
96 0x00000000,
97 0x0009ffff,
98 0x00000000,
99 0x000a0000)
100 })
101 }
103 Device (PCI0)
104 {
105 Name (_HID, EisaId ("PNP0A03"))
106 Name (_UID, 0x00)
107 Name (_ADR, 0x00)
108 Name (_BBN, 0x00)
110 Method (_CRS, 0, NotSerialized)
111 {
112 Name (PRT0, ResourceTemplate ()
113 {
114 /* bus number is from 0 - 255*/
115 WordBusNumber(
116 ResourceProducer, MinFixed, MaxFixed, SubDecode,
117 0x0000,
118 0x0000,
119 0x00FF,
120 0x0000,
121 0x0100)
122 IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
123 WordIO(
124 ResourceProducer, MinFixed, MaxFixed, PosDecode,
125 EntireRange,
126 0x0000,
127 0x0000,
128 0x0CF7,
129 0x0000,
130 0x0CF8)
131 WordIO(
132 ResourceProducer, MinFixed, MaxFixed, PosDecode,
133 EntireRange,
134 0x0000,
135 0x0D00,
136 0xFFFF,
137 0x0000,
138 0xF300)
140 /* reserve memory for pci devices */
141 DWordMemory(
142 ResourceProducer, PosDecode, MinFixed, MaxFixed,
143 Cacheable, ReadWrite,
144 0x00000000,
145 0x000A0000,
146 0x000BFFFF,
147 0x00000000,
148 0x00020000)
150 DWordMemory(
151 ResourceProducer, PosDecode, MinFixed, MaxFixed,
152 Cacheable, ReadWrite,
153 0x00000000,
154 0xF0000000,
155 0xF4FFFFFF,
156 0x00000000,
157 0x05000000,
158 ,, _Y01)
159 })
161 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
162 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MAX, MMAX)
163 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._LEN, MLEN)
165 Store(\_SB.PMIN, MMIN)
166 Store(\_SB.PLEN, MLEN)
167 Add(MMIN, MLEN, MMAX)
168 Subtract(MMAX, One, MMAX)
170 Return (PRT0)
171 }
173 Name(BUFA, ResourceTemplate() {
174 IRQ(Level, ActiveLow, Shared) { 5, 10, 11 }
175 })
177 Name(BUFB, Buffer() {
178 0x23, 0x00, 0x00, 0x18, /* IRQ descriptor */
179 0x79, 0 /* End tag, null checksum */
180 })
182 CreateWordField(BUFB, 0x01, IRQV)
184 Device(LNKA) {
185 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
186 Name(_UID, 1)
188 Method(_STA, 0) {
189 And(PIRA, 0x80, Local0)
190 If(LEqual(Local0, 0x80)) {
191 Return(0x09)
192 } Else {
193 Return(0x0B)
194 }
195 }
197 Method(_PRS) {
198 Return(BUFA)
199 }
201 Method(_DIS) {
202 Or(PIRA, 0x80, PIRA)
203 }
205 Method(_CRS) {
206 And(PIRA, 0x0f, Local0)
207 ShiftLeft(0x1, Local0, IRQV)
208 Return(BUFB)
209 }
211 Method(_SRS, 1) {
212 CreateWordField(ARG0, 0x01, IRQ1)
213 FindSetRightBit(IRQ1, Local0)
214 Decrement(Local0)
215 Store(Local0, PIRA)
216 }
217 }
219 Device(LNKB) {
220 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
221 Name(_UID, 2)
223 Method(_STA, 0) {
224 And(PIRB, 0x80, Local0)
225 If(LEqual(Local0, 0x80)) {
226 Return(0x09)
227 } Else {
228 Return(0x0B)
229 }
230 }
232 Method(_PRS) {
233 Return(BUFA)
234 }
236 Method(_DIS) {
237 Or(PIRB, 0x80, PIRB)
238 }
240 Method(_CRS) {
241 And(PIRB, 0x0f, Local0)
242 ShiftLeft(0x1, Local0, IRQV)
243 Return(BUFB)
244 }
246 Method(_SRS, 1) {
247 CreateWordField(ARG0, 0x01, IRQ1)
248 FindSetRightBit(IRQ1, Local0)
249 Decrement(Local0)
250 Store(Local0, PIRB)
251 }
252 }
254 Device(LNKC) {
255 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
256 Name(_UID, 3)
258 Method(_STA, 0) {
259 And(PIRC, 0x80, Local0)
260 If(LEqual(Local0, 0x80)) {
261 Return(0x09)
262 } Else {
263 Return(0x0B)
264 }
265 }
267 Method(_PRS) {
268 Return(BUFA)
269 }
271 Method(_DIS) {
272 Or(PIRC, 0x80, PIRC)
273 }
275 Method(_CRS) {
276 And(PIRC, 0x0f, Local0)
277 ShiftLeft(0x1, Local0, IRQV)
278 Return(BUFB)
279 }
281 Method(_SRS, 1) {
282 CreateWordField(ARG0, 0x01, IRQ1)
283 FindSetRightBit(IRQ1, Local0)
284 Decrement(Local0)
285 Store(Local0, PIRC)
286 }
287 }
289 Device(LNKD) {
290 Name(_HID, EISAID("PNP0C0F")) /* PCI interrupt link */
291 Name(_UID, 4)
293 Method(_STA, 0) {
294 And(PIRD, 0x80, Local0)
295 If(LEqual(Local0, 0x80)) {
296 Return(0x09)
297 } Else {
298 Return(0x0B)
299 }
300 }
302 Method(_PRS) {
303 Return(BUFA)
304 }
306 Method(_DIS) {
307 Or(PIRD, 0x80, PIRD)
308 }
310 Method(_CRS) {
311 And(PIRD, 0x0f, Local0)
312 ShiftLeft(0x1, Local0, IRQV)
313 Return(BUFB)
314 }
316 Method(_SRS, 1) {
317 CreateWordField(ARG0, 0x01, IRQ1)
318 FindSetRightBit(IRQ1, Local0)
319 Decrement(Local0)
320 Store(Local0, PIRD)
321 }
322 }
324 Device(HPET) {
325 Name(_HID, EISAID("PNP0103"))
326 Name(_UID, 0)
327 Method (_STA, 0, NotSerialized) {
328 If(LEqual(\_SB.HPET, 0)) {
329 Return(0x00)
330 } Else {
331 Return(0x0F)
332 }
333 }
334 Name(_CRS, ResourceTemplate() {
335 DWordMemory(
336 ResourceConsumer, PosDecode, MinFixed, MaxFixed,
337 NonCacheable, ReadWrite,
338 0x00000000,
339 0xFED00000,
340 0xFED003FF,
341 0x00000000,
342 0x00000400 /* 1K memory: FED00000 - FED003FF */
343 )
344 })
345 }
347 Method(_PRT,0) {
348 If(PICD) {
349 Return(PRTA)
350 }
351 Return (PRTP)
352 }
354 Name(PRTP, Package() {
355 /* Device 1, INTA - INTD */
356 Package(){0x0001ffff, 0, \_SB.PCI0.LNKB, 0},
357 Package(){0x0001ffff, 1, \_SB.PCI0.LNKC, 0},
358 Package(){0x0001ffff, 2, \_SB.PCI0.LNKD, 0},
359 Package(){0x0001ffff, 3, \_SB.PCI0.LNKA, 0},
361 /* Device 2, INTA - INTD */
362 Package(){0x0002ffff, 0, \_SB.PCI0.LNKC, 0},
363 Package(){0x0002ffff, 1, \_SB.PCI0.LNKD, 0},
364 Package(){0x0002ffff, 2, \_SB.PCI0.LNKA, 0},
365 Package(){0x0002ffff, 3, \_SB.PCI0.LNKB, 0},
367 /* Device 3, INTA - INTD */
368 Package(){0x0003ffff, 0, \_SB.PCI0.LNKD, 0},
369 Package(){0x0003ffff, 1, \_SB.PCI0.LNKA, 0},
370 Package(){0x0003ffff, 2, \_SB.PCI0.LNKB, 0},
371 Package(){0x0003ffff, 3, \_SB.PCI0.LNKC, 0},
373 /* Device 4, INTA - INTD */
374 Package(){0x0004ffff, 0, \_SB.PCI0.LNKA, 0},
375 Package(){0x0004ffff, 1, \_SB.PCI0.LNKB, 0},
376 Package(){0x0004ffff, 2, \_SB.PCI0.LNKC, 0},
377 Package(){0x0004ffff, 3, \_SB.PCI0.LNKD, 0},
379 /* Device 5, INTA - INTD */
380 Package(){0x0005ffff, 0, \_SB.PCI0.LNKB, 0},
381 Package(){0x0005ffff, 1, \_SB.PCI0.LNKC, 0},
382 Package(){0x0005ffff, 2, \_SB.PCI0.LNKD, 0},
383 Package(){0x0005ffff, 3, \_SB.PCI0.LNKA, 0},
385 /* Device 6, INTA - INTD */
386 Package(){0x0006ffff, 0, \_SB.PCI0.LNKC, 0},
387 Package(){0x0006ffff, 1, \_SB.PCI0.LNKD, 0},
388 Package(){0x0006ffff, 2, \_SB.PCI0.LNKA, 0},
389 Package(){0x0006ffff, 3, \_SB.PCI0.LNKB, 0},
391 /* Device 7, INTA - INTD */
392 Package(){0x0007ffff, 0, \_SB.PCI0.LNKD, 0},
393 Package(){0x0007ffff, 1, \_SB.PCI0.LNKA, 0},
394 Package(){0x0007ffff, 2, \_SB.PCI0.LNKB, 0},
395 Package(){0x0007ffff, 3, \_SB.PCI0.LNKC, 0},
397 /* Device 8, INTA - INTD */
398 Package(){0x0008ffff, 0, \_SB.PCI0.LNKA, 0},
399 Package(){0x0008ffff, 1, \_SB.PCI0.LNKB, 0},
400 Package(){0x0008ffff, 2, \_SB.PCI0.LNKC, 0},
401 Package(){0x0008ffff, 3, \_SB.PCI0.LNKD, 0},
403 /* Device 9, INTA - INTD */
404 Package(){0x0009ffff, 0, \_SB.PCI0.LNKB, 0},
405 Package(){0x0009ffff, 1, \_SB.PCI0.LNKC, 0},
406 Package(){0x0009ffff, 2, \_SB.PCI0.LNKD, 0},
407 Package(){0x0009ffff, 3, \_SB.PCI0.LNKA, 0},
409 /* Device 10, INTA - INTD */
410 Package(){0x000affff, 0, \_SB.PCI0.LNKC, 0},
411 Package(){0x000affff, 1, \_SB.PCI0.LNKD, 0},
412 Package(){0x000affff, 2, \_SB.PCI0.LNKA, 0},
413 Package(){0x000affff, 3, \_SB.PCI0.LNKB, 0},
415 /* Device 11, INTA - INTD */
416 Package(){0x000bffff, 0, \_SB.PCI0.LNKD, 0},
417 Package(){0x000bffff, 1, \_SB.PCI0.LNKA, 0},
418 Package(){0x000bffff, 2, \_SB.PCI0.LNKB, 0},
419 Package(){0x000bffff, 3, \_SB.PCI0.LNKC, 0},
421 /* Device 12, INTA - INTD */
422 Package(){0x000cffff, 0, \_SB.PCI0.LNKA, 0},
423 Package(){0x000cffff, 1, \_SB.PCI0.LNKB, 0},
424 Package(){0x000cffff, 2, \_SB.PCI0.LNKC, 0},
425 Package(){0x000cffff, 3, \_SB.PCI0.LNKD, 0},
427 /* Device 13, INTA - INTD */
428 Package(){0x000dffff, 0, \_SB.PCI0.LNKB, 0},
429 Package(){0x000dffff, 1, \_SB.PCI0.LNKC, 0},
430 Package(){0x000dffff, 2, \_SB.PCI0.LNKD, 0},
431 Package(){0x000dffff, 3, \_SB.PCI0.LNKA, 0},
433 /* Device 14, INTA - INTD */
434 Package(){0x000effff, 0, \_SB.PCI0.LNKC, 0},
435 Package(){0x000effff, 1, \_SB.PCI0.LNKD, 0},
436 Package(){0x000effff, 2, \_SB.PCI0.LNKA, 0},
437 Package(){0x000effff, 3, \_SB.PCI0.LNKB, 0},
439 /* Device 15, INTA - INTD */
440 Package(){0x000fffff, 0, \_SB.PCI0.LNKD, 0},
441 Package(){0x000fffff, 1, \_SB.PCI0.LNKA, 0},
442 Package(){0x000fffff, 2, \_SB.PCI0.LNKB, 0},
443 Package(){0x000fffff, 3, \_SB.PCI0.LNKC, 0},
444 })
446 Name(PRTA, Package() {
447 /* Device 1, INTA - INTD */
448 Package(){0x0001ffff, 0, 0, 20},
449 Package(){0x0001ffff, 1, 0, 21},
450 Package(){0x0001ffff, 2, 0, 22},
451 Package(){0x0001ffff, 3, 0, 23},
453 /* Device 2, INTA - INTD */
454 Package(){0x0002ffff, 0, 0, 24},
455 Package(){0x0002ffff, 1, 0, 25},
456 Package(){0x0002ffff, 2, 0, 26},
457 Package(){0x0002ffff, 3, 0, 27},
459 /* Device 3, INTA - INTD */
460 Package(){0x0003ffff, 0, 0, 28},
461 Package(){0x0003ffff, 1, 0, 29},
462 Package(){0x0003ffff, 2, 0, 30},
463 Package(){0x0003ffff, 3, 0, 31},
465 /* Device 4, INTA - INTD */
466 Package(){0x0004ffff, 0, 0, 32},
467 Package(){0x0004ffff, 1, 0, 33},
468 Package(){0x0004ffff, 2, 0, 34},
469 Package(){0x0004ffff, 3, 0, 35},
471 /* Device 5, INTA - INTD */
472 Package(){0x0005ffff, 0, 0, 36},
473 Package(){0x0005ffff, 1, 0, 37},
474 Package(){0x0005ffff, 2, 0, 38},
475 Package(){0x0005ffff, 3, 0, 39},
477 /* Device 6, INTA - INTD */
478 Package(){0x0006ffff, 0, 0, 40},
479 Package(){0x0006ffff, 1, 0, 41},
480 Package(){0x0006ffff, 2, 0, 42},
481 Package(){0x0006ffff, 3, 0, 43},
483 /* Device 7, INTA - INTD */
484 Package(){0x0007ffff, 0, 0, 44},
485 Package(){0x0007ffff, 1, 0, 45},
486 Package(){0x0007ffff, 2, 0, 46},
487 Package(){0x0007ffff, 3, 0, 47},
489 /* Device 8, INTA - INTD */
490 Package(){0x0008ffff, 0, 0, 17},
491 Package(){0x0008ffff, 1, 0, 18},
492 Package(){0x0008ffff, 2, 0, 19},
493 Package(){0x0008ffff, 3, 0, 20},
495 /* Device 9, INTA - INTD */
496 Package(){0x0009ffff, 0, 0, 21},
497 Package(){0x0009ffff, 1, 0, 22},
498 Package(){0x0009ffff, 2, 0, 23},
499 Package(){0x0009ffff, 3, 0, 24},
501 /* Device 10, INTA - INTD */
502 Package(){0x000affff, 0, 0, 25},
503 Package(){0x000affff, 1, 0, 26},
504 Package(){0x000affff, 2, 0, 27},
505 Package(){0x000affff, 3, 0, 28},
507 /* Device 11, INTA - INTD */
508 Package(){0x000bffff, 0, 0, 29},
509 Package(){0x000bffff, 1, 0, 30},
510 Package(){0x000bffff, 2, 0, 31},
511 Package(){0x000bffff, 3, 0, 32},
513 /* Device 12, INTA - INTD */
514 Package(){0x000cffff, 0, 0, 33},
515 Package(){0x000cffff, 1, 0, 34},
516 Package(){0x000cffff, 2, 0, 35},
517 Package(){0x000cffff, 3, 0, 36},
519 /* Device 13, INTA - INTD */
520 Package(){0x000dffff, 0, 0, 37},
521 Package(){0x000dffff, 1, 0, 38},
522 Package(){0x000dffff, 2, 0, 39},
523 Package(){0x000dffff, 3, 0, 40},
525 /* Device 14, INTA - INTD */
526 Package(){0x000effff, 0, 0, 41},
527 Package(){0x000effff, 1, 0, 42},
528 Package(){0x000effff, 2, 0, 43},
529 Package(){0x000effff, 3, 0, 44},
531 /* Device 15, INTA - INTD */
532 Package(){0x000fffff, 0, 0, 45},
533 Package(){0x000fffff, 1, 0, 46},
534 Package(){0x000fffff, 2, 0, 47},
535 Package(){0x000fffff, 3, 0, 16},
536 })
538 Device (ISA)
539 {
540 Name (_ADR, 0x00010000) /* device 1, fn 0 */
542 OperationRegion(PIRQ, PCI_Config, 0x60, 0x4)
543 Scope(\) {
544 Field (\_SB.PCI0.ISA.PIRQ, ByteAcc, NoLock, Preserve) {
545 PIRA, 8,
546 PIRB, 8,
547 PIRC, 8,
548 PIRD, 8
549 }
550 }
551 Device (SYSR)
552 {
553 Name (_HID, EisaId ("PNP0C02"))
554 Name (_UID, 0x01)
555 Name (CRS, ResourceTemplate ()
556 {
557 /* TODO: list hidden resources */
558 IO (Decode16, 0x0010, 0x0010, 0x00, 0x10)
559 IO (Decode16, 0x0022, 0x0022, 0x00, 0x0C)
560 IO (Decode16, 0x0030, 0x0030, 0x00, 0x10)
561 IO (Decode16, 0x0044, 0x0044, 0x00, 0x1C)
562 IO (Decode16, 0x0062, 0x0062, 0x00, 0x02)
563 IO (Decode16, 0x0065, 0x0065, 0x00, 0x0B)
564 IO (Decode16, 0x0072, 0x0072, 0x00, 0x0E)
565 IO (Decode16, 0x0080, 0x0080, 0x00, 0x01)
566 IO (Decode16, 0x0084, 0x0084, 0x00, 0x03)
567 IO (Decode16, 0x0088, 0x0088, 0x00, 0x01)
568 IO (Decode16, 0x008C, 0x008C, 0x00, 0x03)
569 IO (Decode16, 0x0090, 0x0090, 0x00, 0x10)
570 IO (Decode16, 0x00A2, 0x00A2, 0x00, 0x1C)
571 IO (Decode16, 0x00E0, 0x00E0, 0x00, 0x10)
572 IO (Decode16, 0x08A0, 0x08A0, 0x00, 0x04)
573 IO (Decode16, 0x0CC0, 0x0CC0, 0x00, 0x10)
574 IO (Decode16, 0x04D0, 0x04D0, 0x00, 0x02)
575 })
576 Method (_CRS, 0, NotSerialized)
577 {
578 Return (CRS)
579 }
580 }
582 Device (PIC)
583 {
584 Name (_HID, EisaId ("PNP0000"))
585 Name (_CRS, ResourceTemplate ()
586 {
587 IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
588 IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
589 IRQNoFlags () {2}
590 })
591 }
593 Device (DMA0)
594 {
595 Name (_HID, EisaId ("PNP0200"))
596 Name (_CRS, ResourceTemplate ()
597 {
598 DMA (Compatibility, BusMaster, Transfer8) {4}
599 IO (Decode16, 0x0000, 0x0000, 0x00, 0x10)
600 IO (Decode16, 0x0081, 0x0081, 0x00, 0x03)
601 IO (Decode16, 0x0087, 0x0087, 0x00, 0x01)
602 IO (Decode16, 0x0089, 0x0089, 0x00, 0x03)
603 IO (Decode16, 0x008F, 0x008F, 0x00, 0x01)
604 IO (Decode16, 0x00C0, 0x00C0, 0x00, 0x20)
605 IO (Decode16, 0x0480, 0x0480, 0x00, 0x10)
606 })
607 }
609 Device (TMR)
610 {
611 Name (_HID, EisaId ("PNP0100"))
612 Name (_CRS, ResourceTemplate ()
613 {
614 IO (Decode16, 0x0040, 0x0040, 0x00, 0x04)
615 IRQNoFlags () {0}
616 })
617 }
619 Device (RTC)
620 {
621 Name (_HID, EisaId ("PNP0B00"))
622 Name (_CRS, ResourceTemplate ()
623 {
624 IO (Decode16, 0x0070, 0x0070, 0x00, 0x02)
625 IRQNoFlags () {8}
626 })
627 }
629 Device (SPKR)
630 {
631 Name (_HID, EisaId ("PNP0800"))
632 Name (_CRS, ResourceTemplate ()
633 {
634 IO (Decode16, 0x0061, 0x0061, 0x00, 0x01)
635 })
636 }
638 Device (PS2M)
639 {
640 Name (_HID, EisaId ("PNP0F13"))
641 Name (_CID, 0x130FD041)
642 Method (_STA, 0, NotSerialized)
643 {
644 Return (0x0F)
645 }
647 Name (_CRS, ResourceTemplate ()
648 {
649 IRQNoFlags () {12}
650 })
651 }
653 Device (PS2K)
654 {
655 Name (_HID, EisaId ("PNP0303"))
656 Name (_CID, 0x0B03D041)
657 Method (_STA, 0, NotSerialized)
658 {
659 Return (0x0F)
660 }
662 Name (_CRS, ResourceTemplate ()
663 {
664 IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
665 IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
666 IRQNoFlags () {1}
667 })
668 }
670 Device (FDC0)
671 {
672 Name (_HID, EisaId ("PNP0700"))
673 Method (_STA, 0, NotSerialized)
674 {
675 Return (0x0F)
676 }
678 Name (_CRS, ResourceTemplate ()
679 {
680 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
681 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
682 IRQNoFlags () {6}
683 DMA (Compatibility, NotBusMaster, Transfer8) {2}
684 })
685 }
687 Device (UAR1)
688 {
689 Name (_HID, EisaId ("PNP0501"))
690 Name (_UID, 0x01)
691 Method (_STA, 0, NotSerialized)
692 {
693 If(LEqual(\_SB.UAR1, 0)) {
694 Return(0x00)
695 } Else {
696 Return(0x0F)
697 }
698 }
700 Name (_CRS, ResourceTemplate()
701 {
702 IO (Decode16, 0x03F8, 0x03F8, 8, 8)
703 IRQNoFlags () {4}
704 })
705 }
707 Device (UAR2)
708 {
709 Name (_HID, EisaId ("PNP0501"))
710 Name (_UID, 0x02)
711 Method (_STA, 0, NotSerialized)
712 {
713 If(LEqual(\_SB.UAR2, 0)) {
714 Return(0x00)
715 } Else {
716 Return(0x0F)
717 }
718 }
720 Name (_CRS, ResourceTemplate()
721 {
722 IO (Decode16, 0x02F8, 0x02F8, 8, 8)
723 IRQNoFlags () {3}
724 })
725 }
727 Device (LTP1)
728 {
729 Name (_HID, EisaId ("PNP0400"))
730 Name (_UID, 0x02)
731 Method (_STA, 0, NotSerialized)
732 {
733 Return (0x0F)
734 }
736 Name (_CRS, ResourceTemplate()
737 {
738 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
739 IRQNoFlags () {7}
740 })
741 }
742 }
744 /******************************************************************
745 * Each PCI hotplug slot needs at least two methods to handle
746 * the ACPI event:
747 * _EJ0: eject a device
748 * _STA: return a device's status, e.g. enabled or removed
749 * Other methods are optional:
750 * _PS0/3: put them here for debug purpose
751 *
752 * Eject button would generate a general-purpose event, then the
753 * control method for this event uses Notify() to inform OSPM which
754 * action happened and on which device.
755 *
756 * Pls. refer "6.3 Device Insertion, Removal, and Status Objects"
757 * in ACPI spec 3.0b for details.
758 *
759 * QEMU provides a simple hotplug controller with some I/O to
760 * handle the hotplug action and status, which is beyond the ACPI
761 * scope.
762 */
764 Device (S1F0)
765 {
766 Name (_ADR, 0x00060000) /* Dev 6, Func 0 */
767 Name (_SUN, 0x00000001)
769 Method (_PS0, 0)
770 {
771 Store (0x80, \_GPE.DPT2)
772 }
774 Method (_PS3, 0)
775 {
776 Store (0x83, \_GPE.DPT2)
777 }
779 Method (_EJ0, 1)
780 {
781 Store (0x88, \_GPE.DPT2)
782 Store (0x1, \_GPE.PHP1) /* eject php slot 1*/
783 }
785 Method (_STA, 0)
786 {
787 Store (0x89, \_GPE.DPT2)
788 Return ( \_GPE.PHP1 ) /* IN status as the _STA */
789 }
790 }
792 Device (S2F0)
793 {
794 Name (_ADR, 0x00070000) /* Dev 7, Func 0 */
795 Name (_SUN, 0x00000002)
797 Method (_PS0, 0)
798 {
799 Store (0x90, \_GPE.DPT2)
800 }
802 Method (_PS3, 0)
803 {
804 Store (0x93, \_GPE.DPT2)
805 }
807 Method (_EJ0, 1)
808 {
809 Store (0x98, \_GPE.DPT2)
810 Store (0x1, \_GPE.PHP2) /* eject php slot 1*/
811 }
813 Method (_STA, 0)
814 {
815 Store (0x99, \_GPE.DPT2)
816 Return ( \_GPE.PHP2 ) /* IN status as the _STA */
817 }
818 }
819 }
820 }
822 Scope (\_GPE)
823 {
824 OperationRegion (PHP, SystemIO, 0x10c0, 0x03)
825 Field (PHP, ByteAcc, NoLock, Preserve)
826 {
827 PSTA, 8, /* hotplug controller status reg */
828 PHP1, 8, /* hotplug slot 1 control reg */
829 PHP2, 8 /* hotplug slot 2 control reg */
830 }
831 OperationRegion (DG1, SystemIO, 0xb044, 0x04)
832 Field (DG1, ByteAcc, NoLock, Preserve)
833 {
834 DPT1, 8,
835 DPT2, 8
836 }
837 Method (_L03, 0, NotSerialized)
838 {
839 /* detect slot and event(remove/add) */
840 Name (SLT, 0x0)
841 Name (EVT, 0x0)
842 Store (PSTA, Local1)
843 ShiftRight (Local1, 0x4, SLT)
844 And (Local1, 0xf, EVT)
846 /* debug */
847 Store (SLT, DPT1)
848 Store (EVT, DPT2)
850 If ( LEqual(SLT, 0x1) )
851 {
852 Notify (\_SB.PCI0.S1F0, EVT)
853 }
854 ElseIf ( LEqual(SLT, 0x2) )
855 {
856 Notify (\_SB.PCI0.S2F0, EVT)
857 }
858 }
859 }
860 }