soc/intel/pantherlake: Remove soc_info.[hc] interface
[coreboot2.git] / src / soc / intel / skylake / acpi / irqlinks.asl
blob63d450c5f98aac3bd08a10927006b2d467ad92b3
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /*
4  * PIRQ routing control is in PCR ITSS region.
5  *
6  * Due to what appears to be an ACPI interpreter bug we do not use
7  * the PCRB() method here as it may not be defined yet because the method
8  * definition depends on the order of the include files in pch.asl.
9  *
10  * https://bugs.acpica.org/show_bug.cgi?id=1201
11  */
12 OperationRegion (ITSS, SystemMemory,
13                  PCR_ITSS_PIRQA_ROUT + CONFIG_PCR_BASE_ADDRESS + (PID_ITSS << PCR_PORTID_SHIFT),
14                 8)
15 Field (ITSS, ByteAcc, NoLock, Preserve)
17         PIRA, 8,        /* PIRQA Routing Control */
18         PIRB, 8,        /* PIRQB Routing Control */
19         PIRC, 8,        /* PIRQC Routing Control */
20         PIRD, 8,        /* PIRQD Routing Control */
21         PIRE, 8,        /* PIRQE Routing Control */
22         PIRF, 8,        /* PIRQF Routing Control */
23         PIRG, 8,        /* PIRQG Routing Control */
24         PIRH, 8,        /* PIRQH Routing Control */
27 Name (IREN, 0x80)       /* Interrupt Routing Enable */
28 Name (IREM, 0x0f)       /* Interrupt Routing Mask */
30 Device (LNKA)
32         Name (_HID, EISAID ("PNP0C0F"))
33         Name (_UID, 1)
35         Name (_PRS, ResourceTemplate ()
36         {
37                 IRQ (Level, ActiveLow, Shared)
38                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
39         })
41         Method (_CRS, 0, Serialized)
42         {
43                 Name (RTLA, ResourceTemplate ()
44                 {
45                         IRQ (Level, ActiveLow, Shared) {}
46                 })
47                 CreateWordField (RTLA, 1, IRQ0)
48                 IRQ0 = 0
50                 /* Set the bit from PIRQ Routing Register */
51                 IRQ0 = 1 << (^^PIRA & ^^IREM)
53                 Return (RTLA)
54         }
56         Method (_SRS, 1, Serialized)
57         {
58                 CreateWordField (Arg0, 1, IRQ0)
59                 FindSetRightBit (IRQ0, Local0)
60                 Local0--
61                 ^^PIRA = Local0
62         }
64         Method (_STA, 0, Serialized)
65         {
66                 If (^^PIRA & ^^IREN) {
67                         Return (0x9)
68                 } Else {
69                         Return (0xb)
70                 }
71         }
73         Method (_DIS, 0, Serialized)
74         {
75                 ^^PIRA |= ^^IREN
76         }
79 Device (LNKB)
81         Name (_HID, EISAID ("PNP0C0F"))
82         Name (_UID, 2)
84         Name (_PRS, ResourceTemplate ()
85         {
86                 IRQ (Level, ActiveLow, Shared)
87                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
88         })
90         Method (_CRS, 0, Serialized)
91         {
92                 Name (RTLA, ResourceTemplate ()
93                 {
94                         IRQ (Level, ActiveLow, Shared) {}
95                 })
96                 CreateWordField (RTLA, 1, IRQ0)
97                 IRQ0 = 0
99                 /* Set the bit from PIRQ Routing Register */
100                 IRQ0 = 1 << (^^PIRB & ^^IREM)
102                 Return (RTLA)
103         }
105         Method (_SRS, 1, Serialized)
106         {
107                 CreateWordField (Arg0, 1, IRQ0)
108                 FindSetRightBit (IRQ0, Local0)
109                 Local0--
110                 ^^PIRB = Local0
111         }
113         Method (_STA, 0, Serialized)
114         {
115                 If (^^PIRB & ^^IREN) {
116                         Return (0x9)
117                 } Else {
118                         Return (0xb)
119                 }
120         }
122         Method (_DIS, 0, Serialized)
123         {
124                 ^^PIRB |= ^^IREN
125         }
128 Device (LNKC)
130         Name (_HID, EISAID ("PNP0C0F"))
131         Name (_UID, 3)
133         Name (_PRS, ResourceTemplate ()
134         {
135                 IRQ (Level, ActiveLow, Shared)
136                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
137         })
139         Method (_CRS, 0, Serialized)
140         {
141                 Name (RTLA, ResourceTemplate ()
142                 {
143                         IRQ (Level, ActiveLow, Shared) {}
144                 })
145                 CreateWordField (RTLA, 1, IRQ0)
146                 IRQ0 = 0
148                 /* Set the bit from PIRQ Routing Register */
149                 IRQ0 = 1 << (^^PIRC & ^^IREM)
151                 Return (RTLA)
152         }
154         Method (_SRS, 1, Serialized)
155         {
156                 CreateWordField (Arg0, 1, IRQ0)
157                 FindSetRightBit (IRQ0, Local0)
158                 Local0--
159                 ^^PIRC = Local0
160         }
162         Method (_STA, 0, Serialized)
163         {
164                 If (^^PIRC & ^^IREN) {
165                         Return (0x9)
166                 } Else {
167                         Return (0xb)
168                 }
169         }
171         Method (_DIS, 0, Serialized)
172         {
173                 ^^PIRC |= ^^IREN
174         }
177 Device (LNKD)
179         Name (_HID, EISAID ("PNP0C0F"))
180         Name (_UID, 4)
182         Name (_PRS, ResourceTemplate ()
183         {
184                 IRQ (Level, ActiveLow, Shared)
185                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
186         })
188         Method (_CRS, 0, Serialized)
189         {
190                 Name (RTLA, ResourceTemplate ()
191                 {
192                         IRQ (Level, ActiveLow, Shared) {}
193                 })
194                 CreateWordField (RTLA, 1, IRQ0)
195                 IRQ0 = 0
197                 /* Set the bit from PIRQ Routing Register */
198                 IRQ0 = 1 << (^^PIRD & ^^IREM)
200                 Return (RTLA)
201         }
203         Method (_SRS, 1, Serialized)
204         {
205                 CreateWordField (Arg0, 1, IRQ0)
206                 FindSetRightBit (IRQ0, Local0)
207                 Local0--
208                 ^^PIRD = Local0
209         }
211         Method (_STA, 0, Serialized)
212         {
213                 If (^^PIRD & ^^IREN) {
214                         Return (0x9)
215                 } Else {
216                         Return (0xb)
217                 }
218         }
220         Method (_DIS, 0, Serialized)
221         {
222                 ^^PIRD |= ^^IREN
223         }
226 Device (LNKE)
228         Name (_HID, EISAID ("PNP0C0F"))
229         Name (_UID, 5)
231         Name (_PRS, ResourceTemplate ()
232         {
233                 IRQ (Level, ActiveLow, Shared)
234                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
235         })
237         Method (_CRS, 0, Serialized)
238         {
239                 Name (RTLA, ResourceTemplate ()
240                 {
241                         IRQ (Level, ActiveLow, Shared) {}
242                 })
243                 CreateWordField (RTLA, 1, IRQ0)
244                 IRQ0 = 0
246                 /* Set the bit from PIRQ Routing Register */
247                 IRQ0 = 1 << (^^PIRE & ^^IREM)
249                 Return (RTLA)
250         }
252         Method (_SRS, 1, Serialized)
253         {
254                 CreateWordField (Arg0, 1, IRQ0)
255                 FindSetRightBit (IRQ0, Local0)
256                 Local0--
257                 ^^PIRE = Local0
258         }
260         Method (_STA, 0, Serialized)
261         {
262                 If (^^PIRE & ^^IREN) {
263                         Return (0x9)
264                 } Else {
265                         Return (0xb)
266                 }
267         }
269         Method (_DIS, 0, Serialized)
270         {
271                 ^^PIRE |= ^^IREN
272         }
275 Device (LNKF)
277         Name (_HID, EISAID ("PNP0C0F"))
278         Name (_UID, 6)
280         Name (_PRS, ResourceTemplate ()
281         {
282                 IRQ (Level, ActiveLow, Shared)
283                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
284         })
286         Method (_CRS, 0, Serialized)
287         {
288                 Name (RTLA, ResourceTemplate ()
289                 {
290                         IRQ (Level, ActiveLow, Shared) {}
291                 })
292                 CreateWordField (RTLA, 1, IRQ0)
293                 IRQ0 = 0
295                 /* Set the bit from PIRQ Routing Register */
296                 IRQ0 = 1 << (^^PIRF & ^^IREM)
298                 Return (RTLA)
299         }
301         Method (_SRS, 1, Serialized)
302         {
303                 CreateWordField (Arg0, 1, IRQ0)
304                 FindSetRightBit (IRQ0, Local0)
305                 Local0--
306                 ^^PIRF = Local0
307         }
309         Method (_STA, 0, Serialized)
310         {
311                 If (^^PIRF & ^^IREN) {
312                         Return (0x9)
313                 } Else {
314                         Return (0xb)
315                 }
316         }
318         Method (_DIS, 0, Serialized)
319         {
320                 ^^PIRF |= ^^IREN
321         }
324 Device (LNKG)
326         Name (_HID, EISAID ("PNP0C0F"))
327         Name (_UID, 7)
329         Name (_PRS, ResourceTemplate ()
330         {
331                 IRQ (Level, ActiveLow, Shared)
332                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
333         })
335         Method (_CRS, 0, Serialized)
336         {
337                 Name (RTLA, ResourceTemplate ()
338                 {
339                         IRQ (Level, ActiveLow, Shared) {}
340                 })
341                 CreateWordField (RTLA, 1, IRQ0)
342                 IRQ0 = 0
344                 /* Set the bit from PIRQ Routing Register */
345                 IRQ0 = 1 <<  (^^PIRG & ^^IREM)
347                 Return (RTLA)
348         }
350         Method (_SRS, 1, Serialized)
351         {
352                 CreateWordField (Arg0, 1, IRQ0)
353                 FindSetRightBit (IRQ0, Local0)
354                 Local0--
355                 ^^PIRG = Local0
356         }
358         Method (_STA, 0, Serialized)
359         {
360                 If (^^PIRG & ^^IREN) {
361                         Return (0x9)
362                 } Else {
363                         Return (0xb)
364                 }
365         }
367         Method (_DIS, 0, Serialized)
368         {
369                 ^^PIRG |= ^^IREN
370         }
373 Device (LNKH)
375         Name (_HID, EISAID ("PNP0C0F"))
376         Name (_UID, 8)
378         Name (_PRS, ResourceTemplate ()
379         {
380                 IRQ (Level, ActiveLow, Shared)
381                         { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
382         })
384         Method (_CRS, 0, Serialized)
385         {
386                 Name (RTLA, ResourceTemplate ()
387                 {
388                         IRQ (Level, ActiveLow, Shared) {}
389                 })
390                 CreateWordField (RTLA, 1, IRQ0)
391                 IRQ0 = 0
393                 /* Set the bit from PIRQ Routing Register */
394                 IRQ0 = 1 << (^^PIRH & ^^IREM)
396                 Return (RTLA)
397         }
399         Method (_SRS, 1, Serialized)
400         {
401                 CreateWordField (Arg0, 1, IRQ0)
402                 FindSetRightBit (IRQ0, Local0)
403                 Local0--
404                 ^^PIRH = Local0
405         }
407         Method (_STA, 0, Serialized)
408         {
409                 If (^^PIRH & ^^IREN) {
410                         Return (0x9)
411                 } Else {
412                         Return (0xb)
413                 }
414         }
416         Method (_DIS, 0, Serialized)
417         {
418                 ^^PIRH |= ^^IREN
419         }