blob: fe2c180a26d6c8597d4672f052bb9ddafd04b7ba [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Keith Hui97041de92017-11-14 18:48:34 -05003Name(IRQB, ResourceTemplate(){
4 IRQ(Level,ActiveLow,Shared){}
5})
6
7Name(IRQP, ResourceTemplate(){
8 IRQ(Level,ActiveLow,Shared){3, 4, 5, 6, 7, 10, 11, 12, 14, 15}
9})
10
11/* adapted from ma78gm/dsdt.asl */
12#define PCI_INTX_DEV(intx, pinx, uid) \
13Device(intx) { \
14 Name(_HID, EISAID("PNP0C0F")) \
15 Name(_UID, uid) \
16 \
17 Method(_STA, 0) { \
18 If (And(pinx, 0x80)) { \
19 Return(0x09) \
20 } \
21 Return(0x0B) \
22 } \
23 \
24 Method(_DIS ,0) { \
25 Store(0x80, pinx) \
26 } \
27 \
28 Method(_PRS ,0) { \
29 Return(IRQP) \
30 } \
31 \
32 Method(_CRS ,0) { \
33 CreateWordField(IRQB, 1, IRQN) \
34 ShiftLeft(1, And(pinx, 0x0f), IRQN) \
35 Return(IRQB) \
36 } \
37 \
38 Method(_SRS, 1) { \
39 CreateWordField(ARG0, 1, IRQM) \
40 \
41 /* Use lowest available IRQ */ \
42 FindSetRightBit(IRQM, Local0) \
43 if (Local0) { \
44 Decrement(Local0) \
45 } \
46 Store(Local0, pinx) \
47 } \
Keith Hui0cdc97c2020-05-05 20:42:59 -040048}