]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Acpi/AcpiTables/Dsdt/PciIrq.asi
QuarkPlatformPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / QuarkPlatformPkg / Acpi / AcpiTables / Dsdt / PciIrq.asi
1 /** @file
2
3 Copyright (c) 2013-2015 Intel Corporation.
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9
10 // Interrupts can be DEB8=all except 13,8,6,2,1,0
11
12 #ifndef PCIIRQ_ASI
13 #define PCIIRQ_ASI
14
15 OperationRegion(PRR0, PCI_Config, 0x60, 0x08)
16 Field(PRR0, ANYACC, NOLOCK, PRESERVE)
17 {
18 PIRA, 8,
19 PIRB, 8,
20 PIRC, 8,
21 PIRD, 8,
22 PIRE, 8,
23 PIRF, 8,
24 PIRG, 8,
25 PIRH, 8
26 }
27
28 Device(LNKA) // PCI IRQ link A
29 {
30 Name(_HID,EISAID("PNP0C0F"))
31
32 Name(_UID, 1)
33
34 Method(_STA,0,NotSerialized)
35 {
36 If(And(PIRA, 0x80))
37 {
38 Return(0x9)
39 }
40 Else
41 {
42 Return(0xB)
43 } // Don't display
44 }
45
46 Method(_DIS,0,NotSerialized)
47 {
48 Or(PIRA, 0x80, PIRA)
49 }
50
51 Method(_CRS,0,Serialized)
52 {
53 Name(BUF0,
54 ResourceTemplate()
55 {IRQ(Level,ActiveLow,Shared){0}})
56
57 // Define references to buffer elements
58 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
59 // Write current settings into IRQ descriptor
60 If (And(PIRA, 0x80))
61 {
62 Store(Zero, Local0)
63 }
64 Else
65 {
66 Store(One,Local0)
67 }
68 // Shift 1 by value in register 70
69 ShiftLeft(Local0,And(PIRA,0x0F),IRQW) // Save in buffer
70 Return(BUF0) // Return Buf0
71 } // End of _CRS method
72
73 Name(_PRS,
74 ResourceTemplate()
75 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
76
77 Method(_SRS,1,NotSerialized)
78 {
79 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
80
81 FindSetRightBit(IRQW,Local0) // Set IRQ
82 If (LNotEqual(IRQW,Zero))
83 {
84 And(Local0, 0x7F,Local0)
85 Decrement(Local0)
86 }
87 Else
88 {
89 Or(Local0, 0x80,Local0)
90 }
91 store(Local0, PIRA)
92 } // End of _SRS Method
93 }
94
95 Device(LNKB) // PCI IRQ link B
96 {
97 Name(_HID,EISAID("PNP0C0F"))
98
99 Name(_UID, 2)
100
101 Method(_STA,0,NotSerialized)
102 {
103 If(And(PIRB, 0x80))
104 {
105 Return(0x9)
106 }
107 Else
108 {
109 Return(0xB)
110 } // Don't display
111 }
112
113 Method(_DIS,0,NotSerialized)
114 {
115 Or(PIRB, 0x80,PIRB)
116 }
117
118 Method(_CRS,0,Serialized)
119 {
120 Name(BUF0,
121 ResourceTemplate()
122 {IRQ(Level,ActiveLow,Shared){0}})
123 // Define references to buffer elements
124 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
125 // Write current settings into IRQ descriptor
126 If (And(PIRB, 0x80))
127 {
128 Store(Zero, Local0)
129 }
130 Else
131 {
132 Store(One,Local0)
133 }
134 // Shift 1 by value in register 70
135 ShiftLeft(Local0,And(PIRB,0x0F),IRQW) // Save in buffer
136 Return(BUF0) // Return Buf0
137 } // End of _CRS method
138
139 Name(_PRS,
140 ResourceTemplate()
141 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
142
143 Method(_SRS,1,NotSerialized)
144 {
145 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
146
147 FindSetRightBit(IRQW,Local0) // Set IRQ
148 If (LNotEqual(IRQW,Zero))
149 {
150 And(Local0, 0x7F,Local0)
151 Decrement(Local0)
152 }
153 Else
154 {
155 Or(Local0, 0x80,Local0)
156 }
157 Store(Local0, PIRB)
158 } // End of _SRS Method
159 }
160
161 Device(LNKC) // PCI IRQ link C
162 {
163 Name(_HID,EISAID("PNP0C0F"))
164
165 Name(_UID, 3)
166
167 Method(_STA,0,NotSerialized)
168 {
169 If(And(PIRC, 0x80))
170 {
171 Return(0x9)
172 }
173 Else
174 {
175 Return(0xB)
176 } // Don't display
177 }
178
179 Method(_DIS,0,NotSerialized)
180 {
181 Or(PIRC, 0x80,PIRC)
182 }
183
184 Method(_CRS,0,Serialized)
185 {
186 Name(BUF0,
187 ResourceTemplate()
188 {IRQ(Level,ActiveLow,Shared){0}})
189 // Define references to buffer elements
190 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
191 // Write current settings into IRQ descriptor
192 If (And(PIRC, 0x80))
193 {
194 Store(Zero, Local0)
195 }
196 Else
197 {
198 Store(One,Local0)
199 } // Shift 1 by value in register 70
200 ShiftLeft(Local0,And(PIRC,0x0F),IRQW) // Save in buffer
201 Return(BUF0) // Return Buf0
202 } // End of _CRS method
203
204 Name(_PRS,
205 ResourceTemplate()
206 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
207
208 Method(_SRS,1,NotSerialized)
209 {
210 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
211
212 FindSetRightBit(IRQW,Local0) // Set IRQ
213 If (LNotEqual(IRQW,Zero))
214 {
215 And(Local0, 0x7F,Local0)
216 Decrement(Local0)
217 }
218 Else {
219 Or(Local0, 0x80,Local0)
220 }
221 Store(Local0, PIRC)
222 } // End of _SRS Method
223 }
224
225 Device(LNKD) // PCI IRQ link D
226 {
227 Name(_HID,EISAID("PNP0C0F"))
228
229 Name(_UID, 4)
230
231 Method(_STA,0,NotSerialized)
232 {
233 If(And(PIRD, 0x80))
234 {
235 Return(0x9)
236 }
237 Else
238 {
239 Return(0xB)
240 } // Don't display
241 }
242
243 Method(_DIS,0,NotSerialized)
244 {
245 Or(PIRD, 0x80,PIRD)
246 }
247
248 Method(_CRS,0,Serialized)
249 {
250 Name(BUF0,
251 ResourceTemplate()
252 {IRQ(Level,ActiveLow,Shared){0}})
253 // Define references to buffer elements
254 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
255 // Write current settings into IRQ descriptor
256 If (And(PIRD, 0x80))
257 {
258 Store(Zero, Local0)
259 }
260 Else
261 {
262 Store(One,Local0)
263 } // Shift 1 by value in register 70
264 ShiftLeft(Local0,And(PIRD,0x0F),IRQW) // Save in buffer
265 Return(BUF0) // Return Buf0
266 } // End of _CRS method
267
268 Name(_PRS,
269 ResourceTemplate()
270 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
271
272 Method(_SRS,1,NotSerialized)
273 {
274 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
275
276 FindSetRightBit(IRQW,Local0)// Set IRQ
277 If (LNotEqual(IRQW,Zero))
278 {
279 And(Local0, 0x7F,Local0)
280 Decrement(Local0)
281 }
282 Else
283 {
284 Or(Local0, 0x80,Local0)
285 }
286 Store(Local0, PIRD)
287 } // End of _SRS Method
288 }
289
290 Device(LNKE) // PCI IRQ link E
291 {
292 Name(_HID,EISAID("PNP0C0F"))
293
294 Name(_UID, 5)
295
296 Method(_STA,0,NotSerialized)
297 {
298 If(And(PIRE, 0x80))
299 {
300 Return(0x9)
301 }
302 Else
303 {
304 Return(0xB)
305 } // Don't display
306 }
307
308 Method(_DIS,0,NotSerialized)
309 {
310 Or(PIRE, 0x80, PIRE)
311 }
312
313 Method(_CRS,0,Serialized)
314 {
315 Name(BUF0,
316 ResourceTemplate()
317 {IRQ(Level,ActiveLow,Shared){0}})
318
319 // Define references to buffer elements
320 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
321 // Write current settings into IRQ descriptor
322 If (And(PIRE, 0x80))
323 {
324 Store(Zero, Local0)
325 }
326 Else
327 {
328 Store(One,Local0)
329 }
330 // Shift 1 by value in register 70
331 ShiftLeft(Local0,And(PIRE,0x0F),IRQW) // Save in buffer
332 Return(BUF0) // Return Buf0
333 } // End of _CRS method
334
335 Name(_PRS,
336 ResourceTemplate()
337 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
338
339 Method(_SRS,1,NotSerialized)
340 {
341 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
342
343 FindSetRightBit(IRQW,Local0) // Set IRQ
344 If (LNotEqual(IRQW,Zero))
345 {
346 And(Local0, 0x7F,Local0)
347 Decrement(Local0)
348 }
349 Else
350 {
351 Or(Local0, 0x80,Local0)
352 }
353 store(Local0, PIRE)
354 } // End of _SRS Method
355 }
356
357 Device(LNKF) // PCI IRQ link F
358 {
359 Name(_HID,EISAID("PNP0C0F"))
360
361 Name(_UID, 6)
362
363 Method(_STA,0,NotSerialized)
364 {
365 If(And(PIRF, 0x80))
366 {
367 Return(0x9)
368 }
369 Else
370 {
371 Return(0xB)
372 } // Don't display
373 }
374
375 Method(_DIS,0,NotSerialized)
376 {
377 Or(PIRB, 0x80,PIRF)
378 }
379
380 Method(_CRS,0,Serialized)
381 {
382 Name(BUF0,
383 ResourceTemplate()
384 {IRQ(Level,ActiveLow,Shared){0}})
385 // Define references to buffer elements
386 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
387 // Write current settings into IRQ descriptor
388 If (And(PIRF, 0x80))
389 {
390 Store(Zero, Local0)
391 }
392 Else
393 {
394 Store(One,Local0)
395 }
396 // Shift 1 by value in register 70
397 ShiftLeft(Local0,And(PIRF,0x0F),IRQW) // Save in buffer
398 Return(BUF0) // Return Buf0
399 } // End of _CRS method
400
401 Name(_PRS,
402 ResourceTemplate()
403 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
404
405 Method(_SRS,1,NotSerialized)
406 {
407 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
408
409 FindSetRightBit(IRQW,Local0) // Set IRQ
410 If (LNotEqual(IRQW,Zero))
411 {
412 And(Local0, 0x7F,Local0)
413 Decrement(Local0)
414 }
415 Else
416 {
417 Or(Local0, 0x80,Local0)
418 }
419 Store(Local0, PIRF)
420 } // End of _SRS Method
421 }
422
423 Device(LNKG) // PCI IRQ link G
424 {
425 Name(_HID,EISAID("PNP0C0F"))
426
427 Name(_UID, 7)
428
429 Method(_STA,0,NotSerialized)
430 {
431 If(And(PIRG, 0x80))
432 {
433 Return(0x9)
434 }
435 Else
436 {
437 Return(0xB)
438 } // Don't display
439 }
440
441 Method(_DIS,0,NotSerialized)
442 {
443 Or(PIRG, 0x80,PIRG)
444 }
445
446 Method(_CRS,0,Serialized)
447 {
448 Name(BUF0,
449 ResourceTemplate()
450 {IRQ(Level,ActiveLow,Shared){0}})
451 // Define references to buffer elements
452 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
453 // Write current settings into IRQ descriptor
454 If (And(PIRG, 0x80))
455 {
456 Store(Zero, Local0)
457 }
458 Else
459 {
460 Store(One,Local0)
461 } // Shift 1 by value in register 70
462 ShiftLeft(Local0,And(PIRG,0x0F),IRQW) // Save in buffer
463 Return(BUF0) // Return Buf0
464 } // End of _CRS method
465
466 Name(_PRS,
467 ResourceTemplate()
468 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
469
470 Method(_SRS,1,NotSerialized)
471 {
472 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
473
474 FindSetRightBit(IRQW,Local0) // Set IRQ
475 If (LNotEqual(IRQW,Zero))
476 {
477 And(Local0, 0x7F,Local0)
478 Decrement(Local0)
479 }
480 Else {
481 Or(Local0, 0x80,Local0)
482 }
483 Store(Local0, PIRG)
484 } // End of _SRS Method
485 }
486
487 Device(LNKH) // PCI IRQ link H
488 {
489 Name(_HID,EISAID("PNP0C0F"))
490
491 Name(_UID, 8)
492
493 Method(_STA,0,NotSerialized)
494 {
495 If(And(PIRH, 0x80))
496 {
497 Return(0x9)
498 }
499 Else
500 {
501 Return(0xB)
502 } // Don't display
503 }
504
505 Method(_DIS,0,NotSerialized)
506 {
507 Or(PIRH, 0x80,PIRH)
508 }
509
510 Method(_CRS,0,Serialized)
511 {
512 Name(BUF0,
513 ResourceTemplate()
514 {IRQ(Level,ActiveLow,Shared){0}})
515 // Define references to buffer elements
516 CreateWordField (BUF0, 0x01, IRQW) // IRQ low
517 // Write current settings into IRQ descriptor
518 If (And(PIRH, 0x80))
519 {
520 Store(Zero, Local0)
521 }
522 Else
523 {
524 Store(One,Local0)
525 } // Shift 1 by value in register 70
526 ShiftLeft(Local0,And(PIRH,0x0F),IRQW) // Save in buffer
527 Return(BUF0) // Return Buf0
528 } // End of _CRS method
529
530 Name(_PRS,
531 ResourceTemplate()
532 {IRQ(Level,ActiveLow,Shared){12,11,10,9,7,5,4,3}})
533
534 Method(_SRS,1,NotSerialized)
535 {
536 CreateWordField (ARG0, 0x01, IRQW) // IRQ low
537
538 FindSetRightBit(IRQW,Local0)// Set IRQ
539 If (LNotEqual(IRQW,Zero))
540 {
541 And(Local0, 0x7F,Local0)
542 Decrement(Local0)
543 }
544 Else
545 {
546 Or(Local0, 0x80,Local0)
547 }
548 Store(Local0, PIRH)
549 } // End of _SRS Method
550 }
551
552 #endif