Debian Codegraph @

src/soc/intel/skylake/acpi/irqlinks.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
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)
16 {
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 */
25 }
26
27 Name (IREN, 0x80) /* Interrupt Routing Enable */
28 Name (IREM, 0x0f) /* Interrupt Routing Mask */
29
30 Device (LNKA)
31 {
32 Name (_HID, EISAID ("PNP0C0F"))
33 Name (_UID, 1)
34
35 Name (_PRS, ResourceTemplate ()
36 {
37 IRQ (Level, ActiveLow, Shared)
38 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
39 })
40
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
49
50 /* Set the bit from PIRQ Routing Register */
51 IRQ0 = 1 << (^^PIRA & ^^IREM)
52
53 Return (RTLA)
54 }
55
56 Method (_SRS, 1, Serialized)
57 {
58 CreateWordField (Arg0, 1, IRQ0)
59 FindSetRightBit (IRQ0, Local0)
60 Local0--
61 ^^PIRA = Local0
62 }
63
64 Method (_STA, 0, Serialized)
65 {
66 If (^^PIRA & ^^IREN) {
67 Return (0x9)
68 } Else {
69 Return (0xb)
70 }
71 }
72
73 Method (_DIS, 0, Serialized)
74 {
75 ^^PIRA |= ^^IREN
76 }
77 }
78
79 Device (LNKB)
80 {
81 Name (_HID, EISAID ("PNP0C0F"))
82 Name (_UID, 2)
83
84 Name (_PRS, ResourceTemplate ()
85 {
86 IRQ (Level, ActiveLow, Shared)
87 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
88 })
89
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
98
99 /* Set the bit from PIRQ Routing Register */
100 IRQ0 = 1 << (^^PIRB & ^^IREM)
101
102 Return (RTLA)
103 }
104
105 Method (_SRS, 1, Serialized)
106 {
107 CreateWordField (Arg0, 1, IRQ0)
108 FindSetRightBit (IRQ0, Local0)
109 Local0--
110 ^^PIRB = Local0
111 }
112
113 Method (_STA, 0, Serialized)
114 {
115 If (^^PIRB & ^^IREN) {
116 Return (0x9)
117 } Else {
118 Return (0xb)
119 }
120 }
121
122 Method (_DIS, 0, Serialized)
123 {
124 ^^PIRB |= ^^IREN
125 }
126 }
127
128 Device (LNKC)
129 {
130 Name (_HID, EISAID ("PNP0C0F"))
131 Name (_UID, 3)
132
133 Name (_PRS, ResourceTemplate ()
134 {
135 IRQ (Level, ActiveLow, Shared)
136 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
137 })
138
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
147
148 /* Set the bit from PIRQ Routing Register */
149 IRQ0 = 1 << (^^PIRC & ^^IREM)
150
151 Return (RTLA)
152 }
153
154 Method (_SRS, 1, Serialized)
155 {
156 CreateWordField (Arg0, 1, IRQ0)
157 FindSetRightBit (IRQ0, Local0)
158 Local0--
159 ^^PIRC = Local0
160 }
161
162 Method (_STA, 0, Serialized)
163 {
164 If (^^PIRC & ^^IREN) {
165 Return (0x9)
166 } Else {
167 Return (0xb)
168 }
169 }
170
171 Method (_DIS, 0, Serialized)
172 {
173 ^^PIRC |= ^^IREN
174 }
175 }
176
177 Device (LNKD)
178 {
179 Name (_HID, EISAID ("PNP0C0F"))
180 Name (_UID, 4)
181
182 Name (_PRS, ResourceTemplate ()
183 {
184 IRQ (Level, ActiveLow, Shared)
185 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
186 })
187
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
196
197 /* Set the bit from PIRQ Routing Register */
198 IRQ0 = 1 << (^^PIRD & ^^IREM)
199
200 Return (RTLA)
201 }
202
203 Method (_SRS, 1, Serialized)
204 {
205 CreateWordField (Arg0, 1, IRQ0)
206 FindSetRightBit (IRQ0, Local0)
207 Local0--
208 ^^PIRD = Local0
209 }
210
211 Method (_STA, 0, Serialized)
212 {
213 If (^^PIRD & ^^IREN) {
214 Return (0x9)
215 } Else {
216 Return (0xb)
217 }
218 }
219
220 Method (_DIS, 0, Serialized)
221 {
222 ^^PIRD |= ^^IREN
223 }
224 }
225
226 Device (LNKE)
227 {
228 Name (_HID, EISAID ("PNP0C0F"))
229 Name (_UID, 5)
230
231 Name (_PRS, ResourceTemplate ()
232 {
233 IRQ (Level, ActiveLow, Shared)
234 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
235 })
236
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
245
246 /* Set the bit from PIRQ Routing Register */
247 IRQ0 = 1 << (^^PIRE & ^^IREM)
248
249 Return (RTLA)
250 }
251
252 Method (_SRS, 1, Serialized)
253 {
254 CreateWordField (Arg0, 1, IRQ0)
255 FindSetRightBit (IRQ0, Local0)
256 Local0--
257 ^^PIRE = Local0
258 }
259
260 Method (_STA, 0, Serialized)
261 {
262 If (^^PIRE & ^^IREN) {
263 Return (0x9)
264 } Else {
265 Return (0xb)
266 }
267 }
268
269 Method (_DIS, 0, Serialized)
270 {
271 ^^PIRE |= ^^IREN
272 }
273 }
274
275 Device (LNKF)
276 {
277 Name (_HID, EISAID ("PNP0C0F"))
278 Name (_UID, 6)
279
280 Name (_PRS, ResourceTemplate ()
281 {
282 IRQ (Level, ActiveLow, Shared)
283 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
284 })
285
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
294
295 /* Set the bit from PIRQ Routing Register */
296 IRQ0 = 1 << (^^PIRF & ^^IREM)
297
298 Return (RTLA)
299 }
300
301 Method (_SRS, 1, Serialized)
302 {
303 CreateWordField (Arg0, 1, IRQ0)
304 FindSetRightBit (IRQ0, Local0)
305 Local0--
306 ^^PIRF = Local0
307 }
308
309 Method (_STA, 0, Serialized)
310 {
311 If (^^PIRF & ^^IREN) {
312 Return (0x9)
313 } Else {
314 Return (0xb)
315 }
316 }
317
318 Method (_DIS, 0, Serialized)
319 {
320 ^^PIRF |= ^^IREN
321 }
322 }
323
324 Device (LNKG)
325 {
326 Name (_HID, EISAID ("PNP0C0F"))
327 Name (_UID, 7)
328
329 Name (_PRS, ResourceTemplate ()
330 {
331 IRQ (Level, ActiveLow, Shared)
332 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
333 })
334
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
343
344 /* Set the bit from PIRQ Routing Register */
345 IRQ0 = 1 << (^^PIRG & ^^IREM)
346
347 Return (RTLA)
348 }
349
350 Method (_SRS, 1, Serialized)
351 {
352 CreateWordField (Arg0, 1, IRQ0)
353 FindSetRightBit (IRQ0, Local0)
354 Local0--
355 ^^PIRG = Local0
356 }
357
358 Method (_STA, 0, Serialized)
359 {
360 If (^^PIRG & ^^IREN) {
361 Return (0x9)
362 } Else {
363 Return (0xb)
364 }
365 }
366
367 Method (_DIS, 0, Serialized)
368 {
369 ^^PIRG |= ^^IREN
370 }
371 }
372
373 Device (LNKH)
374 {
375 Name (_HID, EISAID ("PNP0C0F"))
376 Name (_UID, 8)
377
378 Name (_PRS, ResourceTemplate ()
379 {
380 IRQ (Level, ActiveLow, Shared)
381 { 3, 4, 5, 6, 10, 11, 12, 14, 15 }
382 })
383
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
392
393 /* Set the bit from PIRQ Routing Register */
394 IRQ0 = 1 << (^^PIRH & ^^IREM)
395
396 Return (RTLA)
397 }
398
399 Method (_SRS, 1, Serialized)
400 {
401 CreateWordField (Arg0, 1, IRQ0)
402 FindSetRightBit (IRQ0, Local0)
403 Local0--
404 ^^PIRH = Local0
405 }
406
407 Method (_STA, 0, Serialized)
408 {
409 If (^^PIRH & ^^IREN) {
410 Return (0x9)
411 } Else {
412 Return (0xb)
413 }
414 }
415
416 Method (_DIS, 0, Serialized)
417 {
418 ^^PIRH |= ^^IREN
419 }
420 }