Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Keith Hui | 97041de9 | 2017-11-14 18:48:34 -0500 | [diff] [blame] | 3 | Name(IRQB, ResourceTemplate(){ |
| 4 | IRQ(Level,ActiveLow,Shared){} |
| 5 | }) |
| 6 | |
| 7 | Name(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) \ |
| 13 | Device(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 Hui | 0cdc97c | 2020-05-05 20:42:59 -0400 | [diff] [blame^] | 48 | } |