x86: baytrail: Add platform ASL files
[platform/kernel/u-boot.git] / arch / x86 / include / asm / arch-baytrail / acpi / irqlinks.asl
1 /*
2  * Copyright (C) 2007-2009 coresystems GmbH
3  * Copyright (C) 2016 Bin Meng <bmeng.cn@gmail.com>
4  *
5  * Modified from coreboot src/soc/intel/baytrail/acpi/irqlinks.asl
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9
10 Scope (\)
11 {
12         /* Intel Legacy Block */
13         OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
14         Field(ILBS, AnyAcc, NoLock, Preserve) {
15                 Offset (0x8),
16                 PRTA, 8,
17                 PRTB, 8,
18                 PRTC, 8,
19                 PRTD, 8,
20                 PRTE, 8,
21                 PRTF, 8,
22                 PRTG, 8,
23                 PRTH, 8,
24         }
25 }
26
27 Device (LNKA)
28 {
29         Name(_HID, EISAID("PNP0C0F"))
30         Name(_UID, 1)
31
32         /* Disable method */
33         Method(_DIS, 0, Serialized)
34         {
35                 Store(0x80, PRTA)
36         }
37
38         /* Possible Resource Settings for this Link */
39         Name(_PRS, ResourceTemplate()
40         {
41                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
42         })
43
44         /* Current Resource Settings for this link */
45         Method(_CRS, 0, Serialized)
46         {
47                 Name(RTLA, ResourceTemplate()
48                 {
49                         IRQ(Level, ActiveLow, Shared) {}
50                 })
51                 CreateWordField(RTLA, 1, IRQ0)
52
53                 /* Clear the WordField */
54                 Store(Zero, IRQ0)
55
56                 /* Set the bit from PRTA */
57                 ShiftLeft(1, And(PRTA, 0x0f), IRQ0)
58
59                 Return (RTLA)
60         }
61
62         /* Set Resource Setting for this IRQ link */
63         Method(_SRS, 1, Serialized)
64         {
65                 CreateWordField(Arg0, 1, IRQ0)
66
67                 /* Which bit is set? */
68                 FindSetRightBit(IRQ0, Local0)
69
70                 Decrement(Local0)
71                 Store(Local0, PRTA)
72         }
73
74         /* Status */
75         Method(_STA, 0, Serialized)
76         {
77                 If (And(PRTA, 0x80)) {
78                         Return (STA_DISABLED)
79                 } Else {
80                         Return (STA_INVISIBLE)
81                 }
82         }
83 }
84
85 Device (LNKB)
86 {
87         Name(_HID, EISAID("PNP0C0F"))
88         Name(_UID, 2)
89
90         /* Disable method */
91         Method(_DIS, 0, Serialized)
92         {
93                 Store(0x80, PRTB)
94         }
95
96         /* Possible Resource Settings for this Link */
97         Name(_PRS, ResourceTemplate()
98         {
99                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
100         })
101
102         /* Current Resource Settings for this link */
103         Method(_CRS, 0, Serialized)
104         {
105                 Name(RTLB, ResourceTemplate()
106                 {
107                         IRQ(Level, ActiveLow, Shared) {}
108                 })
109                 CreateWordField(RTLB, 1, IRQ0)
110
111                 /* Clear the WordField */
112                 Store(Zero, IRQ0)
113
114                 /* Set the bit from PRTB */
115                 ShiftLeft(1, And(PRTB, 0x0f), IRQ0)
116
117                 Return (RTLB)
118         }
119
120         /* Set Resource Setting for this IRQ link */
121         Method(_SRS, 1, Serialized)
122         {
123                 CreateWordField(Arg0, 1, IRQ0)
124
125                 /* Which bit is set? */
126                 FindSetRightBit(IRQ0, Local0)
127
128                 Decrement(Local0)
129                 Store(Local0, PRTB)
130         }
131
132         /* Status */
133         Method(_STA, 0, Serialized)
134         {
135                 If (And(PRTB, 0x80)) {
136                         Return (STA_DISABLED)
137                 } Else {
138                         Return (STA_INVISIBLE)
139                 }
140         }
141 }
142
143 Device (LNKC)
144 {
145         Name(_HID, EISAID("PNP0C0F"))
146         Name(_UID, 3)
147
148         /* Disable method */
149         Method(_DIS, 0, Serialized)
150         {
151                 Store(0x80, PRTC)
152         }
153
154         /* Possible Resource Settings for this Link */
155         Name(_PRS, ResourceTemplate()
156         {
157                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
158         })
159
160         /* Current Resource Settings for this link */
161         Method(_CRS, 0, Serialized)
162         {
163                 Name(RTLC, ResourceTemplate()
164                 {
165                         IRQ(Level, ActiveLow, Shared) {}
166                 })
167                 CreateWordField(RTLC, 1, IRQ0)
168
169                 /* Clear the WordField */
170                 Store(Zero, IRQ0)
171
172                 /* Set the bit from PRTC */
173                 ShiftLeft(1, And(PRTC, 0x0f), IRQ0)
174
175                 Return (RTLC)
176         }
177
178         /* Set Resource Setting for this IRQ link */
179         Method(_SRS, 1, Serialized)
180         {
181                 CreateWordField(Arg0, 1, IRQ0)
182
183                 /* Which bit is set? */
184                 FindSetRightBit(IRQ0, Local0)
185
186                 Decrement(Local0)
187                 Store(Local0, PRTC)
188         }
189
190         /* Status */
191         Method(_STA, 0, Serialized)
192         {
193                 If (And(PRTC, 0x80)) {
194                         Return (STA_DISABLED)
195                 } Else {
196                         Return (STA_INVISIBLE)
197                 }
198         }
199 }
200
201 Device (LNKD)
202 {
203         Name(_HID, EISAID("PNP0C0F"))
204         Name(_UID, 4)
205
206         /* Disable method */
207         Method(_DIS, 0, Serialized)
208         {
209                 Store(0x80, PRTD)
210         }
211
212         /* Possible Resource Settings for this Link */
213         Name(_PRS, ResourceTemplate()
214         {
215                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
216         })
217
218         /* Current Resource Settings for this link */
219         Method(_CRS, 0, Serialized)
220         {
221                 Name(RTLD, ResourceTemplate()
222                 {
223                         IRQ(Level, ActiveLow, Shared) {}
224                 })
225                 CreateWordField(RTLD, 1, IRQ0)
226
227                 /* Clear the WordField */
228                 Store(Zero, IRQ0)
229
230                 /* Set the bit from PRTD */
231                 ShiftLeft(1, And(PRTD, 0x0f), IRQ0)
232
233                 Return (RTLD)
234         }
235
236         /* Set Resource Setting for this IRQ link */
237         Method(_SRS, 1, Serialized)
238         {
239                 CreateWordField(Arg0, 1, IRQ0)
240
241                 /* Which bit is set? */
242                 FindSetRightBit(IRQ0, Local0)
243
244                 Decrement(Local0)
245                 Store(Local0, PRTD)
246         }
247
248         /* Status */
249         Method(_STA, 0, Serialized)
250         {
251                 If (And(PRTD, 0x80)) {
252                         Return (STA_DISABLED)
253                 } Else {
254                         Return (STA_INVISIBLE)
255                 }
256         }
257 }
258
259 Device (LNKE)
260 {
261         Name(_HID, EISAID("PNP0C0F"))
262         Name(_UID, 5)
263
264         /* Disable method */
265         Method(_DIS, 0, Serialized)
266         {
267                 Store(0x80, PRTE)
268         }
269
270         /* Possible Resource Settings for this Link */
271         Name(_PRS, ResourceTemplate()
272         {
273                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
274         })
275
276         /* Current Resource Settings for this link */
277         Method(_CRS, 0, Serialized)
278         {
279                 Name(RTLE, ResourceTemplate()
280                 {
281                         IRQ(Level, ActiveLow, Shared) {}
282                 })
283                 CreateWordField(RTLE, 1, IRQ0)
284
285                 /* Clear the WordField */
286                 Store(Zero, IRQ0)
287
288                 /* Set the bit from PRTE */
289                 ShiftLeft(1, And(PRTE, 0x0f), IRQ0)
290
291                 Return (RTLE)
292         }
293
294         /* Set Resource Setting for this IRQ link */
295         Method(_SRS, 1, Serialized)
296         {
297                 CreateWordField(Arg0, 1, IRQ0)
298
299                 /* Which bit is set? */
300                 FindSetRightBit(IRQ0, Local0)
301
302                 Decrement(Local0)
303                 Store(Local0, PRTE)
304         }
305
306         /* Status */
307         Method(_STA, 0, Serialized)
308         {
309                 If (And(PRTE, 0x80)) {
310                         Return (STA_DISABLED)
311                 } Else {
312                         Return (STA_INVISIBLE)
313                 }
314         }
315 }
316
317 Device (LNKF)
318 {
319         Name(_HID, EISAID("PNP0C0F"))
320         Name(_UID, 6)
321
322         /* Disable method */
323         Method(_DIS, 0, Serialized)
324         {
325                 Store(0x80, PRTF)
326         }
327
328         /* Possible Resource Settings for this Link */
329         Name(_PRS, ResourceTemplate()
330         {
331                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
332         })
333
334         /* Current Resource Settings for this link */
335         Method(_CRS, 0, Serialized)
336         {
337                 Name(RTLF, ResourceTemplate()
338                 {
339                         IRQ(Level, ActiveLow, Shared) {}
340                 })
341                 CreateWordField(RTLF, 1, IRQ0)
342
343                 /* Clear the WordField */
344                 Store(Zero, IRQ0)
345
346                 /* Set the bit from PRTF */
347                 ShiftLeft(1, And(PRTF, 0x0f), IRQ0)
348
349                 Return (RTLF)
350         }
351
352         /* Set Resource Setting for this IRQ link */
353         Method(_SRS, 1, Serialized)
354         {
355                 CreateWordField(Arg0, 1, IRQ0)
356
357                 /* Which bit is set? */
358                 FindSetRightBit(IRQ0, Local0)
359
360                 Decrement(Local0)
361                 Store(Local0, PRTF)
362         }
363
364         /* Status */
365         Method(_STA, 0, Serialized)
366         {
367                 If (And(PRTF, 0x80)) {
368                         Return (STA_DISABLED)
369                 } Else {
370                         Return (STA_INVISIBLE)
371                 }
372         }
373 }
374
375 Device (LNKG)
376 {
377         Name(_HID, EISAID("PNP0C0F"))
378         Name(_UID, 7)
379
380         /* Disable method */
381         Method(_DIS, 0, Serialized)
382         {
383                 Store(0x80, PRTG)
384         }
385
386         /* Possible Resource Settings for this Link */
387         Name(_PRS, ResourceTemplate()
388         {
389                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
390         })
391
392         /* Current Resource Settings for this link */
393         Method(_CRS, 0, Serialized)
394         {
395                 Name(RTLG, ResourceTemplate()
396                 {
397                         IRQ(Level, ActiveLow, Shared) {}
398                 })
399                 CreateWordField(RTLG, 1, IRQ0)
400
401                 /* Clear the WordField */
402                 Store(Zero, IRQ0)
403
404                 /* Set the bit from PRTG */
405                 ShiftLeft(1, And(PRTG, 0x0f), IRQ0)
406
407                 Return (RTLG)
408         }
409
410         /* Set Resource Setting for this IRQ link */
411         Method(_SRS, 1, Serialized)
412         {
413                 CreateWordField(Arg0, 1, IRQ0)
414
415                 /* Which bit is set? */
416                 FindSetRightBit(IRQ0, Local0)
417
418                 Decrement(Local0)
419                 Store(Local0, PRTG)
420         }
421
422         /* Status */
423         Method(_STA, 0, Serialized)
424         {
425                 If (And(PRTG, 0x80)) {
426                         Return (STA_DISABLED)
427                 } Else {
428                         Return (STA_INVISIBLE)
429                 }
430         }
431 }
432
433 Device (LNKH)
434 {
435         Name(_HID, EISAID("PNP0C0F"))
436         Name(_UID, 8)
437
438         /* Disable method */
439         Method(_DIS, 0, Serialized)
440         {
441                 Store(0x80, PRTH)
442         }
443
444         /* Possible Resource Settings for this Link */
445         Name(_PRS, ResourceTemplate()
446         {
447                 IRQ(Level, ActiveLow, Shared) { 5, 6, 7, 10, 11, 12, 14, 15 }
448         })
449
450         /* Current Resource Settings for this link */
451         Method(_CRS, 0, Serialized)
452         {
453                 Name(RTLH, ResourceTemplate()
454                 {
455                         IRQ(Level, ActiveLow, Shared) {}
456                 })
457                 CreateWordField(RTLH, 1, IRQ0)
458
459                 /* Clear the WordField */
460                 Store(Zero, IRQ0)
461
462                 /* Set the bit from PRTH */
463                 ShiftLeft(1, And(PRTH, 0x0f), IRQ0)
464
465                 Return (RTLH)
466         }
467
468         /* Set Resource Setting for this IRQ link */
469         Method(_SRS, 1, Serialized)
470         {
471                 CreateWordField(Arg0, 1, IRQ0)
472
473                 /* Which bit is set? */
474                 FindSetRightBit(IRQ0, Local0)
475
476                 Decrement(Local0)
477                 Store(Local0, PRTH)
478         }
479
480         /* Status */
481         Method(_STA, 0, Serialized)
482         {
483                 If (And(PRTH, 0x80)) {
484                         Return (STA_DISABLED)
485                 } Else {
486                         Return (STA_INVISIBLE)
487                 }
488         }
489 }