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