VirtualBox

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

Last change on this file since 53426 was 53334, checked in by vboxsync, 10 years ago

ACPI: Report MCFG motherboard resource properly.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 54.0 KB
Line 
1// $Id: vbox.dsl 53334 2014-11-14 16:40:07Z vboxsync $
2/// @file
3//
4// VirtualBox ACPI
5//
6// Copyright (C) 2006-2011 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 Method(S2BF, 1)
78 {
79 //
80 // Note: The caller must make sure that the argument is a string object.
81 //
82 // Local0 contains length of string + NULL.
83 //
84 Store(Arg0, Local0)
85 Add(SLEN(Local0), One, Local0)
86 //
87 // Convert the string object into a buffer object.
88 //
89 Name(BUFF, Buffer(Local0) {})
90 Store(Arg0, BUFF)
91 Return(BUFF)
92 }
93
94 // Convert ASCII string to buffer and store it's contents (char by
95 // char) into DCHR (thus possibly writing the string to console)
96 Method (\DBG, 1, NotSerialized)
97 {
98 Store(Arg0, Local0)
99 Store(S2BF (Local0), Local1)
100 Store(SizeOf (Local1), Local0)
101 Decrement (Local0)
102 Store(Zero, Local2)
103 While (Local0)
104 {
105 Decrement (Local0)
106 Store (DerefOf (Index (Local1, Local2)), DCHR)
107 Increment (Local2)
108 }
109 }
110
111 Name(PICM, 0)
112 Method(_PIC, 1)
113 {
114 DBG ("Pic mode: ")
115 HEX4 (Arg0)
116 Store (Arg0, PICM)
117 }
118
119 // Declare indexed registers used for reading configuration information
120 OperationRegion (SYSI, SystemIO, 0x4048, 0x08)
121 Field (SYSI, DwordAcc, NoLock, Preserve)
122 {
123 IDX0, 32,
124 DAT0, 32,
125 }
126
127 IndexField (IDX0, DAT0, DwordAcc, NoLock, Preserve)
128 {
129 MEML, 32,
130 UIOA, 32, // if IO APIC enabled
131 UHPT, 32, // if HPET enabled
132 USMC, 32, // if SMC enabled
133 UFDC, 32, // if floppy controller enabled
134 // UCP0-UCP3 no longer used and only kept here for saved state compatibility
135 UCP0, 32,
136 UCP1, 32,
137 UCP2, 32,
138 UCP3, 32,
139 MEMH, 32,
140 URTC, 32, // if RTC shown in tables
141 CPUL, 32, // flag of CPU lock state
142 CPUC, 32, // CPU to check lock status
143 CPET, 32, // type of CPU hotplug event
144 CPEV, 32, // id of CPU event targets
145 NICA, 32, // Primary NIC PCI address
146 HDAA, 32, // HDA PCI address
147 PWRS, 32, // power states
148 IOCA, 32, // southbridge IO controller PCI address
149 HBCA, 32, // host bus controller address
150 PCIB, 32, // PCI MCFG base start
151 PCIL, 32, // PCI MCFG length
152 SL0B, 32, // Serial0 base IO address
153 SL0I, 32, // Serial0 IRQ
154 SL1B, 32, // Serial1 base IO address
155 SL1I, 32, // Serial1 IRQ
156 Offset (0x80),
157 ININ, 32,
158 Offset (0x200),
159 VAIN, 32,
160 }
161
162 Scope (\_SB)
163 {
164 Method (_INI, 0, NotSerialized)
165 {
166 Store (0xbadc0de, VAIN)
167 DBG ("MEML: ")
168 HEX4 (MEML)
169 DBG ("UIOA: ")
170 HEX4 (UIOA)
171 DBG ("UHPT: ")
172 HEX4 (UHPT)
173 DBG ("USMC: ")
174 HEX4 (USMC)
175 DBG ("UFDC: ")
176 HEX4 (UFDC)
177 DBG ("MEMH: ")
178 HEX4 (MEMH)
179 }
180
181 // PCI PIC IRQ Routing table
182 // Must match pci.c:pci_slot_get_pirq
183 Name (PR00, Package ()
184 {
185 Package (0x04) {0x0002FFFF, 0x00, LNKB, 0x00,},
186 Package (0x04) {0x0002FFFF, 0x01, LNKC, 0x00,},
187 Package (0x04) {0x0002FFFF, 0x02, LNKD, 0x00,},
188 Package (0x04) {0x0002FFFF, 0x03, LNKA, 0x00,},
189
190 Package (0x04) {0x0003FFFF, 0x00, LNKC, 0x00,},
191 Package (0x04) {0x0003FFFF, 0x01, LNKD, 0x00,},
192 Package (0x04) {0x0003FFFF, 0x02, LNKA, 0x00,},
193 Package (0x04) {0x0003FFFF, 0x03, LNKB, 0x00,},
194
195 Package (0x04) {0x0004FFFF, 0x00, LNKD, 0x00,},
196 Package (0x04) {0x0004FFFF, 0x01, LNKA, 0x00,},
197 Package (0x04) {0x0004FFFF, 0x02, LNKB, 0x00,},
198 Package (0x04) {0x0004FFFF, 0x03, LNKC, 0x00,},
199
200 Package (0x04) {0x0005FFFF, 0x00, LNKA, 0x00,},
201 Package (0x04) {0x0005FFFF, 0x01, LNKB, 0x00,},
202 Package (0x04) {0x0005FFFF, 0x02, LNKC, 0x00,},
203 Package (0x04) {0x0005FFFF, 0x03, LNKD, 0x00,},
204
205 Package (0x04) {0x0006FFFF, 0x00, LNKB, 0x00,},
206 Package (0x04) {0x0006FFFF, 0x01, LNKC, 0x00,},
207 Package (0x04) {0x0006FFFF, 0x02, LNKD, 0x00,},
208 Package (0x04) {0x0006FFFF, 0x03, LNKA, 0x00,},
209
210 Package (0x04) {0x0007FFFF, 0x00, LNKC, 0x00,},
211 Package (0x04) {0x0007FFFF, 0x01, LNKD, 0x00,},
212 Package (0x04) {0x0007FFFF, 0x02, LNKA, 0x00,},
213 Package (0x04) {0x0007FFFF, 0x03, LNKB, 0x00,},
214
215 Package (0x04) {0x0008FFFF, 0x00, LNKD, 0x00,},
216 Package (0x04) {0x0008FFFF, 0x01, LNKA, 0x00,},
217 Package (0x04) {0x0008FFFF, 0x02, LNKB, 0x00,},
218 Package (0x04) {0x0008FFFF, 0x03, LNKC, 0x00,},
219
220 Package (0x04) {0x0009FFFF, 0x00, LNKA, 0x00,},
221 Package (0x04) {0x0009FFFF, 0x01, LNKB, 0x00,},
222 Package (0x04) {0x0009FFFF, 0x02, LNKC, 0x00,},
223 Package (0x04) {0x0009FFFF, 0x03, LNKD, 0x00,},
224
225 Package (0x04) {0x000AFFFF, 0x00, LNKB, 0x00,},
226 Package (0x04) {0x000AFFFF, 0x01, LNKC, 0x00,},
227 Package (0x04) {0x000AFFFF, 0x02, LNKD, 0x00,},
228 Package (0x04) {0x000AFFFF, 0x03, LNKA, 0x00,},
229
230 Package (0x04) {0x000BFFFF, 0x00, LNKC, 0x00,},
231 Package (0x04) {0x000BFFFF, 0x01, LNKD, 0x00,},
232 Package (0x04) {0x000BFFFF, 0x02, LNKA, 0x00,},
233 Package (0x04) {0x000BFFFF, 0x03, LNKB, 0x00,},
234
235 Package (0x04) {0x000CFFFF, 0x00, LNKD, 0x00,},
236 Package (0x04) {0x000CFFFF, 0x01, LNKA, 0x00,},
237 Package (0x04) {0x000CFFFF, 0x02, LNKB, 0x00,},
238 Package (0x04) {0x000CFFFF, 0x03, LNKC, 0x00,},
239
240 Package (0x04) {0x000DFFFF, 0x00, LNKA, 0x00,},
241 Package (0x04) {0x000DFFFF, 0x01, LNKB, 0x00,},
242 Package (0x04) {0x000DFFFF, 0x02, LNKC, 0x00,},
243 Package (0x04) {0x000DFFFF, 0x03, LNKD, 0x00,},
244
245 Package (0x04) {0x000EFFFF, 0x00, LNKB, 0x00,},
246 Package (0x04) {0x000EFFFF, 0x01, LNKC, 0x00,},
247 Package (0x04) {0x000EFFFF, 0x02, LNKD, 0x00,},
248 Package (0x04) {0x000EFFFF, 0x03, LNKA, 0x00,},
249
250 Package (0x04) {0x000FFFFF, 0x00, LNKC, 0x00,},
251 Package (0x04) {0x000FFFFF, 0x01, LNKD, 0x00,},
252 Package (0x04) {0x000FFFFF, 0x02, LNKA, 0x00,},
253 Package (0x04) {0x000FFFFF, 0x03, LNKB, 0x00,},
254
255 Package (0x04) {0x0010FFFF, 0x00, LNKD, 0x00,},
256 Package (0x04) {0x0010FFFF, 0x01, LNKA, 0x00,},
257 Package (0x04) {0x0010FFFF, 0x02, LNKB, 0x00,},
258 Package (0x04) {0x0010FFFF, 0x03, LNKC, 0x00,},
259
260 Package (0x04) {0x0011FFFF, 0x00, LNKA, 0x00,},
261 Package (0x04) {0x0011FFFF, 0x01, LNKB, 0x00,},
262 Package (0x04) {0x0011FFFF, 0x02, LNKC, 0x00,},
263 Package (0x04) {0x0011FFFF, 0x03, LNKD, 0x00,},
264
265 Package (0x04) {0x0012FFFF, 0x00, LNKB, 0x00,},
266 Package (0x04) {0x0012FFFF, 0x01, LNKC, 0x00,},
267 Package (0x04) {0x0012FFFF, 0x02, LNKD, 0x00,},
268 Package (0x04) {0x0012FFFF, 0x03, LNKA, 0x00,},
269
270 Package (0x04) {0x0013FFFF, 0x00, LNKC, 0x00,},
271 Package (0x04) {0x0013FFFF, 0x01, LNKD, 0x00,},
272 Package (0x04) {0x0013FFFF, 0x02, LNKA, 0x00,},
273 Package (0x04) {0x0013FFFF, 0x03, LNKB, 0x00,},
274
275 Package (0x04) {0x0014FFFF, 0x00, LNKD, 0x00,},
276 Package (0x04) {0x0014FFFF, 0x01, LNKA, 0x00,},
277 Package (0x04) {0x0014FFFF, 0x02, LNKB, 0x00,},
278 Package (0x04) {0x0014FFFF, 0x03, LNKC, 0x00,},
279
280 Package (0x04) {0x0015FFFF, 0x00, LNKA, 0x00,},
281 Package (0x04) {0x0015FFFF, 0x01, LNKB, 0x00,},
282 Package (0x04) {0x0015FFFF, 0x02, LNKC, 0x00,},
283 Package (0x04) {0x0015FFFF, 0x03, LNKD, 0x00,},
284
285 Package (0x04) {0x0016FFFF, 0x00, LNKB, 0x00,},
286 Package (0x04) {0x0016FFFF, 0x01, LNKC, 0x00,},
287 Package (0x04) {0x0016FFFF, 0x02, LNKD, 0x00,},
288 Package (0x04) {0x0016FFFF, 0x03, LNKA, 0x00,},
289
290 Package (0x04) {0x0017FFFF, 0x00, LNKC, 0x00,},
291 Package (0x04) {0x0017FFFF, 0x01, LNKD, 0x00,},
292 Package (0x04) {0x0017FFFF, 0x02, LNKA, 0x00,},
293 Package (0x04) {0x0017FFFF, 0x03, LNKB, 0x00,},
294
295 Package (0x04) {0x0018FFFF, 0x00, LNKD, 0x00,},
296 Package (0x04) {0x0018FFFF, 0x01, LNKA, 0x00,},
297 Package (0x04) {0x0018FFFF, 0x02, LNKB, 0x00,},
298 Package (0x04) {0x0018FFFF, 0x03, LNKC, 0x00,},
299
300 Package (0x04) {0x0019FFFF, 0x00, LNKA, 0x00,},
301 Package (0x04) {0x0019FFFF, 0x01, LNKB, 0x00,},
302 Package (0x04) {0x0019FFFF, 0x02, LNKC, 0x00,},
303 Package (0x04) {0x0019FFFF, 0x03, LNKD, 0x00,},
304
305 Package (0x04) {0x001AFFFF, 0x00, LNKB, 0x00,},
306 Package (0x04) {0x001AFFFF, 0x01, LNKC, 0x00,},
307 Package (0x04) {0x001AFFFF, 0x02, LNKD, 0x00,},
308 Package (0x04) {0x001AFFFF, 0x03, LNKA, 0x00,},
309
310 Package (0x04) {0x001BFFFF, 0x00, LNKC, 0x00,},
311 Package (0x04) {0x001BFFFF, 0x01, LNKD, 0x00,},
312 Package (0x04) {0x001BFFFF, 0x02, LNKA, 0x00,},
313 Package (0x04) {0x001BFFFF, 0x03, LNKB, 0x00,},
314
315 Package (0x04) {0x001CFFFF, 0x00, LNKD, 0x00,},
316 Package (0x04) {0x001CFFFF, 0x01, LNKA, 0x00,},
317 Package (0x04) {0x001CFFFF, 0x02, LNKB, 0x00,},
318 Package (0x04) {0x001CFFFF, 0x03, LNKC, 0x00,},
319
320 Package (0x04) {0x001DFFFF, 0x00, LNKA, 0x00,},
321 Package (0x04) {0x001DFFFF, 0x01, LNKB, 0x00,},
322 Package (0x04) {0x001DFFFF, 0x02, LNKC, 0x00,},
323 Package (0x04) {0x001DFFFF, 0x03, LNKD, 0x00,},
324
325 Package (0x04) {0x001EFFFF, 0x00, LNKB, 0x00,},
326 Package (0x04) {0x001EFFFF, 0x01, LNKC, 0x00,},
327 Package (0x04) {0x001EFFFF, 0x02, LNKD, 0x00,},
328 Package (0x04) {0x001EFFFF, 0x03, LNKA, 0x00,},
329
330 Package (0x04) {0x001FFFFF, 0x00, LNKC, 0x00,},
331 Package (0x04) {0x001FFFFF, 0x01, LNKD, 0x00,},
332 Package (0x04) {0x001FFFFF, 0x02, LNKA, 0x00,},
333 Package (0x04) {0x001FFFFF, 0x03, LNKB, 0x00,}
334 })
335
336 // PCI I/O APIC IRQ Routing table
337 // Must match pci.c:pci_slot_get_acpi_pirq
338 Name (PR01, Package ()
339 {
340 Package (0x04) {0x0002FFFF, 0x00, 0x00, 0x12,},
341 Package (0x04) {0x0002FFFF, 0x01, 0x00, 0x13,},
342 Package (0x04) {0x0002FFFF, 0x02, 0x00, 0x14,},
343 Package (0x04) {0x0002FFFF, 0x03, 0x00, 0x15,},
344
345 Package (0x04) {0x0003FFFF, 0x00, 0x00, 0x13,},
346 Package (0x04) {0x0003FFFF, 0x01, 0x00, 0x14,},
347 Package (0x04) {0x0003FFFF, 0x02, 0x00, 0x15,},
348 Package (0x04) {0x0003FFFF, 0x03, 0x00, 0x16,},
349
350 Package (0x04) {0x0004FFFF, 0x00, 0x00, 0x14,},
351 Package (0x04) {0x0004FFFF, 0x01, 0x00, 0x15,},
352 Package (0x04) {0x0004FFFF, 0x02, 0x00, 0x16,},
353 Package (0x04) {0x0004FFFF, 0x03, 0x00, 0x17,},
354
355 Package (0x04) {0x0005FFFF, 0x00, 0x00, 0x15,},
356 Package (0x04) {0x0005FFFF, 0x01, 0x00, 0x16,},
357 Package (0x04) {0x0005FFFF, 0x02, 0x00, 0x17,},
358 Package (0x04) {0x0005FFFF, 0x03, 0x00, 0x10,},
359
360 Package (0x04) {0x0006FFFF, 0x00, 0x00, 0x16,},
361 Package (0x04) {0x0006FFFF, 0x01, 0x00, 0x17,},
362 Package (0x04) {0x0006FFFF, 0x02, 0x00, 0x10,},
363 Package (0x04) {0x0006FFFF, 0x03, 0x00, 0x11,},
364
365 Package (0x04) {0x0007FFFF, 0x00, 0x00, 0x17,},
366 Package (0x04) {0x0007FFFF, 0x01, 0x00, 0x10,},
367 Package (0x04) {0x0007FFFF, 0x02, 0x00, 0x11,},
368 Package (0x04) {0x0007FFFF, 0x03, 0x00, 0x12,},
369
370 Package (0x04) {0x0008FFFF, 0x00, 0x00, 0x10,},
371 Package (0x04) {0x0008FFFF, 0x01, 0x00, 0x11,},
372 Package (0x04) {0x0008FFFF, 0x02, 0x00, 0x12,},
373 Package (0x04) {0x0008FFFF, 0x03, 0x00, 0x13,},
374
375 Package (0x04) {0x0009FFFF, 0x00, 0x00, 0x11,},
376 Package (0x04) {0x0009FFFF, 0x01, 0x00, 0x12,},
377 Package (0x04) {0x0009FFFF, 0x02, 0x00, 0x13,},
378 Package (0x04) {0x0009FFFF, 0x03, 0x00, 0x14,},
379
380 Package (0x04) {0x000AFFFF, 0x00, 0x00, 0x12,},
381 Package (0x04) {0x000AFFFF, 0x01, 0x00, 0x13,},
382 Package (0x04) {0x000AFFFF, 0x02, 0x00, 0x14,},
383 Package (0x04) {0x000AFFFF, 0x03, 0x00, 0x15,},
384
385 Package (0x04) {0x000BFFFF, 0x00, 0x00, 0x13,},
386 Package (0x04) {0x000BFFFF, 0x01, 0x00, 0x14,},
387 Package (0x04) {0x000BFFFF, 0x02, 0x00, 0x15,},
388 Package (0x04) {0x000BFFFF, 0x03, 0x00, 0x16,},
389
390 Package (0x04) {0x000CFFFF, 0x00, 0x00, 0x14,},
391 Package (0x04) {0x000CFFFF, 0x01, 0x00, 0x15,},
392 Package (0x04) {0x000CFFFF, 0x02, 0x00, 0x16,},
393 Package (0x04) {0x000CFFFF, 0x03, 0x00, 0x17,},
394
395 Package (0x04) {0x000DFFFF, 0x00, 0x00, 0x15,},
396 Package (0x04) {0x000DFFFF, 0x01, 0x00, 0x16,},
397 Package (0x04) {0x000DFFFF, 0x02, 0x00, 0x17,},
398 Package (0x04) {0x000DFFFF, 0x03, 0x00, 0x10,},
399
400 Package (0x04) {0x000EFFFF, 0x00, 0x00, 0x16,},
401 Package (0x04) {0x000EFFFF, 0x01, 0x00, 0x17,},
402 Package (0x04) {0x000EFFFF, 0x02, 0x00, 0x10,},
403 Package (0x04) {0x000EFFFF, 0x03, 0x00, 0x11,},
404
405 Package (0x04) {0x000FFFFF, 0x00, 0x00, 0x17,},
406 Package (0x04) {0x000FFFFF, 0x01, 0x00, 0x10,},
407 Package (0x04) {0x000FFFFF, 0x02, 0x00, 0x11,},
408 Package (0x04) {0x000FFFFF, 0x03, 0x00, 0x12,},
409
410 Package (0x04) {0x0010FFFF, 0x00, 0x00, 0x10,},
411 Package (0x04) {0x0010FFFF, 0x01, 0x00, 0x11,},
412 Package (0x04) {0x0010FFFF, 0x02, 0x00, 0x12,},
413 Package (0x04) {0x0010FFFF, 0x03, 0x00, 0x13,},
414
415 Package (0x04) {0x0011FFFF, 0x00, 0x00, 0x11,},
416 Package (0x04) {0x0011FFFF, 0x01, 0x00, 0x12,},
417 Package (0x04) {0x0011FFFF, 0x02, 0x00, 0x13,},
418 Package (0x04) {0x0011FFFF, 0x03, 0x00, 0x14,},
419
420 Package (0x04) {0x0012FFFF, 0x00, 0x00, 0x12,},
421 Package (0x04) {0x0012FFFF, 0x01, 0x00, 0x13,},
422 Package (0x04) {0x0012FFFF, 0x02, 0x00, 0x14,},
423 Package (0x04) {0x0012FFFF, 0x03, 0x00, 0x15,},
424
425 Package (0x04) {0x0013FFFF, 0x00, 0x00, 0x13,},
426 Package (0x04) {0x0013FFFF, 0x01, 0x00, 0x14,},
427 Package (0x04) {0x0013FFFF, 0x02, 0x00, 0x15,},
428 Package (0x04) {0x0013FFFF, 0x03, 0x00, 0x16,},
429
430 Package (0x04) {0x0014FFFF, 0x00, 0x00, 0x14,},
431 Package (0x04) {0x0014FFFF, 0x01, 0x00, 0x15,},
432 Package (0x04) {0x0014FFFF, 0x02, 0x00, 0x16,},
433 Package (0x04) {0x0014FFFF, 0x03, 0x00, 0x17,},
434
435 Package (0x04) {0x0015FFFF, 0x00, 0x00, 0x15,},
436 Package (0x04) {0x0015FFFF, 0x01, 0x00, 0x16,},
437 Package (0x04) {0x0015FFFF, 0x02, 0x00, 0x17,},
438 Package (0x04) {0x0015FFFF, 0x03, 0x00, 0x10,},
439
440 Package (0x04) {0x0016FFFF, 0x00, 0x00, 0x16,},
441 Package (0x04) {0x0016FFFF, 0x01, 0x00, 0x17,},
442 Package (0x04) {0x0016FFFF, 0x02, 0x00, 0x10,},
443 Package (0x04) {0x0016FFFF, 0x03, 0x00, 0x11,},
444
445 Package (0x04) {0x0017FFFF, 0x00, 0x00, 0x17,},
446 Package (0x04) {0x0017FFFF, 0x01, 0x00, 0x10,},
447 Package (0x04) {0x0017FFFF, 0x02, 0x00, 0x11,},
448 Package (0x04) {0x0017FFFF, 0x03, 0x00, 0x12,},
449
450 Package (0x04) {0x0018FFFF, 0x00, 0x00, 0x10,},
451 Package (0x04) {0x0018FFFF, 0x01, 0x00, 0x11,},
452 Package (0x04) {0x0018FFFF, 0x02, 0x00, 0x12,},
453 Package (0x04) {0x0018FFFF, 0x03, 0x00, 0x13,},
454
455 Package (0x04) {0x0019FFFF, 0x00, 0x00, 0x11,},
456 Package (0x04) {0x0019FFFF, 0x01, 0x00, 0x12,},
457 Package (0x04) {0x0019FFFF, 0x02, 0x00, 0x13,},
458 Package (0x04) {0x0019FFFF, 0x03, 0x00, 0x14,},
459
460 Package (0x04) {0x001AFFFF, 0x00, 0x00, 0x12,},
461 Package (0x04) {0x001AFFFF, 0x01, 0x00, 0x13,},
462 Package (0x04) {0x001AFFFF, 0x02, 0x00, 0x14,},
463 Package (0x04) {0x001AFFFF, 0x03, 0x00, 0x15,},
464
465 Package (0x04) {0x001BFFFF, 0x00, 0x00, 0x13,},
466 Package (0x04) {0x001BFFFF, 0x01, 0x00, 0x14,},
467 Package (0x04) {0x001BFFFF, 0x02, 0x00, 0x15,},
468 Package (0x04) {0x001BFFFF, 0x03, 0x00, 0x16,},
469
470 Package (0x04) {0x001CFFFF, 0x00, 0x00, 0x14,},
471 Package (0x04) {0x001CFFFF, 0x01, 0x00, 0x15,},
472 Package (0x04) {0x001CFFFF, 0x02, 0x00, 0x16,},
473 Package (0x04) {0x001CFFFF, 0x03, 0x00, 0x17,},
474
475 Package (0x04) {0x001DFFFF, 0x00, 0x00, 0x15,},
476 Package (0x04) {0x001DFFFF, 0x01, 0x00, 0x16,},
477 Package (0x04) {0x001DFFFF, 0x02, 0x00, 0x17,},
478 Package (0x04) {0x001DFFFF, 0x03, 0x00, 0x10,},
479
480 Package (0x04) {0x001EFFFF, 0x00, 0x00, 0x16,},
481 Package (0x04) {0x001EFFFF, 0x01, 0x00, 0x17,},
482 Package (0x04) {0x001EFFFF, 0x02, 0x00, 0x10,},
483 Package (0x04) {0x001EFFFF, 0x03, 0x00, 0x11,},
484
485 Package (0x04) {0x001FFFFF, 0x00, 0x00, 0x17,},
486 Package (0x04) {0x001FFFFF, 0x01, 0x00, 0x10,},
487 Package (0x04) {0x001FFFFF, 0x02, 0x00, 0x11,},
488 Package (0x04) {0x001FFFFF, 0x03, 0x00, 0x12,}
489 })
490
491 // Possible resource settings for PCI link A
492 Name (PRSA, ResourceTemplate ()
493 {
494 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
495 })
496
497 // Possible resource settings for PCI link B
498 Name (PRSB, ResourceTemplate ()
499 {
500 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
501 })
502
503 // Possible resource settings for PCI link C
504 Name (PRSC, ResourceTemplate ()
505 {
506 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
507 })
508
509 // Possible resource settings for PCI link D
510 Name (PRSD, ResourceTemplate ()
511 {
512 IRQ (Level, ActiveLow, Shared) {5,9,10,11}
513 })
514
515 // PCI bus 0
516 Device (PCI0)
517 {
518
519 Name (_HID, EisaId ("PNP0A03")) // PCI bus PNP id
520 Method(_ADR, 0, NotSerialized) // PCI address
521 {
522 Return (HBCA)
523 }
524 Name (_BBN, 0x00) // base bus address (bus number)
525 Name (_UID, 0x00)
526
527 // Method that returns routing table; also opens PCI to I/O APIC
528 // interrupt routing backdoor by writing 0xdead 0xbeef signature
529 // to ISA bridge config space. See DevPCI.cpp/pciSetIrqInternal().
530 Method (_PRT, 0, NotSerialized)
531 {
532 if (LEqual (LAnd (PICM, UIOA), Zero)) {
533 DBG ("RETURNING PIC\n")
534 Store (0x00, \_SB.PCI0.SBRG.APDE)
535 Store (0x00, \_SB.PCI0.SBRG.APAD)
536 Return (PR00)
537 }
538 else {
539 DBG ("RETURNING APIC\n")
540 Store (0xbe, \_SB.PCI0.SBRG.APDE)
541 Store (0xef, \_SB.PCI0.SBRG.APAD)
542 Return (PR01)
543 }
544 }
545
546 Device (SBRG)
547 {
548 // Address of the southbridge device (PIIX or ICH9)
549 Method(_ADR, 0, NotSerialized)
550 {
551 Return (IOCA)
552 }
553 OperationRegion (PCIC, PCI_Config, 0x00, 0xff)
554
555 Field (PCIC, ByteAcc, NoLock, Preserve)
556 {
557 Offset (0xad),
558 APAD, 8,
559 Offset (0xde),
560 APDE, 8,
561 }
562
563 // PCI MCFG MMIO ranges
564 Device (^PCIE)
565 {
566 Name (_HID, EisaId ("PNP0C02"))
567 Name (_UID, 0x11)
568 Name (CRS, ResourceTemplate ()
569 {
570 Memory32Fixed (ReadOnly,
571 0xdc000000, // Address Base
572 0x4000000, // Address Length
573 _Y13)
574 })
575 Method (_CRS, 0, NotSerialized)
576 {
577 CreateDWordField (CRS, \_SB.PCI0.PCIE._Y13._BAS, BAS1)
578 CreateDWordField (CRS, \_SB.PCI0.PCIE._Y13._LEN, LEN1)
579 Store (PCIB, BAS1)
580 Store (PCIL, LEN1)
581 Return (CRS)
582 }
583 Method (_STA, 0, NotSerialized)
584 {
585 if (LEqual (PCIB, Zero)) {
586 Return (0x00)
587 }
588 else {
589 Return (0x0F)
590 }
591 }
592 }
593
594 // Keyboard device
595 Device (PS2K)
596 {
597 Name (_HID, EisaId ("PNP0303"))
598 Method (_STA, 0, NotSerialized)
599 {
600 Return (0x0F)
601 }
602
603 Name (_CRS, ResourceTemplate ()
604 {
605 IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
606 IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
607 IRQNoFlags () {1}
608 })
609 }
610
611 // DMA Controller
612 Device (DMAC)
613 {
614 Name (_HID, EisaId ("PNP0200"))
615 Name (_CRS, ResourceTemplate ()
616 {
617 IO (Decode16, 0x0000, 0x0000, 0x01, 0x10)
618 IO (Decode16, 0x0080, 0x0080, 0x01, 0x10)
619 IO (Decode16, 0x00C0, 0x00C0, 0x01, 0x20)
620 DMA (Compatibility, BusMaster, Transfer8_16) {4}
621 })
622 }
623
624 // Floppy disk controller
625 Device (FDC0)
626 {
627 Name (_HID, EisaId ("PNP0700"))
628
629 Method (_STA, 0, NotSerialized)
630 {
631 Return (UFDC)
632 }
633
634 // Current resource settings
635 Name (_CRS, ResourceTemplate ()
636 {
637 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
638 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
639 IRQNoFlags () {6}
640 DMA (Compatibility, NotBusMaster, Transfer8) {2}
641 })
642
643 // Possible resource settings
644 Name (_PRS, ResourceTemplate ()
645 {
646 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
647 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
648 IRQNoFlags () {6}
649 DMA (Compatibility, NotBusMaster, Transfer8) {2}
650 })
651
652 }
653
654 // Mouse device
655 Device (PS2M)
656 {
657 Name (_HID, EisaId ("PNP0F03"))
658 Method (_STA, 0, NotSerialized)
659 {
660 Return (0x0F)
661 }
662
663 Name (_CRS, ResourceTemplate ()
664 {
665 IRQNoFlags () {12}
666 })
667 }
668
669 // Parallel port
670 Device (LPT)
671 {
672 Name (_HID, EisaId ("PNP0400"))
673 Method (_STA, 0, NotSerialized)
674 {
675 Return (0x0F)
676 }
677 Name (_CRS, ResourceTemplate ()
678 {
679 IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
680 IO (Decode16, 0x0778, 0x0778, 0x08, 0x08)
681 IRQNoFlags () {7}
682 })
683 }
684
685 // Serial port 0
686 Device (^SRL0)
687 {
688 Name (_HID, EisaId ("PNP0501"))
689 Name (_UID, 0x01)
690 Method (_STA, 0, NotSerialized)
691 {
692 If (LEqual (SL0B, Zero))
693 {
694 Return (0x00)
695 }
696 Else
697 {
698 Return (0x0F)
699 }
700 }
701 Name (CRS, ResourceTemplate ()
702 {
703 IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08, _Y14)
704 IRQNoFlags (_Y15) {4}
705 })
706 Method (_CRS, 0, NotSerialized)
707 {
708 CreateWordField (CRS, \_SB.PCI0.SRL0._Y14._MIN, MIN0)
709 CreateWordField (CRS, \_SB.PCI0.SRL0._Y14._MAX, MAX0)
710 CreateWordField (CRS, \_SB.PCI0.SRL0._Y15._INT, IRQ0)
711 Store (SL0B, MIN0)
712 Store (SL0B, MAX0)
713 ShiftLeft (0x01, SL0I, IRQ0)
714 Return (CRS)
715 }
716 }
717
718 // Serial port 1
719 Device (^SRL1)
720 {
721 Name (_HID, EisaId ("PNP0501"))
722 Name (_UID, 0x02)
723 Method (_STA, 0, NotSerialized)
724 {
725 If (LEqual (SL1B, Zero))
726 {
727 Return (0x00)
728 }
729 Else
730 {
731 Return (0x0F)
732 }
733 }
734 Name (CRS, ResourceTemplate ()
735 {
736 IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08, _Y16)
737 IRQNoFlags (_Y17) {3}
738 })
739 Method (_CRS, 0, NotSerialized)
740 {
741 CreateWordField (CRS, \_SB.PCI0.SRL1._Y16._MIN, MIN1)
742 CreateWordField (CRS, \_SB.PCI0.SRL1._Y16._MAX, MAX1)
743 CreateWordField (CRS, \_SB.PCI0.SRL1._Y17._INT, IRQ1)
744 Store (SL1B, MIN1)
745 Store (SL1B, MAX1)
746 ShiftLeft (0x01, SL1I, IRQ1)
747 Return (CRS)
748 }
749 }
750
751 // Programmable Interval Timer (i8254)
752 Device (TIMR)
753 {
754 Name (_HID, EisaId ("PNP0100"))
755 Name (_CRS, ResourceTemplate ()
756 {
757 IO (Decode16,
758 0x0040, // Range Minimum
759 0x0040, // Range Maximum
760 0x00, // Alignment
761 0x04, // Length
762 )
763 IO (Decode16,
764 0x0050, // Range Minimum
765 0x0050, // Range Maximum
766 0x10, // Alignment
767 0x04, // Length
768 )
769 })
770 }
771
772 // Programmable Interrupt Controller (i8259)
773 Device (PIC)
774 {
775 Name (_HID, EisaId ("PNP0000"))
776 Name (_CRS, ResourceTemplate ()
777 {
778 IO (Decode16,
779 0x0020, // Range Minimum
780 0x0020, // Range Maximum
781 0x00, // Alignment
782 0x02, // Length
783 )
784 IO (Decode16,
785 0x00A0, // Range Minimum
786 0x00A0, // Range Maximum
787 0x00, // Alignment
788 0x02, // Length
789 )
790 // because in APIC configs PIC connected to pin 0,
791 // and ISA IRQ0 rerouted to pin 2
792 IRQNoFlags ()
793 {2}
794 })
795 }
796
797
798 // Real Time Clock and CMOS (MC146818)
799 Device (RTC)
800 {
801 Name (_HID, EisaId ("PNP0B00"))
802 Name (_CRS, ResourceTemplate ()
803 {
804 IO (Decode16,
805 0x0070, // Range Minimum
806 0x0070, // Range Maximum
807 0x01, // Alignment
808 0x02, // Length
809 )
810 })
811 Method (_STA, 0, NotSerialized)
812 {
813 Return (URTC)
814 }
815 }
816
817 // High Precision Event Timer
818 Device(HPET)
819 {
820 Name (_HID, EISAID("PNP0103"))
821 Name (_CID, EISAID("PNP0C01"))
822 Name(_UID, 0)
823
824 Method (_STA, 0, NotSerialized)
825 {
826 Return(UHPT)
827 }
828
829 Name(CRS, ResourceTemplate()
830 {
831 IRQNoFlags ()
832 {0}
833 IRQNoFlags ()
834 {8}
835 Memory32Fixed (ReadWrite,
836 0xFED00000, // Address Base
837 0x00000400 // Address Length
838 )
839 })
840
841 Method (_CRS, 0, NotSerialized)
842 {
843 Return (CRS)
844 }
845 }
846
847 // System Management Controller
848 Device (SMC)
849 {
850 Name (_HID, EisaId ("APP0001"))
851 Name (_CID, "smc-napa")
852
853 Method (_STA, 0, NotSerialized)
854 {
855 Return (USMC)
856 }
857 Name (CRS, ResourceTemplate ()
858 {
859 IO (Decode16,
860 0x0300, // Range Minimum
861 0x0300, // Range Maximum
862 0x01, // Alignment
863 0x20) // Length
864 IRQNoFlags ()
865 {6}
866
867 })
868 Method (_CRS, 0, NotSerialized)
869 {
870 Return (CRS)
871 }
872 }
873 }
874
875 // NIC
876 Device (GIGE)
877 {
878 /**
879 * Generic NIC, according to
880 * http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/devids.txt
881 * Needed by some Windows guests.
882 */
883 Name (_HID, EisaId ("PNP8390"))
884
885 Method(_ADR, 0, NotSerialized)
886 {
887 Return (NICA)
888 }
889 /* Name (_PRW, Package (0x02)
890 {
891 0x09,
892 0x04
893 }) */
894
895 /* Wake up on LAN? */
896 Method (EWOL, 1, NotSerialized)
897 {
898 Return (0x00)
899 }
900
901 Method (_STA, 0, NotSerialized)
902 {
903 if (LEqual (NICA, Zero)) {
904 Return (0x00)
905 }
906 else {
907 Return (0x0F)
908 }
909 }
910 }
911
912 // HDA Audio card
913 Device (HDEF)
914 {
915 Method(_DSM, 4, NotSerialized)
916 {
917 Store (Package (0x04)
918 {
919 "layout-id",
920 Buffer (0x04)
921 {
922 /* 04 */ 0x04, 0x00, 0x00, 0x00
923 },
924
925 "PinConfigurations",
926 Buffer (Zero) {}
927 }, Local0)
928 if (LEqual (Arg0, ToUUID("a0b5b7c6-1318-441c-b0c9-fe695eaf949b")))
929 {
930 If (LEqual (Arg1, One))
931 {
932 if (LEqual(Arg2, Zero))
933 {
934 Store (Buffer (0x01)
935 {
936 0x03
937 }
938 , Local0)
939 Return (Local0)
940 }
941 if (LEqual(Arg2, One))
942 {
943 Return (Local0)
944 }
945 }
946 }
947 Store (Buffer (0x01)
948 {
949 0x0
950 }
951 , Local0)
952 Return (Local0)
953 }
954
955 Method(_ADR, 0, NotSerialized)
956 {
957 Return (HDAA)
958 }
959
960 Method (_STA, 0, NotSerialized)
961 {
962 if (LEqual (HDAA, Zero)) {
963 Return (0x00)
964 }
965 else {
966 Return (0x0F)
967 }
968 }
969 }
970
971
972 // Control method battery
973 Device (BAT0)
974 {
975 Name (_HID, EisaId ("PNP0C0A"))
976 Name (_UID, 0x00)
977
978 Scope (\_GPE)
979 {
980 // GPE bit 0 handler
981 // GPE.0 must be set and SCI raised when
982 // battery info changed and _BIF must be
983 // re-evaluated
984 Method (_L00, 0, NotSerialized)
985 {
986 Notify (\_SB.PCI0.BAT0, 0x81)
987 }
988 }
989
990 OperationRegion (CBAT, SystemIO, 0x4040, 0x08)
991 Field (CBAT, DwordAcc, NoLock, Preserve)
992 {
993 IDX0, 32,
994 DAT0, 32,
995 }
996
997 IndexField (IDX0, DAT0, DwordAcc, NoLock, Preserve)
998 {
999 STAT, 32,
1000 PRAT, 32,
1001 RCAP, 32,
1002 PVOL, 32,
1003
1004 UNIT, 32,
1005 DCAP, 32,
1006 LFCP, 32,
1007 BTEC, 32,
1008 DVOL, 32,
1009 DWRN, 32,
1010 DLOW, 32,
1011 GRN1, 32,
1012 GRN2, 32,
1013
1014 BSTA, 32,
1015 APSR, 32,
1016 }
1017
1018 Method (_STA, 0, NotSerialized)
1019 {
1020 return (BSTA)
1021 }
1022
1023 Name (PBIF, Package ()
1024 {
1025 0x01, // Power unit, 1 - mA
1026 0x7fffffff, // Design capacity
1027 0x7fffffff, // Last full charge capacity
1028 0x00, // Battery technology
1029 0xffffffff, // Design voltage
1030 0x00, // Design capacity of Warning
1031 0x00, // Design capacity of Low
1032 0x04, // Battery capacity granularity 1
1033 0x04, // Battery capacity granularity 2
1034 "1", // Model number
1035 "0", // Serial number
1036 "VBOX", // Battery type
1037 "innotek" // OEM Information
1038 })
1039
1040 Name (PBST, Package () {
1041 0, // Battery state
1042 0x7fffffff, // Battery present rate
1043 0x7fffffff, // Battery remaining capacity
1044 0x7fffffff // Battery present voltage
1045 })
1046
1047 // Battery information
1048 Method (_BIF, 0, NotSerialized)
1049 {
1050 Store (UNIT, Index (PBIF, 0,))
1051 Store (DCAP, Index (PBIF, 1,))
1052 Store (LFCP, Index (PBIF, 2,))
1053 Store (BTEC, Index (PBIF, 3,))
1054 Store (DVOL, Index (PBIF, 4,))
1055 Store (DWRN, Index (PBIF, 5,))
1056 Store (DLOW, Index (PBIF, 6,))
1057 Store (GRN1, Index (PBIF, 7,))
1058 Store (GRN2, Index (PBIF, 8,))
1059
1060 DBG ("_BIF:\n")
1061 HEX4 (DerefOf (Index (PBIF, 0,)))
1062 HEX4 (DerefOf (Index (PBIF, 1,)))
1063 HEX4 (DerefOf (Index (PBIF, 2,)))
1064 HEX4 (DerefOf (Index (PBIF, 3,)))
1065 HEX4 (DerefOf (Index (PBIF, 4,)))
1066 HEX4 (DerefOf (Index (PBIF, 5,)))
1067 HEX4 (DerefOf (Index (PBIF, 6,)))
1068 HEX4 (DerefOf (Index (PBIF, 7,)))
1069 HEX4 (DerefOf (Index (PBIF, 8,)))
1070
1071 return (PBIF)
1072 }
1073
1074 // Battery status
1075 Method (_BST, 0, NotSerialized)
1076 {
1077 Store (STAT, Index (PBST, 0,))
1078 Store (PRAT, Index (PBST, 1,))
1079 Store (RCAP, Index (PBST, 2,))
1080 Store (PVOL, Index (PBST, 3,))
1081/*
1082 DBG ("_BST:\n")
1083 HEX4 (DerefOf (Index (PBST, 0,)))
1084 HEX4 (DerefOf (Index (PBST, 1,)))
1085 HEX4 (DerefOf (Index (PBST, 2,)))
1086 HEX4 (DerefOf (Index (PBST, 3,)))
1087*/
1088 return (PBST)
1089 }
1090 }
1091
1092 Device (AC)
1093 {
1094 Name (_HID, "ACPI0003")
1095 Name (_UID, 0x00)
1096 Name (_PCL, Package (0x01)
1097 {
1098 \_SB
1099 })
1100
1101 Method (_PSR, 0, NotSerialized)
1102 {
1103 // DBG ("_PSR:\n")
1104 // HEX4 (\_SB.PCI0.BAT0.APSR)
1105 return (\_SB.PCI0.BAT0.APSR)
1106 }
1107
1108 Method (_STA, 0, NotSerialized)
1109 {
1110 return (0x0f)
1111 }
1112 }
1113 }
1114 }
1115
1116 Scope (\_SB)
1117 {
1118 Scope (PCI0)
1119 {
1120 // PCI0 current resource settings
1121 Name (CRS, ResourceTemplate ()
1122 {
1123 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
1124 0x0000,
1125 0x0000,
1126 0x00FF,
1127 0x0000,
1128 0x0100)
1129 IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
1130 WordIO (ResourceProducer, MinFixed, MaxFixed,
1131 PosDecode, EntireRange,
1132 0x0000,
1133 0x0000,
1134 0x0CF7,
1135 0x0000,
1136 0x0CF8)
1137 WordIO (ResourceProducer, MinFixed, MaxFixed,
1138 PosDecode, EntireRange,
1139 0x0000,
1140 0x0D00,
1141 0xFFFF,
1142 0x0000,
1143 0xF300)
1144
1145 /* Taken from ACPI faq (with some modifications) */
1146 DwordMemory( // descriptor for video RAM behind ISA bus
1147 ResourceProducer, // bit 0 of general flags is 0
1148 PosDecode,
1149 MinFixed, // Range is fixed
1150 MaxFixed, // Range is Fixed
1151 Cacheable,
1152 ReadWrite,
1153 0x00000000, // Granularity
1154 0x000a0000, // Min
1155 0x000bffff, // Max
1156 0x00000000, // Translation
1157 0x00020000 // Range Length
1158 )
1159
1160 DwordMemory( // Consumed-and-produced resource
1161 // (all of low memory space)
1162 ResourceProducer, // bit 0 of general flags is 0
1163 PosDecode, // positive Decode
1164 MinNotFixed, // Range is not fixed
1165 MaxFixed, // Range is fixed
1166 Cacheable,
1167 ReadWrite,
1168 0x00000000, // Granularity
1169 0x00000000, // Min (calculated dynamically)
1170
1171 0xffdfffff, // Max = 4GB - 2MB
1172 0x00000000, // Translation
1173 0x00000000, // Range Length (calculated
1174 // dynamically)
1175 , // Optional field left blank
1176 , // Optional field left blank
1177 MEM3 // Name declaration for this
1178 // descriptor
1179 )
1180 })
1181
1182// Name (TOM, ResourceTemplate () // Memory above 4GB (aka high), appended when needed.
1183// {
1184// QWORDMemory(
1185// ResourceProducer, // bit 0 of general flags is 0
1186// PosDecode, // positive Decode
1187// MinFixed, // Range is fixed
1188// MaxFixed, // Range is fixed
1189// Cacheable,
1190// ReadWrite,
1191// 0x0000000000000000, // _GRA: Granularity.
1192// 0 /*0x0000000100000000*/, // _MIN: Min address, 4GB.
1193// 0 /*0x00000fffffffffff*/, // _MAX: Max possible address, 16TB.
1194// 0x0000000000000000, // _TRA: Translation
1195// 0x0000000000000000, // _LEN: Range length (calculated dynamically)
1196// , // ResourceSourceIndex: Optional field left blank
1197// , // ResourceSource: Optional field left blank
1198// MEM4 // Name declaration for this descriptor.
1199// )
1200// })
1201
1202 Method (_CRS, 0, NotSerialized)
1203 {
1204 CreateDwordField (CRS, \_SB.PCI0.MEM3._MIN, RAMT)
1205 CreateDwordField (CRS, \_SB.PCI0.MEM3._LEN, RAMR)
1206// CreateQwordField (TOM, \_SB.PCI0.MEM4._LEN, TM4L)
1207// CreateQwordField (TOM, \_SB.PCI0.MEM4._LEN, TM4N)
1208// CreateQwordField (TOM, \_SB.PCI0.MEM4._LEN, TM4X)
1209
1210 Store (MEML, RAMT)
1211 Subtract (0xffe00000, RAMT, RAMR)
1212
1213// If (LNotEqual (MEMH, 0x00000000))
1214// {
1215// //
1216// // Update the TOM resource template and append it to CRS.
1217// // This way old < 4GB guest doesn't see anything different.
1218// // (MEMH is the memory above 4GB specified in 64KB units.)
1219// //
1220// // Note: ACPI v2 doesn't do 32-bit integers. IASL may fail on
1221// // seeing 64-bit constants and the code probably wont work.
1222// //
1223// Store (1, TM4N)
1224// ShiftLeft (TM4N, 32, TM4N)
1225//
1226// Store (0x00000fff, TM4X)
1227// ShiftLeft (TM4X, 32, TM4X)
1228// Or (TM4X, 0xffffffff, TM4X)
1229//
1230// Store (MEMH, TM4L)
1231// ShiftLeft (TM4L, 16, TM4L)
1232//
1233// ConcatenateResTemplate (CRS, TOM, Local2)
1234// Return (Local2)
1235// }
1236
1237 Return (CRS)
1238 }
1239 }
1240 }
1241
1242 Scope (\_SB)
1243 {
1244 // Fields within PIIX3 configuration[0x60..0x63] with
1245 // IRQ mappings
1246 Field (\_SB.PCI0.SBRG.PCIC, ByteAcc, NoLock, Preserve)
1247 {
1248 Offset (0x60),
1249 PIRA, 8,
1250 PIRB, 8,
1251 PIRC, 8,
1252 PIRD, 8
1253 }
1254
1255 Name (BUFA, ResourceTemplate ()
1256 {
1257 IRQ (Level, ActiveLow, Shared) {15}
1258 })
1259 CreateWordField (BUFA, 0x01, ICRS)
1260
1261 // Generic status of IRQ routing entry
1262 Method (LSTA, 1, NotSerialized)
1263 {
1264 And (Arg0, 0x80, Local0)
1265// DBG ("LSTA: ")
1266// HEX (Arg0)
1267 If (Local0)
1268 {
1269 Return (0x09)
1270 }
1271 Else
1272 {
1273 Return (0x0B)
1274 }
1275 }
1276
1277 // Generic "current resource settings" for routing entry
1278 Method (LCRS, 1, NotSerialized)
1279 {
1280 And (Arg0, 0x0F, Local0)
1281 ShiftLeft (0x01, Local0, ICRS)
1282// DBG ("LCRS: ")
1283// HEX (ICRS)
1284 Return (BUFA)
1285 }
1286
1287 // Generic "set resource settings" for routing entry
1288 Method (LSRS, 1, NotSerialized)
1289 {
1290 CreateWordField (Arg0, 0x01, ISRS)
1291 FindSetRightBit (ISRS, Local0)
1292 Return (Decrement (Local0))
1293 }
1294
1295 // Generic "disable" for routing entry
1296 Method (LDIS, 1, NotSerialized)
1297 {
1298 Return (Or (Arg0, 0x80))
1299 }
1300
1301 // Link A
1302 Device (LNKA)
1303 {
1304 Name (_HID, EisaId ("PNP0C0F"))
1305 Name (_UID, 0x01)
1306
1307 // Status
1308 Method (_STA, 0, NotSerialized)
1309 {
1310 DBG ("LNKA._STA\n")
1311 Return (LSTA (PIRA))
1312 }
1313
1314 // Possible resource settings
1315 Method (_PRS, 0, NotSerialized)
1316 {
1317 DBG ("LNKA._PRS\n")
1318 Return (PRSA)
1319 }
1320
1321 // Disable
1322 Method (_DIS, 0, NotSerialized)
1323 {
1324 DBG ("LNKA._DIS\n")
1325 Store (LDIS (PIRA), PIRA)
1326 }
1327
1328 // Current resource settings
1329 Method (_CRS, 0, NotSerialized)
1330 {
1331 DBG ("LNKA._CRS\n")
1332 Return (LCRS (PIRA))
1333 }
1334
1335 // Set resource settings
1336 Method (_SRS, 1, NotSerialized)
1337 {
1338 DBG ("LNKA._SRS: ")
1339 HEX (LSRS (Arg0))
1340 Store (LSRS (Arg0), PIRA)
1341 }
1342 }
1343
1344 // Link B
1345 Device (LNKB)
1346 {
1347 Name (_HID, EisaId ("PNP0C0F"))
1348 Name (_UID, 0x02)
1349 Method (_STA, 0, NotSerialized)
1350 {
1351 // DBG ("LNKB._STA\n")
1352 Return (LSTA (PIRB))
1353 }
1354
1355 Method (_PRS, 0, NotSerialized)
1356 {
1357 // DBG ("LNKB._PRS\n")
1358 Return (PRSB)
1359 }
1360
1361 Method (_DIS, 0, NotSerialized)
1362 {
1363 // DBG ("LNKB._DIS\n")
1364 Store (LDIS (PIRB), PIRB)
1365 }
1366
1367 Method (_CRS, 0, NotSerialized)
1368 {
1369 // DBG ("LNKB._CRS\n")
1370 Return (LCRS (PIRB))
1371 }
1372
1373 Method (_SRS, 1, NotSerialized)
1374 {
1375 DBG ("LNKB._SRS: ")
1376 HEX (LSRS (Arg0))
1377 Store (LSRS (Arg0), PIRB)
1378 }
1379 }
1380
1381 // Link C
1382 Device (LNKC)
1383 {
1384 Name (_HID, EisaId ("PNP0C0F"))
1385 Name (_UID, 0x03)
1386 Method (_STA, 0, NotSerialized)
1387 {
1388 // DBG ("LNKC._STA\n")
1389 Return (LSTA (PIRC))
1390 }
1391
1392 Method (_PRS, 0, NotSerialized)
1393 {
1394 // DBG ("LNKC._PRS\n")
1395 Return (PRSC)
1396 }
1397
1398 Method (_DIS, 0, NotSerialized)
1399 {
1400 // DBG ("LNKC._DIS\n")
1401 Store (LDIS (PIRC), PIRC)
1402 }
1403
1404 Method (_CRS, 0, NotSerialized)
1405 {
1406 // DBG ("LNKC._CRS\n")
1407 Return (LCRS (PIRC))
1408 }
1409
1410 Method (_SRS, 1, NotSerialized)
1411 {
1412 DBG ("LNKC._SRS: ")
1413 HEX (LSRS (Arg0))
1414 Store (LSRS (Arg0), PIRC)
1415 }
1416 }
1417
1418 // Link D
1419 Device (LNKD)
1420 {
1421 Name (_HID, EisaId ("PNP0C0F"))
1422 Name (_UID, 0x04)
1423 Method (_STA, 0, NotSerialized)
1424 {
1425 // DBG ("LNKD._STA\n")
1426 Return (LSTA (PIRD))
1427 }
1428
1429 Method (_PRS, 0, NotSerialized)
1430 {
1431 // DBG ("LNKD._PRS\n")
1432 Return (PRSD)
1433 }
1434
1435 Method (_DIS, 0, NotSerialized)
1436 {
1437 // DBG ("LNKD._DIS\n")
1438 Store (LDIS (PIRA), PIRD)
1439 }
1440
1441 Method (_CRS, 0, NotSerialized)
1442 {
1443 // DBG ("LNKD._CRS\n")
1444 Return (LCRS (PIRD))
1445 }
1446
1447 Method (_SRS, 1, NotSerialized)
1448 {
1449 DBG ("LNKD._SRS: ")
1450 HEX (LSRS (Arg0))
1451 Store (LSRS (Arg0), PIRD)
1452 }
1453 }
1454 }
1455
1456 // Sx states
1457 Name (_S0, Package (2) {
1458 0x00,
1459 0x00,
1460 })
1461
1462 // Shift one by the power state number
1463 If (And(PWRS, ShiftLeft(One,1))) {
1464 Name (_S1, Package (2) {
1465 0x01,
1466 0x01,
1467 })
1468 }
1469
1470 If (And(PWRS, ShiftLeft(One,4))) {
1471 Name (_S4, Package (2) {
1472 0x05,
1473 0x05,
1474 })
1475 }
1476
1477 Name (_S5, Package (2) {
1478 0x05,
1479 0x05,
1480 })
1481
1482 Method (_PTS, 1, NotSerialized)
1483 {
1484 DBG ("Prepare to sleep: ")
1485 HEX (Arg0)
1486 }
1487}
1488
1489/*
1490 * Local Variables:
1491 * comment-start: "//"
1492 * End:
1493 */
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