VirtualBox

source: vbox/trunk/src/VBox/Devices/PC/vbox.dsl@ 4612

Last change on this file since 4612 was 4076, checked in by vboxsync, 17 years ago

Two more manual license fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 28.7 KB
Line 
1// $Id: vbox.dsl 4076 2007-08-07 17:16:51Z vboxsync $
2/// @file
3//
4// VirtualBox ACPI
5//
6// Copyright (C) 2006-2007 innotek GmbH
7//
8// This file is part of VirtualBox Open Source Edition (OSE), as
9// available from http://www.virtualbox.org. This file is free software;
10// you can redistribute it and/or modify it under the terms of the GNU
11// General Public License as published by the Free Software Foundation,
12// in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13// distribution. VirtualBox OSE is distributed in the hope that it will
14// be useful, but WITHOUT ANY WARRANTY of any kind.
15//
16
17DefinitionBlock ("DSDT.aml", "DSDT", 1, "VBOX ", "VBOXBIOS", 2)
18{
19 // Declare debugging ports withing SystemIO
20 OperationRegion(DBG0, SystemIO, 0x3000, 4)
21
22 // Writes to this field Will dump hex char
23 Field (DBG0, ByteAcc, NoLock, Preserve)
24 {
25 DHE1, 8,
26 }
27
28 // Writes to this field Will dump hex word
29 Field (DBG0, WordAcc, NoLock, Preserve)
30 {
31 DHE2, 16,
32 }
33
34 // Writes to this field Will dump hex double word
35 Field (DBG0, DWordAcc, NoLock, Preserve)
36 {
37 DHE4, 32,
38 }
39
40 // Writes to this field will dump ascii char
41 Field (DBG0, ByteAcc, NoLock, Preserve)
42 {
43 Offset (1),
44 DCHR, 8
45 }
46
47 // Shortcuts
48 Method(HEX, 1)
49 {
50 Store (Arg0, DHE1)
51 }
52
53 Method(HEX2, 1)
54 {
55 Store (Arg0, DHE2)
56 }
57
58 Method(HEX4, 1)
59 {
60 Store (Arg0, DHE4)
61 }
62
63 // Code from Microsoft sample
64 // http://www.microsoft.com/whdc/system/pnppwr/powermgmt/_OSI-method.mspx
65
66 //
67 // SLEN(Str) - Returns the length of Str (excluding NULL).
68 //
69 Method(SLEN, 1)
70 {
71 //
72 // Note: The caller must make sure that the argument is a string object.
73 //
74 Store(Arg0, Local0)
75 Return(Sizeof(Local0))
76 }
77
78 Method(S2BF, 1)
79 {
80 //
81 // Note: The caller must make sure that the argument is a string object.
82 //
83 // Local0 contains length of string + NULL.
84 //
85 Store(Arg0, Local0)
86 Add(SLEN(Local0), One, Local0)
87 //
88 // Convert the string object into a buffer object.
89 //
90 Name(BUFF, Buffer(Local0) {})
91 Store(Arg0, BUFF)
92 Return(BUFF)
93 }
94
95 // Convert ASCII string to buffer and store it's contents (char by
96 // char) into DCHR (thus possibly writing the string to console)
97 Method (\DBG, 1, NotSerialized)
98 {
99 Store(Arg0, Local0)
100 Store(S2BF (Local0), Local1)
101 Store(SizeOf (Local1), Local0)
102 Decrement (Local0)
103 Store(Zero, Local2)
104 While (Local0)
105 {
106 Decrement (Local0)
107 Store (DerefOf (Index (Local1, Local2)), DCHR)
108 Increment (Local2)
109 }
110 }
111
112 Name(PICM, 0)
113 Method(_PIC, 1)
114 {
115 DBG ("Pic mode: ")
116 HEX4 (Arg0)
117 Store (Arg0, PICM)
118 }
119
120 // Processor object
121 // #1463: Showing the CPU can make the guest do bad things on it like SpeedStep.
122 // In this case, XP SP2 contains this buggy Intelppm.sys driver which wants to mess
123 // with SpeedStep if it finds a CPU object and when it finds out that it can't, it
124 // tries to unload and crashes (MS probably never tested this code path).
125// Scope (\_PR)
126// {
127// Processor (CPU1, 0x01, 0x00000000, 0x00) {}
128// }
129
130 Scope (\_SB)
131 {
132 OperationRegion (SYSI, SystemIO, 0x4048, 0x08)
133 Field (SYSI, DwordAcc, NoLock, Preserve)
134 {
135 IDX0, 32,
136 DAT0, 32,
137 }
138
139 IndexField (IDX0, DAT0, DwordAcc, NoLock, Preserve)
140 {
141 MEML, 32,
142 UIOA, 32,
143 Offset (0x80),
144 ININ, 32,
145 Offset (0x200),
146 VAIN, 32,
147 }
148
149 Method (_INI, 0, NotSerialized)
150 {
151 Store (0xbadc0de, VAIN)
152 DBG ("MEML: ")
153 HEX4 (MEML)
154 DBG ("UIOA: ")
155 HEX4 (UIOA)
156 }
157
158 // PCI PIC IRQ Routing table
159 // Must match pci.c:pci_slot_get_pirq
160 Name (PR00, Package ()
161 {
162 Package (0x04) {0x0002FFFF, 0x00, LNKB, 0x00,},
163 Package (0x04) {0x0002FFFF, 0x01, LNKC, 0x00,},
164 Package (0x04) {0x0002FFFF, 0x02, LNKD, 0x00,},
165 Package (0x04) {0x0002FFFF, 0x03, LNKA, 0x00,},
166 Package (0x04) {0x0003FFFF, 0x00, LNKC, 0x00,},
167 Package (0x04) {0x0003FFFF, 0x01, LNKD, 0x00,},
168 Package (0x04) {0x0003FFFF, 0x02, LNKA, 0x00,},
169 Package (0x04) {0x0003FFFF, 0x03, LNKB, 0x00,},
170 Package (0x04) {0x0004FFFF, 0x00, LNKD, 0x00,},
171 Package (0x04) {0x0004FFFF, 0x01, LNKA, 0x00,},
172 Package (0x04) {0x0004FFFF, 0x02, LNKB, 0x00,},
173 Package (0x04) {0x0004FFFF, 0x03, LNKC, 0x00,},
174 Package (0x04) {0x0005FFFF, 0x00, LNKA, 0x00,},
175 Package (0x04) {0x0005FFFF, 0x01, LNKB, 0x00,},
176 Package (0x04) {0x0005FFFF, 0x02, LNKC, 0x00,},
177 Package (0x04) {0x0005FFFF, 0x03, LNKD, 0x00,},
178 Package (0x04) {0x0006FFFF, 0x00, LNKB, 0x00,},
179 Package (0x04) {0x0006FFFF, 0x01, LNKC, 0x00,},
180 Package (0x04) {0x0006FFFF, 0x02, LNKD, 0x00,},
181 Package (0x04) {0x0006FFFF, 0x03, LNKA, 0x00,},
182 Package (0x04) {0x0007FFFF, 0x00, LNKC, 0x00,},
183 Package (0x04) {0x0007FFFF, 0x01, LNKD, 0x00,},
184 Package (0x04) {0x0007FFFF, 0x02, LNKA, 0x00,},
185 Package (0x04) {0x0007FFFF, 0x03, LNKB, 0x00,},
186 Package (0x04) {0x0008FFFF, 0x00, LNKD, 0x00,},
187 Package (0x04) {0x0008FFFF, 0x01, LNKA, 0x00,},
188 Package (0x04) {0x0008FFFF, 0x02, LNKB, 0x00,},
189 Package (0x04) {0x0008FFFF, 0x03, LNKC, 0x00,},
190 Package (0x04) {0x0009FFFF, 0x00, LNKA, 0x00,},
191 Package (0x04) {0x0009FFFF, 0x01, LNKB, 0x00,},
192 Package (0x04) {0x0009FFFF, 0x02, LNKC, 0x00,},
193 Package (0x04) {0x0009FFFF, 0x03, LNKD, 0x00,},
194 Package (0x04) {0x000AFFFF, 0x00, LNKB, 0x00,},
195 Package (0x04) {0x000AFFFF, 0x01, LNKC, 0x00,},
196 Package (0x04) {0x000AFFFF, 0x02, LNKD, 0x00,},
197 Package (0x04) {0x000AFFFF, 0x03, LNKA, 0x00,},
198 Package (0x04) {0x000BFFFF, 0x00, LNKC, 0x00,},
199 Package (0x04) {0x000BFFFF, 0x01, LNKD, 0x00,},
200 Package (0x04) {0x000BFFFF, 0x02, LNKA, 0x00,},
201 Package (0x04) {0x000BFFFF, 0x03, LNKB, 0x00,},
202 Package (0x04) {0x000CFFFF, 0x00, LNKD, 0x00,},
203 Package (0x04) {0x000CFFFF, 0x01, LNKA, 0x00,},
204 Package (0x04) {0x000CFFFF, 0x02, LNKB, 0x00,},
205 Package (0x04) {0x000CFFFF, 0x03, LNKC, 0x00,},
206 Package (0x04) {0x000DFFFF, 0x00, LNKA, 0x00,},
207 Package (0x04) {0x000DFFFF, 0x01, LNKB, 0x00,},
208 Package (0x04) {0x000DFFFF, 0x02, LNKC, 0x00,},
209 Package (0x04) {0x000DFFFF, 0x03, LNKD, 0x00,},
210 Package (0x04) {0x000EFFFF, 0x00, LNKB, 0x00,},
211 Package (0x04) {0x000EFFFF, 0x01, LNKC, 0x00,},
212 Package (0x04) {0x000EFFFF, 0x02, LNKD, 0x00,},
213 Package (0x04) {0x000EFFFF, 0x03, LNKA, 0x00,},
214 Package (0x04) {0x000FFFFF, 0x00, LNKC, 0x00,},
215 Package (0x04) {0x000FFFFF, 0x01, LNKD, 0x00,},
216 Package (0x04) {0x000FFFFF, 0x02, LNKA, 0x00,},
217 Package (0x04) {0x000FFFFF, 0x03, LNKB, 0x00,}
218 })
219
220 // PCI I/O APIC IRQ Routing table
221 // Must match pci.c:pci_slot_get_acpi_pirq
222 Name (PR01, Package ()
223 {
224 Package (0x04) {0x0002FFFF, 0x00, 0x00, 0x12,},
225 Package (0x04) {0x0002FFFF, 0x01, 0x00, 0x13,},
226 Package (0x04) {0x0002FFFF, 0x02, 0x00, 0x14,},
227 Package (0x04) {0x0002FFFF, 0x03, 0x00, 0x15,},
228 Package (0x04) {0x0003FFFF, 0x00, 0x00, 0x13,},
229 Package (0x04) {0x0003FFFF, 0x01, 0x00, 0x14,},
230 Package (0x04) {0x0003FFFF, 0x02, 0x00, 0x15,},
231 Package (0x04) {0x0003FFFF, 0x03, 0x00, 0x16,},
232 Package (0x04) {0x0004FFFF, 0x00, 0x00, 0x14,},
233 Package (0x04) {0x0004FFFF, 0x01, 0x00, 0x15,},
234 Package (0x04) {0x0004FFFF, 0x02, 0x00, 0x16,},
235 Package (0x04) {0x0004FFFF, 0x03, 0x00, 0x17,},
236 Package (0x04) {0x0005FFFF, 0x00, 0x00, 0x15,},
237 Package (0x04) {0x0005FFFF, 0x01, 0x00, 0x16,},
238 Package (0x04) {0x0005FFFF, 0x02, 0x00, 0x17,},
239 Package (0x04) {0x0005FFFF, 0x03, 0x00, 0x10,},
240 Package (0x04) {0x0006FFFF, 0x00, 0x00, 0x16,},
241 Package (0x04) {0x0006FFFF, 0x01, 0x00, 0x17,},
242 Package (0x04) {0x0006FFFF, 0x02, 0x00, 0x10,},
243 Package (0x04) {0x0006FFFF, 0x03, 0x00, 0x11,},
244 Package (0x04) {0x0007FFFF, 0x00, 0x00, 0x17,},
245 Package (0x04) {0x0007FFFF, 0x01, 0x00, 0x10,},
246 Package (0x04) {0x0007FFFF, 0x02, 0x00, 0x11,},
247 Package (0x04) {0x0007FFFF, 0x03, 0x00, 0x12,},
248 Package (0x04) {0x0008FFFF, 0x00, 0x00, 0x10,},
249 Package (0x04) {0x0008FFFF, 0x01, 0x00, 0x11,},
250 Package (0x04) {0x0008FFFF, 0x02, 0x00, 0x12,},
251 Package (0x04) {0x0008FFFF, 0x03, 0x00, 0x13,},
252 Package (0x04) {0x0009FFFF, 0x00, 0x00, 0x11,},
253 Package (0x04) {0x0009FFFF, 0x01, 0x00, 0x12,},
254 Package (0x04) {0x0009FFFF, 0x02, 0x00, 0x13,},
255 Package (0x04) {0x0009FFFF, 0x03, 0x00, 0x14,},
256 Package (0x04) {0x000AFFFF, 0x00, 0x00, 0x12,},
257 Package (0x04) {0x000AFFFF, 0x01, 0x00, 0x13,},
258 Package (0x04) {0x000AFFFF, 0x02, 0x00, 0x14,},
259 Package (0x04) {0x000AFFFF, 0x03, 0x00, 0x15,},
260 Package (0x04) {0x000BFFFF, 0x00, 0x00, 0x13,},
261 Package (0x04) {0x000BFFFF, 0x01, 0x00, 0x14,},
262 Package (0x04) {0x000BFFFF, 0x02, 0x00, 0x15,},
263 Package (0x04) {0x000BFFFF, 0x03, 0x00, 0x16,},
264 Package (0x04) {0x000CFFFF, 0x00, 0x00, 0x14,},
265 Package (0x04) {0x000CFFFF, 0x01, 0x00, 0x15,},
266 Package (0x04) {0x000CFFFF, 0x02, 0x00, 0x16,},
267 Package (0x04) {0x000CFFFF, 0x03, 0x00, 0x17,},
268 Package (0x04) {0x000DFFFF, 0x00, 0x00, 0x15,},
269 Package (0x04) {0x000DFFFF, 0x01, 0x00, 0x16,},
270 Package (0x04) {0x000DFFFF, 0x02, 0x00, 0x17,},
271 Package (0x04) {0x000DFFFF, 0x03, 0x00, 0x10,},
272 Package (0x04) {0x000EFFFF, 0x00, 0x00, 0x16,},
273 Package (0x04) {0x000EFFFF, 0x01, 0x00, 0x17,},
274 Package (0x04) {0x000EFFFF, 0x02, 0x00, 0x10,},
275 Package (0x04) {0x000EFFFF, 0x03, 0x00, 0x11,},
276 Package (0x04) {0x000FFFFF, 0x00, 0x00, 0x17,},
277 Package (0x04) {0x000FFFFF, 0x01, 0x00, 0x10,},
278 Package (0x04) {0x000FFFFF, 0x02, 0x00, 0x11,},
279 Package (0x04) {0x000FFFFF, 0x03, 0x00, 0x12,}
280 })
281
282 // Possible resource settings for PCI link A
283 Name (PRSA, ResourceTemplate ()
284 {
285 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
286 })
287
288 // Possible resource settings for PCI link B
289 Name (PRSB, ResourceTemplate ()
290 {
291 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
292 })
293
294 // Possible resource settings for PCI link C
295 Name (PRSC, ResourceTemplate ()
296 {
297 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
298 })
299
300 // Possible resource settings for PCI link D
301 Name (PRSD, ResourceTemplate ()
302 {
303 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
304 })
305
306 // PCI bus 0
307 Device (PCI0)
308 {
309 Name (_HID, EisaId ("PNP0A03"))
310 Name (_ADR, 0x00) // address
311 Name (_BBN, 0x00) // base bus adddress
312 Name (_UID, 0x00)
313
314 // Method that returns routing table
315 Method (_PRT, 0, NotSerialized)
316 {
317 if (LEqual (LAnd (PICM, UIOA), Zero)) {
318 DBG ("RETURNING PIC\n")
319 Store (0x00, \_SB.PCI0.SBRG.APDE)
320 Store (0x00, \_SB.PCI0.SBRG.APAD)
321 Return (PR00)
322 }
323 else {
324 DBG ("RETURNING APIC\n")
325 Store (0xbe, \_SB.PCI0.SBRG.APDE)
326 Store (0xef, \_SB.PCI0.SBRG.APAD)
327 Return (PR01)
328 }
329 }
330
331 Device (SBRG)
332 {
333 // Address of the PIIX3 (device 1 function 0)
334 Name (_ADR, 0x00010000)
335 OperationRegion (PCIC, PCI_Config, 0x00, 0xff)
336
337 Field (PCIC, ByteAcc, NoLock, Preserve)
338 {
339 Offset (0xad),
340 APAD, 8,
341 Offset (0xde),
342 APDE, 8,
343 }
344
345 // Keyboard device
346 Device (PS2K)
347 {
348 Name (_HID, EisaId ("PNP0303"))
349 Method (_STA, 0, NotSerialized)
350 {
351 Return (0x0F)
352 }
353
354 Name (_CRS, ResourceTemplate ()
355 {
356 IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
357 IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
358 IRQNoFlags () {1}
359 })
360 }
361
362 // DMA Controller
363 Device (DMAC)
364 {
365 Name (_HID, EisaId ("PNP0200"))
366 Name (_CRS, ResourceTemplate ()
367 {
368 IO (Decode16, 0x0000, 0x0000, 0x01, 0x10)
369 IO (Decode16, 0x0080, 0x0080, 0x01, 0x10)
370 IO (Decode16, 0x00C0, 0x00C0, 0x01, 0x20)
371 DMA (Compatibility, BusMaster, Transfer8_16) {4}
372 })
373 }
374
375 // Floppy disk controller
376 Device (FDC0)
377 {
378 Name (_HID, EisaId ("PNP0700"))
379
380 // Current resource settings
381 Name (_CRS, ResourceTemplate ()
382 {
383 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
384 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
385 IRQNoFlags () {6}
386 DMA (Compatibility, NotBusMaster, Transfer8) {2}
387 })
388
389 // Possible resource settings
390 Name (_PRS, ResourceTemplate ()
391 {
392 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
393 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
394 IRQNoFlags () {6}
395 DMA (Compatibility, NotBusMaster, Transfer8) {2}
396 })
397
398 }
399
400 // Mouse device
401 Device (PS2M)
402 {
403 Name (_HID, EisaId ("PNP0F03"))
404 Method (_STA, 0, NotSerialized)
405 {
406 Return (0x0F)
407 }
408
409 Name (_CRS, ResourceTemplate ()
410 {
411 IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
412 IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
413 IRQNoFlags () {12}
414 })
415 }
416 }
417
418 // Control method battery
419 Device (BAT0)
420 {
421 Name (_HID, EisaId ("PNP0C0A"))
422 Name (_UID, 0x00)
423
424 Scope (\_GPE)
425 {
426 // GPE bit 0 handler
427 // GPE.0 must be set and SCI raised when
428 // battery info changed and _BIF must be
429 // re-evaluated
430 Method (_L00, 0, NotSerialized)
431 {
432 Notify (\_SB.PCI0.BAT0, 0x81)
433 }
434 }
435
436 OperationRegion (CBAT, SystemIO, 0x4040, 0x08)
437 Field (CBAT, DwordAcc, NoLock, Preserve)
438 {
439 IDX0, 32,
440 DAT0, 32,
441 }
442
443 IndexField (IDX0, DAT0, DwordAcc, NoLock, Preserve)
444 {
445 STAT, 32,
446 PRAT, 32,
447 RCAP, 32,
448 PVOL, 32,
449
450 UNIT, 32,
451 DCAP, 32,
452 LFCP, 32,
453 BTEC, 32,
454 DVOL, 32,
455 DWRN, 32,
456 DLOW, 32,
457 GRN1, 32,
458 GRN2, 32,
459
460 BSTA, 32,
461 APSR, 32,
462 }
463
464 Method (_STA, 0, NotSerialized)
465 {
466 return (BSTA)
467 }
468
469 Name (PBIF, Package ()
470 {
471 0x01, // Power unit, 1 - mA
472 0x7fffffff, // Design capacity
473 0x7fffffff, // Last full charge capacity
474 0x00, // Battery technology
475 0xffffffff, // Design voltage
476 0x00, // Design capacity of Warning
477 0x00, // Design capacity of Low
478 0x04, // Battery capacity granularity 1
479 0x04, // Battery capacity granularity 2
480 "1", // Model number
481 "0", // Serial number
482 "VBOX", // Battery type
483 "innotek" // OEM Information
484 })
485
486 Name (PBST, Package () {
487 0, // Battery state
488 0x7fffffff, // Battery present rate
489 0x7fffffff, // Battery remaining capacity
490 0x7fffffff // Battery present voltage
491 })
492
493 // Battery information
494 Method (_BIF, 0, NotSerialized)
495 {
496 Store (UNIT, Index (PBIF, 0,))
497 Store (DCAP, Index (PBIF, 1,))
498 Store (LFCP, Index (PBIF, 2,))
499 Store (BTEC, Index (PBIF, 3,))
500 Store (DVOL, Index (PBIF, 4,))
501 Store (DWRN, Index (PBIF, 5,))
502 Store (DLOW, Index (PBIF, 6,))
503 Store (GRN1, Index (PBIF, 7,))
504 Store (GRN2, Index (PBIF, 8,))
505
506 DBG ("_BIF:\n")
507 HEX4 (DerefOf (Index (PBIF, 0,)))
508 HEX4 (DerefOf (Index (PBIF, 1,)))
509 HEX4 (DerefOf (Index (PBIF, 2,)))
510 HEX4 (DerefOf (Index (PBIF, 3,)))
511 HEX4 (DerefOf (Index (PBIF, 4,)))
512 HEX4 (DerefOf (Index (PBIF, 5,)))
513 HEX4 (DerefOf (Index (PBIF, 6,)))
514 HEX4 (DerefOf (Index (PBIF, 7,)))
515 HEX4 (DerefOf (Index (PBIF, 8,)))
516
517 return (PBIF)
518 }
519
520 // Battery status
521 Method (_BST, 0, NotSerialized)
522 {
523 Store (STAT, Index (PBST, 0,))
524 Store (PRAT, Index (PBST, 1,))
525 Store (RCAP, Index (PBST, 2,))
526 Store (PVOL, Index (PBST, 3,))
527/*
528 DBG ("_BST:\n")
529 HEX4 (DerefOf (Index (PBST, 0,)))
530 HEX4 (DerefOf (Index (PBST, 1,)))
531 HEX4 (DerefOf (Index (PBST, 2,)))
532 HEX4 (DerefOf (Index (PBST, 3,)))
533*/
534 return (PBST)
535 }
536 }
537
538 Device (AC)
539 {
540 Name (_HID, "ACPI0003")
541 Name (_UID, 0x00)
542 Name (_PCL, Package (0x01)
543 {
544 \_SB
545 })
546
547 Method (_PSR, 0, NotSerialized)
548 {
549 // DBG ("_PSR:\n")
550 // HEX4 (\_SB.PCI0.BAT0.APSR)
551 return (\_SB.PCI0.BAT0.APSR)
552 }
553
554 Method (_STA, 0, NotSerialized)
555 {
556 return (0x0f)
557 }
558 }
559 }
560 }
561
562 Scope (\_SB)
563 {
564 Scope (PCI0)
565 {
566 // PCI0 current resource settings
567 Name (CRS, ResourceTemplate ()
568 {
569 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
570 0x0000,
571 0x0000,
572 0x00FF,
573 0x0000,
574 0x0100)
575 IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
576 WordIO (ResourceProducer, MinFixed, MaxFixed,
577 PosDecode, EntireRange,
578 0x0000,
579 0x0000,
580 0x0CF7,
581 0x0000,
582 0x0CF8)
583 WordIO (ResourceProducer, MinFixed, MaxFixed,
584 PosDecode, EntireRange,
585 0x0000,
586 0x0D00,
587 0xFFFF,
588 0x0000,
589 0xF300)
590
591 /* Taken from ACPI faq (with some modifications) */
592 DwordMemory( // descriptor for video RAM behind ISA bus
593 ResourceProducer, // bit 0 of general flags is 0
594 PosDecode,
595 MinFixed, // Range is fixed
596 MaxFixed, // Range is Fixed
597 Cacheable,
598 ReadWrite,
599 0x00000000, // Granularity
600 0x000a0000, // Min
601 0x000bffff, // Max
602 0x00000000, // Translation
603 0x00020000 // Range Length
604 )
605
606 DwordMemory( // Consumed-and-produced resource
607 // (all of memory space)
608 ResourceProducer, // bit 0 of general flags is 0
609 PosDecode, // positive Decode
610 MinFixed, // Range is fixed
611 MaxFixed, // Range is fixed
612 Cacheable,
613 ReadWrite,
614 0x00000000, // Granularity
615 0x00000000, // Min (calculated dynamically)
616
617 0xffdfffff, // Max = 4GB - 2MB
618 0x00000000, // Translation
619 0xdfdfffff, // Range Length (calculated
620 // dynamically)
621 , // Optional field left blank
622 , // Optional field left blank
623 MEM3 // Name declaration for this
624 // descriptor
625 )
626 })
627
628 Method (_CRS, 0, NotSerialized)
629 {
630 CreateDwordField (CRS, \_SB.PCI0.MEM3._MIN, RAMT)
631 CreateDwordField (CRS, \_SB.PCI0.MEM3._LEN, RAMR)
632 Store (MEML, RAMT)
633 Subtract (0xffe00000, RAMT, RAMR)
634 Return (CRS)
635 }
636 }
637 }
638
639 Scope (\_SB)
640 {
641 // Fields within PIIX3 configuration[0x60..0x63] with
642 // IRQ mappings
643 Field (\_SB.PCI0.SBRG.PCIC, ByteAcc, NoLock, Preserve)
644 {
645 Offset (0x60),
646 PIRA, 8,
647 PIRB, 8,
648 PIRC, 8,
649 PIRD, 8
650 }
651
652 Name (BUFA, ResourceTemplate ()
653 {
654 IRQ (Level, ActiveLow, Shared) {15}
655 })
656 CreateWordField (BUFA, 0x01, ICRS)
657
658 // Generic status of IRQ routing entry
659 Method (LSTA, 1, NotSerialized)
660 {
661 And (Arg0, 0x80, Local0)
662// DBG ("LSTA: ")
663// HEX (Arg0)
664 If (Local0)
665 {
666 Return (0x09)
667 }
668 Else
669 {
670 Return (0x0B)
671 }
672 }
673
674 // Generic "current resource settings" for routing entry
675 Method (LCRS, 1, NotSerialized)
676 {
677 And (Arg0, 0x0F, Local0)
678 ShiftLeft (0x01, Local0, ICRS)
679// DBG ("LCRS: ")
680// HEX (ICRS)
681 Return (BUFA)
682 }
683
684 // Generic "set resource settings" for routing entry
685 Method (LSRS, 1, NotSerialized)
686 {
687 CreateWordField (Arg0, 0x01, ISRS)
688 FindSetRightBit (ISRS, Local0)
689 Return (Decrement (Local0))
690 }
691
692 // Generic "disable" for routing entry
693 Method (LDIS, 1, NotSerialized)
694 {
695 Return (Or (Arg0, 0x80))
696 }
697
698 // Link A
699 Device (LNKA)
700 {
701 Name (_HID, EisaId ("PNP0C0F"))
702 Name (_UID, 0x01)
703
704 // Status
705 Method (_STA, 0, NotSerialized)
706 {
707 DBG ("LNKA._STA\n")
708 Return (LSTA (PIRA))
709 }
710
711 // Possible resource settings
712 Method (_PRS, 0, NotSerialized)
713 {
714 DBG ("LNKA._PRS\n")
715 Return (PRSA)
716 }
717
718 // Disable
719 Method (_DIS, 0, NotSerialized)
720 {
721 DBG ("LNKA._DIS\n")
722 Store (LDIS (PIRA), PIRA)
723 }
724
725 // Current resource settings
726 Method (_CRS, 0, NotSerialized)
727 {
728 DBG ("LNKA._CRS\n")
729 Return (LCRS (PIRA))
730 }
731
732 // Set resource settings
733 Method (_SRS, 1, NotSerialized)
734 {
735 DBG ("LNKA._SRS: ")
736 HEX (LSRS (Arg0))
737 Store (LSRS (Arg0), PIRA)
738 }
739 }
740
741 // Link B
742 Device (LNKB)
743 {
744 Name (_HID, EisaId ("PNP0C0F"))
745 Name (_UID, 0x02)
746 Method (_STA, 0, NotSerialized)
747 {
748 // DBG ("LNKB._STA\n")
749 Return (LSTA (PIRB))
750 }
751
752 Method (_PRS, 0, NotSerialized)
753 {
754 // DBG ("LNKB._PRS\n")
755 Return (PRSB)
756 }
757
758 Method (_DIS, 0, NotSerialized)
759 {
760 // DBG ("LNKB._DIS\n")
761 Store (LDIS (PIRB), PIRB)
762 }
763
764 Method (_CRS, 0, NotSerialized)
765 {
766 // DBG ("LNKB._CRS\n")
767 Return (LCRS (PIRB))
768 }
769
770 Method (_SRS, 1, NotSerialized)
771 {
772 DBG ("LNKB._SRS: ")
773 HEX (LSRS (Arg0))
774 Store (LSRS (Arg0), PIRB)
775 }
776 }
777
778 // Link C
779 Device (LNKC)
780 {
781 Name (_HID, EisaId ("PNP0C0F"))
782 Name (_UID, 0x03)
783 Method (_STA, 0, NotSerialized)
784 {
785 // DBG ("LNKC._STA\n")
786 Return (LSTA (PIRC))
787 }
788
789 Method (_PRS, 0, NotSerialized)
790 {
791 // DBG ("LNKC._PRS\n")
792 Return (PRSC)
793 }
794
795 Method (_DIS, 0, NotSerialized)
796 {
797 // DBG ("LNKC._DIS\n")
798 Store (LDIS (PIRC), PIRC)
799 }
800
801 Method (_CRS, 0, NotSerialized)
802 {
803 // DBG ("LNKC._CRS\n")
804 Return (LCRS (PIRC))
805 }
806
807 Method (_SRS, 1, NotSerialized)
808 {
809 DBG ("LNKC._SRS: ")
810 HEX (LSRS (Arg0))
811 Store (LSRS (Arg0), PIRC)
812 }
813 }
814
815 // Link D
816 Device (LNKD)
817 {
818 Name (_HID, EisaId ("PNP0C0F"))
819 Name (_UID, 0x04)
820 Method (_STA, 0, NotSerialized)
821 {
822 // DBG ("LNKD._STA\n")
823 Return (LSTA (PIRD))
824 }
825
826 Method (_PRS, 0, NotSerialized)
827 {
828 // DBG ("LNKD._PRS\n")
829 Return (PRSD)
830 }
831
832 Method (_DIS, 0, NotSerialized)
833 {
834 // DBG ("LNKD._DIS\n")
835 Store (LDIS (PIRA), PIRD)
836 }
837
838 Method (_CRS, 0, NotSerialized)
839 {
840 // DBG ("LNKD._CRS\n")
841 Return (LCRS (PIRD))
842 }
843
844 Method (_SRS, 1, NotSerialized)
845 {
846 DBG ("LNKD._SRS: ")
847 HEX (LSRS (Arg0))
848 Store (LSRS (Arg0), PIRD)
849 }
850 }
851 }
852
853 // Sx states
854 Name (_S0, Package (2) {
855 0x00,
856 0x00,
857 })
858
859 Name (_S5, Package (2) {
860 0x05,
861 0x05,
862 })
863
864 Method (_PTS, 1, NotSerialized)
865 {
866 DBG ("Prepare to sleep: ")
867 HEX (Arg0)
868 }
869}
870
871/*
872 * Local Variables:
873 * comment-start: "//"
874 * End:
875 */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette