VirtualBox

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

Last change on this file since 62564 was 61677, checked in by vboxsync, 9 years ago

typo

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 65.9 KB
Line 
1// $Id: vbox.dsl 61677 2016-06-13 12:41:56Z vboxsync $
2/// @file
3//
4// VirtualBox ACPI
5//
6// Copyright (C) 2006-2015 Oracle Corporation
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 (GPL) as published by the Free Software
12// Foundation, in version 2 as it comes in the "COPYING" file of the
13// VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14// hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15
16DefinitionBlock ("DSDT.aml", "DSDT", 1, "VBOX ", "VBOXBIOS", 2)
17{
18 // Declare debugging ports withing SystemIO
19 OperationRegion(DBG0, SystemIO, 0x3000, 4)
20
21 // Writes to this field Will dump hex char
22 Field (DBG0, ByteAcc, NoLock, Preserve)
23 {
24 DHE1, 8,
25 }
26
27 // Writes to this field Will dump hex word
28 Field (DBG0, WordAcc, NoLock, Preserve)
29 {
30 DHE2, 16,
31 }
32
33 // Writes to this field Will dump hex double word
34 Field (DBG0, DWordAcc, NoLock, Preserve)
35 {
36 DHE4, 32,
37 }
38
39 // Writes to this field will dump ascii char
40 Field (DBG0, ByteAcc, NoLock, Preserve)
41 {
42 Offset (1),
43 DCHR, 8
44 }
45
46 // Shortcuts
47 Method(HEX, 1)
48 {
49 Store (Arg0, DHE1)
50 }
51
52 Method(HEX2, 1)
53 {
54 Store (Arg0, DHE2)
55 }
56
57 Method(HEX4, 1)
58 {
59 Store (Arg0, DHE4)
60 }
61
62 // Code from Microsoft sample
63 // http://www.microsoft.com/whdc/system/pnppwr/powermgmt/_OSI-method.mspx
64
65 //
66 // SLEN(Str) - Returns the length of Str (excluding NULL).
67 //
68 Method(SLEN, 1)
69 {
70 //
71 // Note: The caller must make sure that the argument is a string object.
72 //
73 Store(Arg0, Local0)
74 Return(Sizeof(Local0))
75 }
76
77
78 //
79 // S2BF(Str) - Convert a string object into a buffer object.
80 //
81 Method(S2BF, 1, Serialized)
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 //
99 // MIN(Int1, Int2) - Returns the minimum of Int1 or Int2.
100 //
101 //
102 Method(MIN, 2)
103 {
104 //
105 // Note: The caller must make sure that both arguments are integer objects.
106 //
107 If (LLess(Arg0, Arg1))
108 {
109 Return(Arg0)
110 }
111 Else
112 {
113 Return(Arg1)
114 }
115 }
116
117 //
118 // SCMP(Str1, Str2) - Compare Str1 and Str2.
119 // Returns One if Str1 > Str2
120 // Returns Zero if Str1 == Str2
121 // Returns Ones if Str1 < Str2
122 //
123 Method(SCMP, 2)
124 {
125 //
126 // Note: The caller must make sure that both arguments are string objects.
127 //
128 // Local0 is a buffer of Str1.
129 // Local1 is a buffer of Str2.
130 // Local2 is the indexed byte of Str1.
131 // Local3 is the indexed byte of Str2.
132 // Local4 is the index to both Str1 and Str2.
133 // Local5 is the length of Str1.
134 // Local6 is the length of Str2.
135 // Local7 is the minimum of Str1 or Str2 length.
136 //
137
138 Store(Arg0, Local0)
139 Store(S2BF(Local0), Local0)
140
141 Store(S2BF(Arg1), Local1)
142 Store(Zero, Local4)
143
144 Store(SLEN(Arg0), Local5)
145 Store(SLEN(Arg1), Local6)
146 Store(MIN(Local5, Local6), Local7)
147
148 While (LLess(Local4, Local7))
149 {
150 Store(Derefof(Index(Local0, Local4)), Local2)
151 Store(Derefof(Index(Local1, Local4)), Local3)
152 If (LGreater(Local2, Local3))
153 {
154 Return(One)
155 }
156 Else
157 {
158 If (LLess(Local2, Local3))
159 {
160 Return(Ones)
161 }
162 }
163
164 Increment(Local4)
165 }
166
167 If (LLess(Local4, Local5))
168 {
169 Return(One)
170 }
171 Else
172 {
173 If (LLess(Local4, Local6))
174 {
175 Return(Ones)
176 }
177 Else
178 {
179 Return(Zero)
180 }
181 }
182 }
183
184 // Return one if strings match, zero otherwise. Wrapper around SCMP
185 Method (MTCH, 2)
186 {
187 Store(Arg0, Local0)
188 Store(Arg1, Local1)
189 Store(SCMP(Local0, Local1), Local2)
190 Return(LNot(Local2))
191 }
192
193 // Convert ASCII string to buffer and store it's contents (char by
194 // char) into DCHR (thus possibly writing the string to console)
195 Method (\DBG, 1, NotSerialized)
196 {
197 Store(Arg0, Local0)
198 Store(S2BF (Local0), Local1)
199 Store(SizeOf (Local1), Local0)
200 Decrement (Local0)
201 Store(Zero, Local2)
202 While (Local0)
203 {
204 Decrement (Local0)
205 Store (DerefOf (Index (Local1, Local2)), DCHR)
206 Increment (Local2)
207 }
208 }
209
210 // Microsoft Windows version indicator
211 Name(MSWV, Ones)
212
213 //
214 // Return Windows version. Detect non-Microsoft OSes.
215 //
216 // 0 : Not Windows OS
217 // 2 : Windows Me
218 // 3 : Windows 2000 (NT pre-XP)
219 // 4 : Windows XP
220 // 5 : Windows Server 2003
221 // 6 : Windows Vista
222 // 7 : Windows 7
223 // 8 : Windows 8
224 // 9 : Windows 8.1
225 // 10 : Windows 10
226 Method(MSWN, 0, NotSerialized)
227 {
228 If (LNotEqual(MSWV, Ones))
229 {
230 Return(MSWV)
231 }
232
233 Store(0x00, MSWV)
234 DBG("_OS: ")
235 DBG(_OS)
236 DBG("\n")
237
238 // Does OS provide the _OSI method?
239 If (CondRefOf(_OSI))
240 {
241 DBG("_OSI exists\n")
242 // OS returns non-zero value in response to _OSI query if it
243 // supports the interface. Newer Windows releases support older
244 // versions of the ACPI interface.
245 If (_OSI("Windows 2001"))
246 {
247 Store(4, MSWV) // XP
248 }
249 If (_OSI("Windows 2001.1"))
250 {
251 Store(5, MSWV) // Server 2003
252 }
253 If (_OSI("Windows 2006"))
254 {
255 Store(6, MSWV) // Vista
256 }
257 If (_OSI("Windows 2009"))
258 {
259 Store(7, MSWV) // Windows 7
260 }
261 If (_OSI("Windows 2012"))
262 {
263 Store(8, MSWV) // Windows 8
264 }
265 If (_OSI("Windows 2013"))
266 {
267 Store(9, MSWV) // Windows 8.1
268 }
269 If (_OSI("Windows 2015"))
270 {
271 Store(10, MSWV) // Windows 10
272 }
273
274 // This must come last and is a trap. No version of Windows
275 // reports this!
276 If (_OSI("Windows 2006 SP2"))
277 {
278 DBG("Windows 2006 SP2 supported\n")
279 // Not a Microsoft OS
280 Store(0, MSWV)
281 }
282 }
283 Else
284 {
285 // No _OSI, could be older NT or Windows 9x
286 If (MTCH(_OS, "Microsoft Windows NT"))
287 {
288 Store(3, MSWV)
289 }
290 If (MTCH(_OS, "Microsoft WindowsME: Millennium Edition"))
291 {
292 Store(2, MSWV)
293 }
294 }
295
296 // Does OS provide the _REV method?
297 If (CondRefOf(_REV))
298 {
299 DBG("_REV: ")
300 HEX4(_REV)
301
302 // Defeat most Linuxes and other non-Microsoft OSes. Microsoft Windows
303 // up to Server 2003 reports ACPI 1.0 support, Vista up to Windows 10
304 // reports ACPI 2.0 support. Anything pretending to be a Windows OS
305 // with higher ACPI revision support is a fake.
306 If (LAnd(LGreater(MSWV, 0),LGreater(_REV, 2)))
307 {
308 If (LLess(MSWV,8))
309 {
310 DBG("ACPI rev mismatch, not a Microsoft OS\n")
311 Store(0, MSWV)
312 }
313 }
314 }
315
316 DBG("Determined MSWV: ")
317 HEX4(MSWV)
318
319 Return(MSWV)
320 }
321
322 Name(PICM, 0)
323 Method(_PIC, 1)
324 {
325 DBG ("Pic mode: ")
326 HEX4 (Arg0)
327 Store (Arg0, PICM)
328 }
329
330 // Declare indexed registers used for reading configuration information
331 OperationRegion (SYSI, SystemIO, 0x4048, 0x08)
332 Field (SYSI, DwordAcc, NoLock, Preserve)
333 {
334 IDX0, 32,
335 DAT0, 32,
336 }
337
338 IndexField (IDX0, DAT0, DwordAcc, NoLock, Preserve)
339 {
340 MEML, 32,
341 UIOA, 32, // if IO APIC enabled
342 UHPT, 32, // if HPET enabled
343 USMC, 32, // if SMC enabled
344 UFDC, 32, // if floppy controller enabled
345 SL2B, 32, // Serial2 base IO address
346 SL2I, 32, // Serial2 IRQ
347 SL3B, 32, // Serial3 base IO address
348 SL3I, 32, // Serial3 IRQ
349 MEMH, 32,
350 URTC, 32, // if RTC shown in tables
351 CPUL, 32, // flag of CPU lock state
352 CPUC, 32, // CPU to check lock status
353 CPET, 32, // type of CPU hotplug event
354 CPEV, 32, // id of CPU event targets
355 NICA, 32, // Primary NIC PCI address
356 HDAA, 32, // HDA PCI address
357 PWRS, 32, // power states
358 IOCA, 32, // southbridge IO controller PCI address
359 HBCA, 32, // host bus controller address
360 PCIB, 32, // PCI MCFG base start
361 PCIL, 32, // PCI MCFG length
362 SL0B, 32, // Serial0 base IO address
363 SL0I, 32, // Serial0 IRQ
364 SL1B, 32, // Serial1 base IO address
365 SL1I, 32, // Serial1 IRQ
366 PP0B, 32, // Parallel0 base IO address
367 PP0I, 32, // Parallel0 IRQ
368 PP1B, 32, // Parallel1 base IO address
369 PP1I, 32, // Parallel1 IRQ
370 Offset (0x80),
371 ININ, 32,
372 Offset (0x200),
373 VAIN, 32,
374 }
375
376 Scope (\_SB)
377 {
378 Method (_INI, 0, NotSerialized)
379 {
380 Store (0xbadc0de, VAIN)
381 DBG ("MEML: ")
382 HEX4 (MEML)
383 DBG ("UIOA: ")
384 HEX4 (UIOA)
385 DBG ("UHPT: ")
386 HEX4 (UHPT)
387 DBG ("USMC: ")
388 HEX4 (USMC)
389 DBG ("UFDC: ")
390 HEX4 (UFDC)
391 DBG ("MEMH: ")
392 HEX4 (MEMH)
393 }
394
395 // PCI PIC IRQ Routing table
396 // Must match pci.c:pci_slot_get_pirq
397 Name (PR00, Package ()
398 {
399 Package (0x04) {0x0002FFFF, 0x00, LNKB, 0x00,},
400 Package (0x04) {0x0002FFFF, 0x01, LNKC, 0x00,},
401 Package (0x04) {0x0002FFFF, 0x02, LNKD, 0x00,},
402 Package (0x04) {0x0002FFFF, 0x03, LNKA, 0x00,},
403
404 Package (0x04) {0x0003FFFF, 0x00, LNKC, 0x00,},
405 Package (0x04) {0x0003FFFF, 0x01, LNKD, 0x00,},
406 Package (0x04) {0x0003FFFF, 0x02, LNKA, 0x00,},
407 Package (0x04) {0x0003FFFF, 0x03, LNKB, 0x00,},
408
409 Package (0x04) {0x0004FFFF, 0x00, LNKD, 0x00,},
410 Package (0x04) {0x0004FFFF, 0x01, LNKA, 0x00,},
411 Package (0x04) {0x0004FFFF, 0x02, LNKB, 0x00,},
412 Package (0x04) {0x0004FFFF, 0x03, LNKC, 0x00,},
413
414 Package (0x04) {0x0005FFFF, 0x00, LNKA, 0x00,},
415 Package (0x04) {0x0005FFFF, 0x01, LNKB, 0x00,},
416 Package (0x04) {0x0005FFFF, 0x02, LNKC, 0x00,},
417 Package (0x04) {0x0005FFFF, 0x03, LNKD, 0x00,},
418
419 Package (0x04) {0x0006FFFF, 0x00, LNKB, 0x00,},
420 Package (0x04) {0x0006FFFF, 0x01, LNKC, 0x00,},
421 Package (0x04) {0x0006FFFF, 0x02, LNKD, 0x00,},
422 Package (0x04) {0x0006FFFF, 0x03, LNKA, 0x00,},
423
424 Package (0x04) {0x0007FFFF, 0x00, LNKC, 0x00,},
425 Package (0x04) {0x0007FFFF, 0x01, LNKD, 0x00,},
426 Package (0x04) {0x0007FFFF, 0x02, LNKA, 0x00,},
427 Package (0x04) {0x0007FFFF, 0x03, LNKB, 0x00,},
428
429 Package (0x04) {0x0008FFFF, 0x00, LNKD, 0x00,},
430 Package (0x04) {0x0008FFFF, 0x01, LNKA, 0x00,},
431 Package (0x04) {0x0008FFFF, 0x02, LNKB, 0x00,},
432 Package (0x04) {0x0008FFFF, 0x03, LNKC, 0x00,},
433
434 Package (0x04) {0x0009FFFF, 0x00, LNKA, 0x00,},
435 Package (0x04) {0x0009FFFF, 0x01, LNKB, 0x00,},
436 Package (0x04) {0x0009FFFF, 0x02, LNKC, 0x00,},
437 Package (0x04) {0x0009FFFF, 0x03, LNKD, 0x00,},
438
439 Package (0x04) {0x000AFFFF, 0x00, LNKB, 0x00,},
440 Package (0x04) {0x000AFFFF, 0x01, LNKC, 0x00,},
441 Package (0x04) {0x000AFFFF, 0x02, LNKD, 0x00,},
442 Package (0x04) {0x000AFFFF, 0x03, LNKA, 0x00,},
443
444 Package (0x04) {0x000BFFFF, 0x00, LNKC, 0x00,},
445 Package (0x04) {0x000BFFFF, 0x01, LNKD, 0x00,},
446 Package (0x04) {0x000BFFFF, 0x02, LNKA, 0x00,},
447 Package (0x04) {0x000BFFFF, 0x03, LNKB, 0x00,},
448
449 Package (0x04) {0x000CFFFF, 0x00, LNKD, 0x00,},
450 Package (0x04) {0x000CFFFF, 0x01, LNKA, 0x00,},
451 Package (0x04) {0x000CFFFF, 0x02, LNKB, 0x00,},
452 Package (0x04) {0x000CFFFF, 0x03, LNKC, 0x00,},
453
454 Package (0x04) {0x000DFFFF, 0x00, LNKA, 0x00,},
455 Package (0x04) {0x000DFFFF, 0x01, LNKB, 0x00,},
456 Package (0x04) {0x000DFFFF, 0x02, LNKC, 0x00,},
457 Package (0x04) {0x000DFFFF, 0x03, LNKD, 0x00,},
458
459 Package (0x04) {0x000EFFFF, 0x00, LNKB, 0x00,},
460 Package (0x04) {0x000EFFFF, 0x01, LNKC, 0x00,},
461 Package (0x04) {0x000EFFFF, 0x02, LNKD, 0x00,},
462 Package (0x04) {0x000EFFFF, 0x03, LNKA, 0x00,},
463
464 Package (0x04) {0x000FFFFF, 0x00, LNKC, 0x00,},
465 Package (0x04) {0x000FFFFF, 0x01, LNKD, 0x00,},
466 Package (0x04) {0x000FFFFF, 0x02, LNKA, 0x00,},
467 Package (0x04) {0x000FFFFF, 0x03, LNKB, 0x00,},
468
469 Package (0x04) {0x0010FFFF, 0x00, LNKD, 0x00,},
470 Package (0x04) {0x0010FFFF, 0x01, LNKA, 0x00,},
471 Package (0x04) {0x0010FFFF, 0x02, LNKB, 0x00,},
472 Package (0x04) {0x0010FFFF, 0x03, LNKC, 0x00,},
473
474 Package (0x04) {0x0011FFFF, 0x00, LNKA, 0x00,},
475 Package (0x04) {0x0011FFFF, 0x01, LNKB, 0x00,},
476 Package (0x04) {0x0011FFFF, 0x02, LNKC, 0x00,},
477 Package (0x04) {0x0011FFFF, 0x03, LNKD, 0x00,},
478
479 Package (0x04) {0x0012FFFF, 0x00, LNKB, 0x00,},
480 Package (0x04) {0x0012FFFF, 0x01, LNKC, 0x00,},
481 Package (0x04) {0x0012FFFF, 0x02, LNKD, 0x00,},
482 Package (0x04) {0x0012FFFF, 0x03, LNKA, 0x00,},
483
484 Package (0x04) {0x0013FFFF, 0x00, LNKC, 0x00,},
485 Package (0x04) {0x0013FFFF, 0x01, LNKD, 0x00,},
486 Package (0x04) {0x0013FFFF, 0x02, LNKA, 0x00,},
487 Package (0x04) {0x0013FFFF, 0x03, LNKB, 0x00,},
488
489 Package (0x04) {0x0014FFFF, 0x00, LNKD, 0x00,},
490 Package (0x04) {0x0014FFFF, 0x01, LNKA, 0x00,},
491 Package (0x04) {0x0014FFFF, 0x02, LNKB, 0x00,},
492 Package (0x04) {0x0014FFFF, 0x03, LNKC, 0x00,},
493
494 Package (0x04) {0x0015FFFF, 0x00, LNKA, 0x00,},
495 Package (0x04) {0x0015FFFF, 0x01, LNKB, 0x00,},
496 Package (0x04) {0x0015FFFF, 0x02, LNKC, 0x00,},
497 Package (0x04) {0x0015FFFF, 0x03, LNKD, 0x00,},
498
499 Package (0x04) {0x0016FFFF, 0x00, LNKB, 0x00,},
500 Package (0x04) {0x0016FFFF, 0x01, LNKC, 0x00,},
501 Package (0x04) {0x0016FFFF, 0x02, LNKD, 0x00,},
502 Package (0x04) {0x0016FFFF, 0x03, LNKA, 0x00,},
503
504 Package (0x04) {0x0017FFFF, 0x00, LNKC, 0x00,},
505 Package (0x04) {0x0017FFFF, 0x01, LNKD, 0x00,},
506 Package (0x04) {0x0017FFFF, 0x02, LNKA, 0x00,},
507 Package (0x04) {0x0017FFFF, 0x03, LNKB, 0x00,},
508
509 Package (0x04) {0x0018FFFF, 0x00, LNKD, 0x00,},
510 Package (0x04) {0x0018FFFF, 0x01, LNKA, 0x00,},
511 Package (0x04) {0x0018FFFF, 0x02, LNKB, 0x00,},
512 Package (0x04) {0x0018FFFF, 0x03, LNKC, 0x00,},
513
514 Package (0x04) {0x0019FFFF, 0x00, LNKA, 0x00,},
515 Package (0x04) {0x0019FFFF, 0x01, LNKB, 0x00,},
516 Package (0x04) {0x0019FFFF, 0x02, LNKC, 0x00,},
517 Package (0x04) {0x0019FFFF, 0x03, LNKD, 0x00,},
518
519 Package (0x04) {0x001AFFFF, 0x00, LNKB, 0x00,},
520 Package (0x04) {0x001AFFFF, 0x01, LNKC, 0x00,},
521 Package (0x04) {0x001AFFFF, 0x02, LNKD, 0x00,},
522 Package (0x04) {0x001AFFFF, 0x03, LNKA, 0x00,},
523
524 Package (0x04) {0x001BFFFF, 0x00, LNKC, 0x00,},
525 Package (0x04) {0x001BFFFF, 0x01, LNKD, 0x00,},
526 Package (0x04) {0x001BFFFF, 0x02, LNKA, 0x00,},
527 Package (0x04) {0x001BFFFF, 0x03, LNKB, 0x00,},
528
529 Package (0x04) {0x001CFFFF, 0x00, LNKD, 0x00,},
530 Package (0x04) {0x001CFFFF, 0x01, LNKA, 0x00,},
531 Package (0x04) {0x001CFFFF, 0x02, LNKB, 0x00,},
532 Package (0x04) {0x001CFFFF, 0x03, LNKC, 0x00,},
533
534 Package (0x04) {0x001DFFFF, 0x00, LNKA, 0x00,},
535 Package (0x04) {0x001DFFFF, 0x01, LNKB, 0x00,},
536 Package (0x04) {0x001DFFFF, 0x02, LNKC, 0x00,},
537 Package (0x04) {0x001DFFFF, 0x03, LNKD, 0x00,},
538
539 Package (0x04) {0x001EFFFF, 0x00, LNKB, 0x00,},
540 Package (0x04) {0x001EFFFF, 0x01, LNKC, 0x00,},
541 Package (0x04) {0x001EFFFF, 0x02, LNKD, 0x00,},
542 Package (0x04) {0x001EFFFF, 0x03, LNKA, 0x00,},
543
544 Package (0x04) {0x001FFFFF, 0x00, LNKC, 0x00,},
545 Package (0x04) {0x001FFFFF, 0x01, LNKD, 0x00,},
546 Package (0x04) {0x001FFFFF, 0x02, LNKA, 0x00,},
547 Package (0x04) {0x001FFFFF, 0x03, LNKB, 0x00,}
548 })
549
550 // PCI I/O APIC IRQ Routing table
551 // Must match pci.c:pci_slot_get_acpi_pirq
552 Name (PR01, Package ()
553 {
554 Package (0x04) {0x0002FFFF, 0x00, 0x00, 0x12,},
555 Package (0x04) {0x0002FFFF, 0x01, 0x00, 0x13,},
556 Package (0x04) {0x0002FFFF, 0x02, 0x00, 0x14,},
557 Package (0x04) {0x0002FFFF, 0x03, 0x00, 0x15,},
558
559 Package (0x04) {0x0003FFFF, 0x00, 0x00, 0x13,},
560 Package (0x04) {0x0003FFFF, 0x01, 0x00, 0x14,},
561 Package (0x04) {0x0003FFFF, 0x02, 0x00, 0x15,},
562 Package (0x04) {0x0003FFFF, 0x03, 0x00, 0x16,},
563
564 Package (0x04) {0x0004FFFF, 0x00, 0x00, 0x14,},
565 Package (0x04) {0x0004FFFF, 0x01, 0x00, 0x15,},
566 Package (0x04) {0x0004FFFF, 0x02, 0x00, 0x16,},
567 Package (0x04) {0x0004FFFF, 0x03, 0x00, 0x17,},
568
569 Package (0x04) {0x0005FFFF, 0x00, 0x00, 0x15,},
570 Package (0x04) {0x0005FFFF, 0x01, 0x00, 0x16,},
571 Package (0x04) {0x0005FFFF, 0x02, 0x00, 0x17,},
572 Package (0x04) {0x0005FFFF, 0x03, 0x00, 0x10,},
573
574 Package (0x04) {0x0006FFFF, 0x00, 0x00, 0x16,},
575 Package (0x04) {0x0006FFFF, 0x01, 0x00, 0x17,},
576 Package (0x04) {0x0006FFFF, 0x02, 0x00, 0x10,},
577 Package (0x04) {0x0006FFFF, 0x03, 0x00, 0x11,},
578
579 Package (0x04) {0x0007FFFF, 0x00, 0x00, 0x17,},
580 Package (0x04) {0x0007FFFF, 0x01, 0x00, 0x10,},
581 Package (0x04) {0x0007FFFF, 0x02, 0x00, 0x11,},
582 Package (0x04) {0x0007FFFF, 0x03, 0x00, 0x12,},
583
584 Package (0x04) {0x0008FFFF, 0x00, 0x00, 0x10,},
585 Package (0x04) {0x0008FFFF, 0x01, 0x00, 0x11,},
586 Package (0x04) {0x0008FFFF, 0x02, 0x00, 0x12,},
587 Package (0x04) {0x0008FFFF, 0x03, 0x00, 0x13,},
588
589 Package (0x04) {0x0009FFFF, 0x00, 0x00, 0x11,},
590 Package (0x04) {0x0009FFFF, 0x01, 0x00, 0x12,},
591 Package (0x04) {0x0009FFFF, 0x02, 0x00, 0x13,},
592 Package (0x04) {0x0009FFFF, 0x03, 0x00, 0x14,},
593
594 Package (0x04) {0x000AFFFF, 0x00, 0x00, 0x12,},
595 Package (0x04) {0x000AFFFF, 0x01, 0x00, 0x13,},
596 Package (0x04) {0x000AFFFF, 0x02, 0x00, 0x14,},
597 Package (0x04) {0x000AFFFF, 0x03, 0x00, 0x15,},
598
599 Package (0x04) {0x000BFFFF, 0x00, 0x00, 0x13,},
600 Package (0x04) {0x000BFFFF, 0x01, 0x00, 0x14,},
601 Package (0x04) {0x000BFFFF, 0x02, 0x00, 0x15,},
602 Package (0x04) {0x000BFFFF, 0x03, 0x00, 0x16,},
603
604 Package (0x04) {0x000CFFFF, 0x00, 0x00, 0x14,},
605 Package (0x04) {0x000CFFFF, 0x01, 0x00, 0x15,},
606 Package (0x04) {0x000CFFFF, 0x02, 0x00, 0x16,},
607 Package (0x04) {0x000CFFFF, 0x03, 0x00, 0x17,},
608
609 Package (0x04) {0x000DFFFF, 0x00, 0x00, 0x15,},
610 Package (0x04) {0x000DFFFF, 0x01, 0x00, 0x16,},
611 Package (0x04) {0x000DFFFF, 0x02, 0x00, 0x17,},
612 Package (0x04) {0x000DFFFF, 0x03, 0x00, 0x10,},
613
614 Package (0x04) {0x000EFFFF, 0x00, 0x00, 0x16,},
615 Package (0x04) {0x000EFFFF, 0x01, 0x00, 0x17,},
616 Package (0x04) {0x000EFFFF, 0x02, 0x00, 0x10,},
617 Package (0x04) {0x000EFFFF, 0x03, 0x00, 0x11,},
618
619 Package (0x04) {0x000FFFFF, 0x00, 0x00, 0x17,},
620 Package (0x04) {0x000FFFFF, 0x01, 0x00, 0x10,},
621 Package (0x04) {0x000FFFFF, 0x02, 0x00, 0x11,},
622 Package (0x04) {0x000FFFFF, 0x03, 0x00, 0x12,},
623
624 Package (0x04) {0x0010FFFF, 0x00, 0x00, 0x10,},
625 Package (0x04) {0x0010FFFF, 0x01, 0x00, 0x11,},
626 Package (0x04) {0x0010FFFF, 0x02, 0x00, 0x12,},
627 Package (0x04) {0x0010FFFF, 0x03, 0x00, 0x13,},
628
629 Package (0x04) {0x0011FFFF, 0x00, 0x00, 0x11,},
630 Package (0x04) {0x0011FFFF, 0x01, 0x00, 0x12,},
631 Package (0x04) {0x0011FFFF, 0x02, 0x00, 0x13,},
632 Package (0x04) {0x0011FFFF, 0x03, 0x00, 0x14,},
633
634 Package (0x04) {0x0012FFFF, 0x00, 0x00, 0x12,},
635 Package (0x04) {0x0012FFFF, 0x01, 0x00, 0x13,},
636 Package (0x04) {0x0012FFFF, 0x02, 0x00, 0x14,},
637 Package (0x04) {0x0012FFFF, 0x03, 0x00, 0x15,},
638
639 Package (0x04) {0x0013FFFF, 0x00, 0x00, 0x13,},
640 Package (0x04) {0x0013FFFF, 0x01, 0x00, 0x14,},
641 Package (0x04) {0x0013FFFF, 0x02, 0x00, 0x15,},
642 Package (0x04) {0x0013FFFF, 0x03, 0x00, 0x16,},
643
644 Package (0x04) {0x0014FFFF, 0x00, 0x00, 0x14,},
645 Package (0x04) {0x0014FFFF, 0x01, 0x00, 0x15,},
646 Package (0x04) {0x0014FFFF, 0x02, 0x00, 0x16,},
647 Package (0x04) {0x0014FFFF, 0x03, 0x00, 0x17,},
648
649 Package (0x04) {0x0015FFFF, 0x00, 0x00, 0x15,},
650 Package (0x04) {0x0015FFFF, 0x01, 0x00, 0x16,},
651 Package (0x04) {0x0015FFFF, 0x02, 0x00, 0x17,},
652 Package (0x04) {0x0015FFFF, 0x03, 0x00, 0x10,},
653
654 Package (0x04) {0x0016FFFF, 0x00, 0x00, 0x16,},
655 Package (0x04) {0x0016FFFF, 0x01, 0x00, 0x17,},
656 Package (0x04) {0x0016FFFF, 0x02, 0x00, 0x10,},
657 Package (0x04) {0x0016FFFF, 0x03, 0x00, 0x11,},
658
659 Package (0x04) {0x0017FFFF, 0x00, 0x00, 0x17,},
660 Package (0x04) {0x0017FFFF, 0x01, 0x00, 0x10,},
661 Package (0x04) {0x0017FFFF, 0x02, 0x00, 0x11,},
662 Package (0x04) {0x0017FFFF, 0x03, 0x00, 0x12,},
663
664 Package (0x04) {0x0018FFFF, 0x00, 0x00, 0x10,},
665 Package (0x04) {0x0018FFFF, 0x01, 0x00, 0x11,},
666 Package (0x04) {0x0018FFFF, 0x02, 0x00, 0x12,},
667 Package (0x04) {0x0018FFFF, 0x03, 0x00, 0x13,},
668
669 Package (0x04) {0x0019FFFF, 0x00, 0x00, 0x11,},
670 Package (0x04) {0x0019FFFF, 0x01, 0x00, 0x12,},
671 Package (0x04) {0x0019FFFF, 0x02, 0x00, 0x13,},
672 Package (0x04) {0x0019FFFF, 0x03, 0x00, 0x14,},
673
674 Package (0x04) {0x001AFFFF, 0x00, 0x00, 0x12,},
675 Package (0x04) {0x001AFFFF, 0x01, 0x00, 0x13,},
676 Package (0x04) {0x001AFFFF, 0x02, 0x00, 0x14,},
677 Package (0x04) {0x001AFFFF, 0x03, 0x00, 0x15,},
678
679 Package (0x04) {0x001BFFFF, 0x00, 0x00, 0x13,},
680 Package (0x04) {0x001BFFFF, 0x01, 0x00, 0x14,},
681 Package (0x04) {0x001BFFFF, 0x02, 0x00, 0x15,},
682 Package (0x04) {0x001BFFFF, 0x03, 0x00, 0x16,},
683
684 Package (0x04) {0x001CFFFF, 0x00, 0x00, 0x14,},
685 Package (0x04) {0x001CFFFF, 0x01, 0x00, 0x15,},
686 Package (0x04) {0x001CFFFF, 0x02, 0x00, 0x16,},
687 Package (0x04) {0x001CFFFF, 0x03, 0x00, 0x17,},
688
689 Package (0x04) {0x001DFFFF, 0x00, 0x00, 0x15,},
690 Package (0x04) {0x001DFFFF, 0x01, 0x00, 0x16,},
691 Package (0x04) {0x001DFFFF, 0x02, 0x00, 0x17,},
692 Package (0x04) {0x001DFFFF, 0x03, 0x00, 0x10,},
693
694 Package (0x04) {0x001EFFFF, 0x00, 0x00, 0x16,},
695 Package (0x04) {0x001EFFFF, 0x01, 0x00, 0x17,},
696 Package (0x04) {0x001EFFFF, 0x02, 0x00, 0x10,},
697 Package (0x04) {0x001EFFFF, 0x03, 0x00, 0x11,},
698
699 Package (0x04) {0x001FFFFF, 0x00, 0x00, 0x17,},
700 Package (0x04) {0x001FFFFF, 0x01, 0x00, 0x10,},
701 Package (0x04) {0x001FFFFF, 0x02, 0x00, 0x11,},
702 Package (0x04) {0x001FFFFF, 0x03, 0x00, 0x12,}
703 })
704
705 // Possible resource settings for PCI link A
706 Name (PRSA, ResourceTemplate ()
707 {
708 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
709 })
710
711 // Possible resource settings for PCI link B
712 Name (PRSB, ResourceTemplate ()
713 {
714 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
715 })
716
717 // Possible resource settings for PCI link C
718 Name (PRSC, ResourceTemplate ()
719 {
720 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
721 })
722
723 // Possible resource settings for PCI link D
724 Name (PRSD, ResourceTemplate ()
725 {
726 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
727 })
728
729 // PCI bus 0
730 Device (PCI0)
731 {
732
733 Name (_HID, EisaId ("PNP0A03")) // PCI bus PNP id
734 Method(_ADR, 0, NotSerialized) // PCI address
735 {
736 Return (HBCA)
737 }
738 Name (_BBN, 0x00) // base bus address (bus number)
739 Name (_UID, 0x00)
740
741 // Method that returns routing table; also opens PCI to I/O APIC
742 // interrupt routing backdoor by writing 0xdead 0xbeef signature
743 // to ISA bridge config space. See DevPCI.cpp/pciSetIrqInternal().
744 Method (_PRT, 0, NotSerialized)
745 {
746 if (LEqual (LAnd (PICM, UIOA), Zero)) {
747 DBG ("RETURNING PIC\n")
748 Store (0x00, \_SB.PCI0.SBRG.APDE)
749 Store (0x00, \_SB.PCI0.SBRG.APAD)
750 Return (PR00)
751 }
752 else {
753 DBG ("RETURNING APIC\n")
754 Store (0xbe, \_SB.PCI0.SBRG.APDE)
755 Store (0xef, \_SB.PCI0.SBRG.APAD)
756 Return (PR01)
757 }
758 }
759
760 Device (SBRG)
761 {
762 // Address of the southbridge device (PIIX or ICH9)
763 Method(_ADR, 0, NotSerialized)
764 {
765 Return (IOCA)
766 }
767 OperationRegion (PCIC, PCI_Config, 0x00, 0xff)
768
769 Field (PCIC, ByteAcc, NoLock, Preserve)
770 {
771 Offset (0xad),
772 APAD, 8,
773 Offset (0xde),
774 APDE, 8,
775 }
776
777 // PCI MCFG MMIO ranges
778 Device (^PCIE)
779 {
780 Name (_HID, EisaId ("PNP0C02"))
781 Name (_UID, 0x11)
782 Name (CRS, ResourceTemplate ()
783 {
784 Memory32Fixed (ReadOnly,
785 0xdc000000, // Address Base
786 0x4000000, // Address Length
787 _Y13)
788 })
789 Method (_CRS, 0, NotSerialized)
790 {
791 CreateDWordField (CRS, \_SB.PCI0.PCIE._Y13._BAS, BAS1)
792 CreateDWordField (CRS, \_SB.PCI0.PCIE._Y13._LEN, LEN1)
793 Store (PCIB, BAS1)
794 Store (PCIL, LEN1)
795 Return (CRS)
796 }
797 Method (_STA, 0, NotSerialized)
798 {
799 if (LEqual (PCIB, Zero)) {
800 Return (0x00)
801 }
802 else {
803 Return (0x0F)
804 }
805 }
806 }
807
808 // Keyboard device
809 Device (PS2K)
810 {
811 Name (_HID, EisaId ("PNP0303"))
812 Method (_STA, 0, NotSerialized)
813 {
814 Return (0x0F)
815 }
816
817 Name (_CRS, ResourceTemplate ()
818 {
819 IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
820 IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
821 IRQNoFlags () {1}
822 })
823 }
824
825 // DMA Controller
826 Device (DMAC)
827 {
828 Name (_HID, EisaId ("PNP0200"))
829 Name (_CRS, ResourceTemplate ()
830 {
831 IO (Decode16, 0x0000, 0x0000, 0x01, 0x10)
832 IO (Decode16, 0x0080, 0x0080, 0x01, 0x10)
833 IO (Decode16, 0x00C0, 0x00C0, 0x01, 0x20)
834 DMA (Compatibility, BusMaster, Transfer8_16) {4}
835 })
836 }
837
838 // Floppy disk controller
839 Device (FDC0)
840 {
841 Name (_HID, EisaId ("PNP0700"))
842
843 Method (_STA, 0, NotSerialized)
844 {
845 Return (UFDC)
846 }
847
848 // Current resource settings
849 Name (_CRS, ResourceTemplate ()
850 {
851 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
852 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
853 IRQNoFlags () {6}
854 DMA (Compatibility, NotBusMaster, Transfer8) {2}
855 })
856
857 // Possible resource settings
858 Name (_PRS, ResourceTemplate ()
859 {
860 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
861 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
862 IRQNoFlags () {6}
863 DMA (Compatibility, NotBusMaster, Transfer8) {2}
864 })
865
866 }
867
868 // Mouse device
869 Device (PS2M)
870 {
871 Name (_HID, EisaId ("PNP0F03"))
872 Method (_STA, 0, NotSerialized)
873 {
874 Return (0x0F)
875 }
876
877 Name (_CRS, ResourceTemplate ()
878 {
879 IRQNoFlags () {12}
880 })
881 }
882
883 // Parallel port 0
884 Device (^LPT0)
885 {
886 Name (_HID, EisaId ("PNP0400"))
887 Name (_UID, 0x01)
888 Method (_STA, 0, NotSerialized)
889 {
890 If (LEqual (PP0B, Zero))
891 {
892 Return (0x00)
893 }
894 Else
895 {
896 Return (0x0F)
897 }
898 }
899 Name (CRS, ResourceTemplate ()
900 {
901 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08, _Y18)
902 IRQNoFlags (_Y19) {7}
903 })
904 Method (_CRS, 0, NotSerialized)
905 {
906 CreateWordField (CRS, \_SB.PCI0.LPT0._Y18._MIN, PMI0)
907 CreateWordField (CRS, \_SB.PCI0.LPT0._Y18._MAX, PMA0)
908 CreateWordField (CRS, \_SB.PCI0.LPT0._Y19._INT, PIQ0)
909 Store (PP0B, PMI0)
910 Store (PP0B, PMA0)
911 ShiftLeft (0x01, PP0I, PIQ0)
912 Return (CRS)
913 }
914 }
915
916 // Parallel port 1
917 Device (^LPT1)
918 {
919 Name (_HID, EisaId ("PNP0400"))
920 Name (_UID, 0x02)
921 Method (_STA, 0, NotSerialized)
922 {
923 If (LEqual (PP1B, Zero))
924 {
925 Return (0x00)
926 }
927 Else
928 {
929 Return (0x0F)
930 }
931 }
932 Name (CRS, ResourceTemplate ()
933 {
934 IO (Decode16, 0x0278, 0x0278, 0x08, 0x08, _Y20)
935 IRQNoFlags (_Y21) {5}
936 })
937 Method (_CRS, 0, NotSerialized)
938 {
939 CreateWordField (CRS, \_SB.PCI0.LPT1._Y20._MIN, PMI1)
940 CreateWordField (CRS, \_SB.PCI0.LPT1._Y20._MAX, PMA1)
941 CreateWordField (CRS, \_SB.PCI0.LPT1._Y21._INT, PIQ1)
942 Store (PP1B, PMI1)
943 Store (PP1B, PMA1)
944 ShiftLeft (0x01, PP1I, PIQ1)
945 Return (CRS)
946 }
947 }
948
949
950 // Serial port 0
951 Device (^SRL0)
952 {
953 Name (_HID, EisaId ("PNP0501"))
954 Name (_UID, 0x01)
955 Method (_STA, 0, NotSerialized)
956 {
957 If (LEqual (SL0B, Zero))
958 {
959 Return (0x00)
960 }
961 Else
962 {
963 Return (0x0F)
964 }
965 }
966 Name (CRS, ResourceTemplate ()
967 {
968 IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08, _Y14)
969 IRQNoFlags (_Y15) {4}
970 })
971 Method (_CRS, 0, NotSerialized)
972 {
973 CreateWordField (CRS, \_SB.PCI0.SRL0._Y14._MIN, MIN0)
974 CreateWordField (CRS, \_SB.PCI0.SRL0._Y14._MAX, MAX0)
975 CreateWordField (CRS, \_SB.PCI0.SRL0._Y15._INT, IRQ0)
976 Store (SL0B, MIN0)
977 Store (SL0B, MAX0)
978 ShiftLeft (0x01, SL0I, IRQ0)
979 Return (CRS)
980 }
981 }
982
983 // Serial port 1
984 Device (^SRL1)
985 {
986 Name (_HID, EisaId ("PNP0501"))
987 Name (_UID, 0x02)
988 Method (_STA, 0, NotSerialized)
989 {
990 If (LEqual (SL1B, Zero))
991 {
992 Return (0x00)
993 }
994 Else
995 {
996 Return (0x0F)
997 }
998 }
999 Name (CRS, ResourceTemplate ()
1000 {
1001 IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08, _Y16)
1002 IRQNoFlags (_Y17) {3}
1003 })
1004 Method (_CRS, 0, NotSerialized)
1005 {
1006 CreateWordField (CRS, \_SB.PCI0.SRL1._Y16._MIN, MIN1)
1007 CreateWordField (CRS, \_SB.PCI0.SRL1._Y16._MAX, MAX1)
1008 CreateWordField (CRS, \_SB.PCI0.SRL1._Y17._INT, IRQ1)
1009 Store (SL1B, MIN1)
1010 Store (SL1B, MAX1)
1011 ShiftLeft (0x01, SL1I, IRQ1)
1012 Return (CRS)
1013 }
1014 }
1015
1016 // Serial port 2
1017 Device (^SRL2)
1018 {
1019 Name (_HID, EisaId ("PNP0501"))
1020 Name (_UID, 0x03)
1021 Method (_STA, 0, NotSerialized)
1022 {
1023 If (LEqual (SL2B, Zero))
1024 {
1025 Return (0x00)
1026 }
1027 Else
1028 {
1029 Return (0x0F)
1030 }
1031 }
1032 Name (CRS, ResourceTemplate ()
1033 {
1034 IO (Decode16, 0x03E8, 0x03E8, 0x01, 0x08, _Y22)
1035 IRQNoFlags (_Y23) {3}
1036 })
1037 Method (_CRS, 0, NotSerialized)
1038 {
1039 CreateWordField (CRS, \_SB.PCI0.SRL2._Y22._MIN, MIN1)
1040 CreateWordField (CRS, \_SB.PCI0.SRL2._Y22._MAX, MAX1)
1041 CreateWordField (CRS, \_SB.PCI0.SRL2._Y23._INT, IRQ1)
1042 Store (SL2B, MIN1)
1043 Store (SL2B, MAX1)
1044 ShiftLeft (0x01, SL2I, IRQ1)
1045 Return (CRS)
1046 }
1047 }
1048
1049 // Serial port 3
1050 Device (^SRL3)
1051 {
1052 Name (_HID, EisaId ("PNP0501"))
1053 Name (_UID, 0x04)
1054 Method (_STA, 0, NotSerialized)
1055 {
1056 If (LEqual (SL3B, Zero))
1057 {
1058 Return (0x00)
1059 }
1060 Else
1061 {
1062 Return (0x0F)
1063 }
1064 }
1065 Name (CRS, ResourceTemplate ()
1066 {
1067 IO (Decode16, 0x02E8, 0x02E8, 0x01, 0x08, _Y24)
1068 IRQNoFlags (_Y25) {3}
1069 })
1070 Method (_CRS, 0, NotSerialized)
1071 {
1072 CreateWordField (CRS, \_SB.PCI0.SRL3._Y24._MIN, MIN1)
1073 CreateWordField (CRS, \_SB.PCI0.SRL3._Y24._MAX, MAX1)
1074 CreateWordField (CRS, \_SB.PCI0.SRL3._Y25._INT, IRQ1)
1075 Store (SL3B, MIN1)
1076 Store (SL3B, MAX1)
1077 ShiftLeft (0x01, SL3I, IRQ1)
1078 Return (CRS)
1079 }
1080 }
1081
1082 // Programmable Interval Timer (i8254)
1083 Device (TIMR)
1084 {
1085 Name (_HID, EisaId ("PNP0100"))
1086 Name (_CRS, ResourceTemplate ()
1087 {
1088 IO (Decode16,
1089 0x0040, // Range Minimum
1090 0x0040, // Range Maximum
1091 0x00, // Alignment
1092 0x04, // Length
1093 )
1094 IO (Decode16,
1095 0x0050, // Range Minimum
1096 0x0050, // Range Maximum
1097 0x10, // Alignment
1098 0x04, // Length
1099 )
1100 })
1101 }
1102
1103 // Programmable Interrupt Controller (i8259)
1104 Device (PIC)
1105 {
1106 Name (_HID, EisaId ("PNP0000"))
1107 Name (_CRS, ResourceTemplate ()
1108 {
1109 IO (Decode16,
1110 0x0020, // Range Minimum
1111 0x0020, // Range Maximum
1112 0x00, // Alignment
1113 0x02, // Length
1114 )
1115 IO (Decode16,
1116 0x00A0, // Range Minimum
1117 0x00A0, // Range Maximum
1118 0x00, // Alignment
1119 0x02, // Length
1120 )
1121 // because in APIC configs PIC connected to pin 0,
1122 // and ISA IRQ0 rerouted to pin 2
1123 IRQNoFlags ()
1124 {2}
1125 })
1126 }
1127
1128
1129 // Real Time Clock and CMOS (MC146818)
1130 Device (RTC)
1131 {
1132 Name (_HID, EisaId ("PNP0B00"))
1133 Name (_CRS, ResourceTemplate ()
1134 {
1135 IO (Decode16,
1136 0x0070, // Range Minimum
1137 0x0070, // Range Maximum
1138 0x01, // Alignment
1139 0x02, // Length
1140 )
1141 })
1142 Method (_STA, 0, NotSerialized)
1143 {
1144 Return (URTC)
1145 }
1146 }
1147
1148 // High Precision Event Timer
1149 Device(HPET)
1150 {
1151 Name (_HID, EISAID("PNP0103"))
1152 Name (_CID, EISAID("PNP0C01"))
1153 Name(_UID, 0)
1154
1155 Method (_STA, 0, NotSerialized)
1156 {
1157 Return(UHPT)
1158 }
1159
1160 Name(CRS, ResourceTemplate()
1161 {
1162 IRQNoFlags ()
1163 {0}
1164 IRQNoFlags ()
1165 {8}
1166 Memory32Fixed (ReadWrite,
1167 0xFED00000, // Address Base
1168 0x00000400 // Address Length
1169 )
1170 })
1171
1172 Method (_CRS, 0, NotSerialized)
1173 {
1174 Return (CRS)
1175 }
1176 }
1177
1178 // System Management Controller
1179 Device (SMC)
1180 {
1181 Name (_HID, EisaId ("APP0001"))
1182 Name (_CID, "smc-napa")
1183
1184 Method (_STA, 0, NotSerialized)
1185 {
1186 Return (USMC)
1187 }
1188 Name (CRS, ResourceTemplate ()
1189 {
1190 IO (Decode16,
1191 0x0300, // Range Minimum
1192 0x0300, // Range Maximum
1193 0x01, // Alignment
1194 0x20) // Length
1195 IRQNoFlags ()
1196 {6}
1197
1198 })
1199 Method (_CRS, 0, NotSerialized)
1200 {
1201 Return (CRS)
1202 }
1203 }
1204 }
1205
1206 // NIC
1207 Device (GIGE)
1208 {
1209 /**
1210 * Generic NIC, according to
1211 * http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/devids.txt
1212 * Needed by some Windows guests.
1213 */
1214 Name (_HID, EisaId ("PNP8390"))
1215
1216 Method(_ADR, 0, NotSerialized)
1217 {
1218 Return (NICA)
1219 }
1220 /* Name (_PRW, Package (0x02)
1221 {
1222 0x09,
1223 0x04
1224 }) */
1225
1226 /* Wake up on LAN? */
1227 /* Method (EWOL, 1, NotSerialized)
1228 {
1229 Return (0x00)
1230 } */
1231
1232 Method (_STA, 0, NotSerialized)
1233 {
1234 if (LEqual (NICA, Zero)) {
1235 Return (0x00)
1236 }
1237 else {
1238 Return (0x0F)
1239 }
1240 }
1241 }
1242
1243 // Graphics device
1244 Device (GFX0)
1245 {
1246 Name (_ADR, 0x00020000)
1247
1248 // Windows releases older than Windows 8 (starting with Windows 2000)
1249 // get confused by this and lose the monitor device node. One of
1250 // the consequences is that color management is not available.
1251 // For Windows 2000 - Windows 7, disable this device (while keeping
1252 // it enabled for non-Microsoft OSes).
1253 Method (_STA, 0, NotSerialized)
1254 {
1255 If (LAnd (LGreater (MSWN(), 0x00), LLess (MSWN(), 0x08)))
1256 {
1257 Return(0x00)
1258 }
1259 Else
1260 {
1261 Return(0x0F)
1262 }
1263 }
1264
1265 Scope (\_GPE)
1266 {
1267 // GPE bit 2 handler
1268 // GPE.2 must be set and SCI raised when
1269 // display information changes.
1270 Method (_L02, 0, NotSerialized)
1271 {
1272 Notify (\_SB.PCI0.GFX0, 0x81)
1273 }
1274 }
1275
1276 Method (_DOS, 1) { }
1277
1278 Method (_DOD, 0, NotSerialized)
1279 {
1280 Return (Package()
1281 {
1282 0x80000100
1283 })
1284 }
1285
1286 Device (VGA)
1287 {
1288 Method (_ADR, 0, Serialized)
1289 {
1290 Return (0x0100)
1291 }
1292 }
1293 }
1294
1295 // HDA Audio card
1296 Device (HDEF)
1297 {
1298 Method(_DSM, 4, NotSerialized)
1299 {
1300 Store (Package (0x04)
1301 {
1302 "layout-id",
1303 Buffer (0x04)
1304 {
1305 /* 04 */ 0x04, 0x00, 0x00, 0x00
1306 },
1307
1308 "PinConfigurations",
1309 Buffer (Zero) {}
1310 }, Local0)
1311 if (LEqual (Arg0, ToUUID("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
1312 {
1313 If (LEqual (Arg1, One))
1314 {
1315 if (LEqual(Arg2, Zero))
1316 {
1317 Store (Buffer (0x01)
1318 {
1319 0x03
1320 }
1321 , Local0)
1322 Return (Local0)
1323 }
1324 if (LEqual(Arg2, One))
1325 {
1326 Return (Local0)
1327 }
1328 }
1329 }
1330 Store (Buffer (0x01)
1331 {
1332 0x0
1333 }
1334 , Local0)
1335 Return (Local0)
1336 }
1337
1338 Method(_ADR, 0, NotSerialized)
1339 {
1340 Return (HDAA)
1341 }
1342
1343 Method (_STA, 0, NotSerialized)
1344 {
1345 if (LEqual (HDAA, Zero)) {
1346 Return (0x00)
1347 }
1348 else {
1349 Return (0x0F)
1350 }
1351 }
1352 }
1353
1354
1355 // Control method battery
1356 Device (BAT0)
1357 {
1358 Name (_HID, EisaId ("PNP0C0A"))
1359 Name (_UID, 0x00)
1360
1361 Scope (\_GPE)
1362 {
1363 // GPE bit 0 handler
1364 // GPE.0 must be set and SCI raised when battery info
1365 // changed. Do NOT re-evaluate _BIF (battery info, never
1366 // changes) but DO re-evaluate _BST (dynamic state). Also
1367 // re-evaluate the AC adapter status.
1368 Method (_L00, 0, NotSerialized)
1369 {
1370 // _BST must be re-evaluated (battery state)
1371 Notify (\_SB.PCI0.BAT0, 0x80)
1372 // _PSR must be re-evaluated (AC adapter status)
1373 Notify (\_SB.PCI0.AC, 0x80)
1374 }
1375 }
1376
1377 OperationRegion (CBAT, SystemIO, 0x4040, 0x08)
1378 Field (CBAT, DwordAcc, NoLock, Preserve)
1379 {
1380 IDX0, 32,
1381 DAT0, 32,
1382 }
1383
1384 IndexField (IDX0, DAT0, DwordAcc, NoLock, Preserve)
1385 {
1386 STAT, 32,
1387 PRAT, 32,
1388 RCAP, 32,
1389 PVOL, 32,
1390
1391 UNIT, 32,
1392 DCAP, 32,
1393 LFCP, 32,
1394 BTEC, 32,
1395 DVOL, 32,
1396 DWRN, 32,
1397 DLOW, 32,
1398 GRN1, 32,
1399 GRN2, 32,
1400
1401 BSTA, 32,
1402 APSR, 32,
1403 }
1404
1405 Method (_STA, 0, NotSerialized)
1406 {
1407 return (BSTA)
1408 }
1409
1410 Name (PBIF, Package ()
1411 {
1412 0x01, // Power unit, 1 - mA
1413 0x7fffffff, // Design capacity
1414 0x7fffffff, // Last full charge capacity
1415 0x00, // Battery technology
1416 0xffffffff, // Design voltage
1417 0x00, // Design capacity of Warning
1418 0x00, // Design capacity of Low
1419 0x04, // Battery capacity granularity 1
1420 0x04, // Battery capacity granularity 2
1421 "1", // Model number
1422 "0", // Serial number
1423 "VBOX", // Battery type
1424 "innotek" // OEM Information
1425 })
1426
1427 Name (PBST, Package () {
1428 0, // Battery state
1429 0x7fffffff, // Battery present rate
1430 0x7fffffff, // Battery remaining capacity
1431 0x7fffffff // Battery present voltage
1432 })
1433
1434 // Battery information
1435 Method (_BIF, 0, NotSerialized)
1436 {
1437 Store (UNIT, Index (PBIF, 0,))
1438 Store (DCAP, Index (PBIF, 1,))
1439 Store (LFCP, Index (PBIF, 2,))
1440 Store (BTEC, Index (PBIF, 3,))
1441 Store (DVOL, Index (PBIF, 4,))
1442 Store (DWRN, Index (PBIF, 5,))
1443 Store (DLOW, Index (PBIF, 6,))
1444 Store (GRN1, Index (PBIF, 7,))
1445 Store (GRN2, Index (PBIF, 8,))
1446
1447 DBG ("_BIF:\n")
1448 HEX4 (DerefOf (Index (PBIF, 0,)))
1449 HEX4 (DerefOf (Index (PBIF, 1,)))
1450 HEX4 (DerefOf (Index (PBIF, 2,)))
1451 HEX4 (DerefOf (Index (PBIF, 3,)))
1452 HEX4 (DerefOf (Index (PBIF, 4,)))
1453 HEX4 (DerefOf (Index (PBIF, 5,)))
1454 HEX4 (DerefOf (Index (PBIF, 6,)))
1455 HEX4 (DerefOf (Index (PBIF, 7,)))
1456 HEX4 (DerefOf (Index (PBIF, 8,)))
1457
1458 return (PBIF)
1459 }
1460
1461 // Battery status
1462 Method (_BST, 0, NotSerialized)
1463 {
1464 Store (STAT, Index (PBST, 0,))
1465 Store (PRAT, Index (PBST, 1,))
1466 Store (RCAP, Index (PBST, 2,))
1467 Store (PVOL, Index (PBST, 3,))
1468/*
1469 DBG ("_BST:\n")
1470 HEX4 (DerefOf (Index (PBST, 0,)))
1471 HEX4 (DerefOf (Index (PBST, 1,)))
1472 HEX4 (DerefOf (Index (PBST, 2,)))
1473 HEX4 (DerefOf (Index (PBST, 3,)))
1474*/
1475 return (PBST)
1476 }
1477 }
1478
1479 Device (AC)
1480 {
1481 Name (_HID, "ACPI0003")
1482 Name (_UID, 0x00)
1483 Name (_PCL, Package (0x01)
1484 {
1485 \_SB
1486 })
1487
1488 Method (_PSR, 0, NotSerialized)
1489 {
1490 // DBG ("_PSR:\n")
1491 // HEX4 (\_SB.PCI0.BAT0.APSR)
1492 return (\_SB.PCI0.BAT0.APSR)
1493 }
1494
1495 Method (_STA, 0, NotSerialized)
1496 {
1497 return (0x0f)
1498 }
1499 }
1500 }
1501 }
1502
1503 Scope (\_SB)
1504 {
1505 Scope (PCI0)
1506 {
1507 // PCI0 current resource settings
1508 Name (CRS, ResourceTemplate ()
1509 {
1510 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
1511 0x0000,
1512 0x0000,
1513 0x00FF,
1514 0x0000,
1515 0x0100)
1516 IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
1517 WordIO (ResourceProducer, MinFixed, MaxFixed,
1518 PosDecode, EntireRange,
1519 0x0000,
1520 0x0000,
1521 0x0CF7,
1522 0x0000,
1523 0x0CF8)
1524 WordIO (ResourceProducer, MinFixed, MaxFixed,
1525 PosDecode, EntireRange,
1526 0x0000,
1527 0x0D00,
1528 0xFFFF,
1529 0x0000,
1530 0xF300)
1531
1532 /* Taken from ACPI faq (with some modifications) */
1533 DwordMemory( // descriptor for video RAM behind ISA bus
1534 ResourceProducer, // bit 0 of general flags is 0
1535 PosDecode,
1536 MinFixed, // Range is fixed
1537 MaxFixed, // Range is Fixed
1538 Cacheable,
1539 ReadWrite,
1540 0x00000000, // Granularity
1541 0x000a0000, // Min
1542 0x000bffff, // Max
1543 0x00000000, // Translation
1544 0x00020000 // Range Length
1545 )
1546
1547 DwordMemory( // Consumed-and-produced resource
1548 // (all of low memory space)
1549 ResourceProducer, // bit 0 of general flags is 0
1550 PosDecode, // positive Decode
1551 MinNotFixed, // Range is not fixed
1552 MaxFixed, // Range is fixed
1553 Cacheable,
1554 ReadWrite,
1555 0x00000000, // Granularity
1556 0x00000000, // Min (calculated dynamically)
1557
1558 0xffdfffff, // Max = 4GB - 2MB
1559 0x00000000, // Translation
1560 0x00000000, // Range Length (calculated
1561 // dynamically)
1562 , // Optional field left blank
1563 , // Optional field left blank
1564 MEM3 // Name declaration for this
1565 // descriptor
1566 )
1567 })
1568
1569// Name (TOM, ResourceTemplate () // Memory above 4GB (aka high), appended when needed.
1570// {
1571// QWORDMemory(
1572// ResourceProducer, // bit 0 of general flags is 0
1573// PosDecode, // positive Decode
1574// MinFixed, // Range is fixed
1575// MaxFixed, // Range is fixed
1576// Cacheable,
1577// ReadWrite,
1578// 0x0000000000000000, // _GRA: Granularity.
1579// 0 /*0x0000000100000000*/, // _MIN: Min address, 4GB.
1580// 0 /*0x00000fffffffffff*/, // _MAX: Max possible address, 16TB.
1581// 0x0000000000000000, // _TRA: Translation
1582// 0x0000000000000000, // _LEN: Range length (calculated dynamically)
1583// , // ResourceSourceIndex: Optional field left blank
1584// , // ResourceSource: Optional field left blank
1585// MEM4 // Name declaration for this descriptor.
1586// )
1587// })
1588
1589 Method (_CRS, 0, NotSerialized)
1590 {
1591 CreateDwordField (CRS, \_SB.PCI0.MEM3._MIN, RAMT)
1592 CreateDwordField (CRS, \_SB.PCI0.MEM3._LEN, RAMR)
1593// CreateQwordField (TOM, \_SB.PCI0.MEM4._LEN, TM4L)
1594// CreateQwordField (TOM, \_SB.PCI0.MEM4._LEN, TM4N)
1595// CreateQwordField (TOM, \_SB.PCI0.MEM4._LEN, TM4X)
1596
1597 Store (MEML, RAMT)
1598 Subtract (0xffe00000, RAMT, RAMR)
1599
1600// If (LNotEqual (MEMH, 0x00000000))
1601// {
1602// //
1603// // Update the TOM resource template and append it to CRS.
1604// // This way old < 4GB guest doesn't see anything different.
1605// // (MEMH is the memory above 4GB specified in 64KB units.)
1606// //
1607// // Note: ACPI v2 doesn't do 32-bit integers. IASL may fail on
1608// // seeing 64-bit constants and the code probably wont work.
1609// //
1610// Store (1, TM4N)
1611// ShiftLeft (TM4N, 32, TM4N)
1612//
1613// Store (0x00000fff, TM4X)
1614// ShiftLeft (TM4X, 32, TM4X)
1615// Or (TM4X, 0xffffffff, TM4X)
1616//
1617// Store (MEMH, TM4L)
1618// ShiftLeft (TM4L, 16, TM4L)
1619//
1620// ConcatenateResTemplate (CRS, TOM, Local2)
1621// Return (Local2)
1622// }
1623
1624 Return (CRS)
1625 }
1626 }
1627 }
1628
1629 Scope (\_SB)
1630 {
1631 // Fields within PIIX3 configuration[0x60..0x63] with
1632 // IRQ mappings
1633 Field (\_SB.PCI0.SBRG.PCIC, ByteAcc, NoLock, Preserve)
1634 {
1635 Offset (0x60),
1636 PIRA, 8,
1637 PIRB, 8,
1638 PIRC, 8,
1639 PIRD, 8
1640 }
1641
1642 Name (BUFA, ResourceTemplate ()
1643 {
1644 IRQ (Level, ActiveLow, Shared) {15}
1645 })
1646 CreateWordField (BUFA, 0x01, ICRS)
1647
1648 // Generic status of IRQ routing entry
1649 Method (LSTA, 1, NotSerialized)
1650 {
1651 And (Arg0, 0x80, Local0)
1652// DBG ("LSTA: ")
1653// HEX (Arg0)
1654 If (Local0)
1655 {
1656 Return (0x09)
1657 }
1658 Else
1659 {
1660 Return (0x0B)
1661 }
1662 }
1663
1664 // Generic "current resource settings" for routing entry
1665 Method (LCRS, 1, NotSerialized)
1666 {
1667 And (Arg0, 0x0F, Local0)
1668 ShiftLeft (0x01, Local0, ICRS)
1669// DBG ("LCRS: ")
1670// HEX (ICRS)
1671 Return (BUFA)
1672 }
1673
1674 // Generic "set resource settings" for routing entry
1675 Method (LSRS, 1, NotSerialized)
1676 {
1677 CreateWordField (Arg0, 0x01, ISRS)
1678 FindSetRightBit (ISRS, Local0)
1679 Return (Decrement (Local0))
1680 }
1681
1682 // Generic "disable" for routing entry
1683 Method (LDIS, 1, NotSerialized)
1684 {
1685 Return (Or (Arg0, 0x80))
1686 }
1687
1688 // Link A
1689 Device (LNKA)
1690 {
1691 Name (_HID, EisaId ("PNP0C0F"))
1692 Name (_UID, 0x01)
1693
1694 // Status
1695 Method (_STA, 0, NotSerialized)
1696 {
1697 DBG ("LNKA._STA\n")
1698 Return (LSTA (PIRA))
1699 }
1700
1701 // Possible resource settings
1702 Method (_PRS, 0, NotSerialized)
1703 {
1704 DBG ("LNKA._PRS\n")
1705 Return (PRSA)
1706 }
1707
1708 // Disable
1709 Method (_DIS, 0, NotSerialized)
1710 {
1711 DBG ("LNKA._DIS\n")
1712 Store (LDIS (PIRA), PIRA)
1713 }
1714
1715 // Current resource settings
1716 Method (_CRS, 0, NotSerialized)
1717 {
1718 DBG ("LNKA._CRS\n")
1719 Return (LCRS (PIRA))
1720 }
1721
1722 // Set resource settings
1723 Method (_SRS, 1, NotSerialized)
1724 {
1725 DBG ("LNKA._SRS: ")
1726 HEX (LSRS (Arg0))
1727 Store (LSRS (Arg0), PIRA)
1728 }
1729 }
1730
1731 // Link B
1732 Device (LNKB)
1733 {
1734 Name (_HID, EisaId ("PNP0C0F"))
1735 Name (_UID, 0x02)
1736 Method (_STA, 0, NotSerialized)
1737 {
1738 // DBG ("LNKB._STA\n")
1739 Return (LSTA (PIRB))
1740 }
1741
1742 Method (_PRS, 0, NotSerialized)
1743 {
1744 // DBG ("LNKB._PRS\n")
1745 Return (PRSB)
1746 }
1747
1748 Method (_DIS, 0, NotSerialized)
1749 {
1750 // DBG ("LNKB._DIS\n")
1751 Store (LDIS (PIRB), PIRB)
1752 }
1753
1754 Method (_CRS, 0, NotSerialized)
1755 {
1756 // DBG ("LNKB._CRS\n")
1757 Return (LCRS (PIRB))
1758 }
1759
1760 Method (_SRS, 1, NotSerialized)
1761 {
1762 DBG ("LNKB._SRS: ")
1763 HEX (LSRS (Arg0))
1764 Store (LSRS (Arg0), PIRB)
1765 }
1766 }
1767
1768 // Link C
1769 Device (LNKC)
1770 {
1771 Name (_HID, EisaId ("PNP0C0F"))
1772 Name (_UID, 0x03)
1773 Method (_STA, 0, NotSerialized)
1774 {
1775 // DBG ("LNKC._STA\n")
1776 Return (LSTA (PIRC))
1777 }
1778
1779 Method (_PRS, 0, NotSerialized)
1780 {
1781 // DBG ("LNKC._PRS\n")
1782 Return (PRSC)
1783 }
1784
1785 Method (_DIS, 0, NotSerialized)
1786 {
1787 // DBG ("LNKC._DIS\n")
1788 Store (LDIS (PIRC), PIRC)
1789 }
1790
1791 Method (_CRS, 0, NotSerialized)
1792 {
1793 // DBG ("LNKC._CRS\n")
1794 Return (LCRS (PIRC))
1795 }
1796
1797 Method (_SRS, 1, NotSerialized)
1798 {
1799 DBG ("LNKC._SRS: ")
1800 HEX (LSRS (Arg0))
1801 Store (LSRS (Arg0), PIRC)
1802 }
1803 }
1804
1805 // Link D
1806 Device (LNKD)
1807 {
1808 Name (_HID, EisaId ("PNP0C0F"))
1809 Name (_UID, 0x04)
1810 Method (_STA, 0, NotSerialized)
1811 {
1812 // DBG ("LNKD._STA\n")
1813 Return (LSTA (PIRD))
1814 }
1815
1816 Method (_PRS, 0, NotSerialized)
1817 {
1818 // DBG ("LNKD._PRS\n")
1819 Return (PRSD)
1820 }
1821
1822 Method (_DIS, 0, NotSerialized)
1823 {
1824 // DBG ("LNKD._DIS\n")
1825 Store (LDIS (PIRA), PIRD)
1826 }
1827
1828 Method (_CRS, 0, NotSerialized)
1829 {
1830 // DBG ("LNKD._CRS\n")
1831 Return (LCRS (PIRD))
1832 }
1833
1834 Method (_SRS, 1, NotSerialized)
1835 {
1836 DBG ("LNKD._SRS: ")
1837 HEX (LSRS (Arg0))
1838 Store (LSRS (Arg0), PIRD)
1839 }
1840 }
1841 }
1842
1843 // Sx states
1844 Name (_S0, Package (2) {
1845 0x00,
1846 0x00,
1847 })
1848
1849 // Shift one by the power state number
1850 If (And(PWRS, ShiftLeft(One,1))) {
1851 Name (_S1, Package (2) {
1852 0x01,
1853 0x01,
1854 })
1855 }
1856
1857 If (And(PWRS, ShiftLeft(One,4))) {
1858 Name (_S4, Package (2) {
1859 0x05,
1860 0x05,
1861 })
1862 }
1863
1864 Name (_S5, Package (2) {
1865 0x05,
1866 0x05,
1867 })
1868
1869 Method (_PTS, 1, NotSerialized)
1870 {
1871 DBG ("Prepare to sleep: ")
1872 HEX (Arg0)
1873 }
1874}
1875
1876/*
1877 * Local Variables:
1878 * comment-start: "//"
1879 * End:
1880 */
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