VirtualBox

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

Last change on this file since 400 was 1, checked in by vboxsync, 55 years ago

import

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