drivers/usb/acpi: Don't add GPIOs to _CRS for Intel Bluetooth
[coreboot2.git] / src / soc / amd / common / acpi / pci_int.asl
blob306995d0ebc2f9cbc3cb7de57673b890c865f914
1 /* SPDX-License-Identifier: GPL-2.0-only */
3         /* PIC Possible Resource Values */
4         Name(IRQP, ResourceTemplate() {
5                 Interrupt(ResourceConsumer, Level, ActiveLow, Shared, , , PIC){
6                         1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15
7                 }
8         })
10         /* IO-APIC Possible Resource Values */
11         Name(IRQI, ResourceTemplate() {
12                 Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , APIC) {
13                         16, 17, 18, 19, 20, 21, 22, 23
14                 }
15         })
17 #define PCI_LINK(DEV_NAME, PIC_REG, APIC_REG, UID) \
18         Device(DEV_NAME) { \
19                 Name(_HID, EISAID("PNP0C0F")) \
20                 Name(_UID, UID) \
22                 Method(_STA, 0) { \
23                         If (PICM) { \
24                                 local0=APIC_REG \
25                         } Else { \
26                                 local0=PIC_REG \
27                         } \
29                         If (local0 != 0x1f) { \
30                                 printf("PCI: \\_SB.%s._STA: %o, Enabled", #DEV_NAME, local0) \
31                                 /* Present, Enabled, Functional */ \
32                                 Return(0x0b) \
33                         } else { \
34                                 printf("PCI: \\_SB.%s._STA: %o, Disabled", #DEV_NAME, local0) \
35                                 /* Present, Functional */ \
36                                 Return(0x09) \
37                         } \
38                 } \
40                 Method(_DIS ,0) { \
41                         If(PICM) { \
42                                 printf("PCI: \\_SB.%s._DIS APIC", #DEV_NAME) \
43                                 APIC_REG=0x1f \
44                         } Else { \
45                                 printf("PCI: \\_SB.%s._DIS PIC", #DEV_NAME) \
46                                 PIC_REG=0x1f \
47                         } \
48                 } \
50                 Method(_PRS ,0) { \
51                         If(PICM) { \
52                                 printf("PCI: \\_SB.%s._PRS => APIC", #DEV_NAME) \
53                                 Return(IRQI) \
54                         } Else { \
55                                 printf("PCI: \\_SB.%s._PRS => PIC", #DEV_NAME) \
56                                 Return(IRQP) \
57                         } \
58                 } \
60                 Method(_CRS ,0) { \
61                         local0=ResourceTemplate(){ \
62                                 Interrupt ( \
63                                         ResourceConsumer, \
64                                         Level, \
65                                         ActiveLow, \
66                                         Shared, , , NUMB) \
67                                 { 0 } \
68                         } \
69                         CreateDWordField(local0, NUMB._INT, IRQN) \
70                         If(PICM) { \
71                                 printf("PCI: \\_SB.%s._CRS APIC: %o", #DEV_NAME, APIC_REG) \
72                                 IRQN=APIC_REG \
73                         } Else { \
74                                 printf("PCI: \\_SB.%s._CRS PIC: %o", #DEV_NAME, PIC_REG) \
75                                 IRQN=PIC_REG \
76                         } \
77                         If (IRQN == 0x1f) { \
78                                 Return(ResourceTemplate(){}) \
79                         } Else { \
80                                 Return(local0) \
81                         } \
82                 } \
84                 Method(_SRS, 1) { \
85                         CreateWordField(ARG0, 0x5, IRQN) \
87                         If(PICM) { \
88                                 printf("PCI: \\_SB.%s._SRS APIC: %o", #DEV_NAME, IRQN) \
89                                 APIC_REG=IRQN \
90                         } Else { \
91                                 printf("PCI: \\_SB.%s._SRS PIC: %o", #DEV_NAME, IRQN) \
92                                 PIC_REG=IRQN \
93                         } \
94                 } \
95         }
97 PCI_LINK(INTA, PIRA, IORA, 0)
98 PCI_LINK(INTB, PIRB, IORB, 1)
99 PCI_LINK(INTC, PIRC, IORC, 2)
100 PCI_LINK(INTD, PIRD, IORD, 3)
101 PCI_LINK(INTE, PIRE, IORE, 4)
102 PCI_LINK(INTF, PIRF, IORF, 5)
103 PCI_LINK(INTG, PIRG, IORG, 6)
104 PCI_LINK(INTH, PIRH, IORH, 7)