rename Iwill to iwill to keep naming scheme consistent
[coreboot.git] / src / mainboard / iwill / dk8_htx / dx / amd8111_pic.asl
1 /*
2  * Copyright 2005 AMD
3  */
4 //AMD8111 pic LNKA B C D
5
6             Device (LNKA)
7             {
8                 Name (_HID, EisaId ("PNP0C0F"))
9                 Name (_UID, 0x01)
10                 Method (_STA, 0, NotSerialized)
11                 {
12                     And (\_SB.PCI0.SBC3.PIBA, 0x0F, Local0)
13                     If (LEqual (Local0, 0x00)) { Return (0x09) } //Disabled
14                     Else { Return (0x0B) } //Enabled
15                 }
16
17                 Method (_PRS, 0, NotSerialized)
18                 {
19                     Name (BUFA, ResourceTemplate ()
20                     {
21                         IRQ (Level, ActiveLow, Shared) {3,5,10,11}
22                     })
23                     Return (BUFA)
24                 }
25
26                 Method (_DIS, 0, NotSerialized)
27                 {
28                     Store (0x01, Local3)
29                     And (\_SB.PCI0.SBC3.PIBA, 0x0F, Local1)
30                     Store (Local1, Local2)
31                     If (LGreater (Local1, 0x07))
32                     {
33                         Subtract (Local1, 0x08, Local1)
34                     }
35
36                     ShiftLeft (Local3, Local1, Local3)
37                     Not (Local3, Local3)
38                     And (\_SB.PCI0.SBC3.PIBA, 0xF0, \_SB.PCI0.SBC3.PIBA)
39                 }
40
41                 Method (_CRS, 0, NotSerialized)
42                 {
43                     Name (BUFA, ResourceTemplate ()
44                     {
45                         IRQ (Level, ActiveLow, Shared) {}
46                     })
47                     CreateByteField (BUFA, 0x01, IRA1)
48                     CreateByteField (BUFA, 0x02, IRA2)
49                     Store (0x00, Local3)
50                     Store (0x00, Local4)
51                     And (\_SB.PCI0.SBC3.PIBA, 0x0F, Local1)
52                     If (LNot (LEqual (Local1, 0x00)))
53                     {  // Routing enable
54                         If (LGreater (Local1, 0x07))
55                         {
56                             Subtract (Local1, 0x08, Local2)
57                             ShiftLeft (One, Local2, Local4)
58                         }
59                         Else
60                         {
61                             If (LGreater (Local1, 0x00))
62                             {
63                                 ShiftLeft (One, Local1, Local3)
64                             }
65                         }
66
67                         Store (Local3, IRA1)
68                         Store (Local4, IRA2)
69                     }
70
71                     Return (BUFA)
72                 }
73
74                 Method (_SRS, 1, NotSerialized)
75                 {
76                     CreateByteField (Arg0, 0x01, IRA1)
77                     CreateByteField (Arg0, 0x02, IRA2)
78                     ShiftLeft (IRA2, 0x08, Local0)
79                     Or (Local0, IRA1, Local0)
80                     Store (0x00, Local1)
81                     ShiftRight (Local0, 0x01, Local0)
82                     While (LGreater (Local0, 0x00))
83                     {
84                         Increment (Local1)
85                         ShiftRight (Local0, 0x01, Local0)
86                     }
87
88                     And (\_SB.PCI0.SBC3.PIBA, 0xF0, \_SB.PCI0.SBC3.PIBA)
89                     Or (\_SB.PCI0.SBC3.PIBA, Local1, \_SB.PCI0.SBC3.PIBA)
90                 }
91             }
92
93             Device (LNKB)
94             {
95                 Name (_HID, EisaId ("PNP0C0F"))
96                 Name (_UID, 0x02)
97                 Method (_STA, 0, NotSerialized)
98                 {
99                     And (\_SB.PCI0.SBC3.PIBA, 0xF0, Local0)
100                     If (LEqual (Local0, 0x00)) { Return (0x09) }
101                     Else { Return (0x0B) }
102                 }
103
104                 Method (_PRS, 0, NotSerialized)
105                 {
106                     Name (BUFB, ResourceTemplate ()
107                     {
108                         IRQ (Level, ActiveLow, Shared) {3,5,10,11}
109                     })
110                     Return (BUFB)
111                 }
112
113                 Method (_DIS, 0, NotSerialized)
114                 {
115                     Store (0x01, Local3)
116                     And (\_SB.PCI0.SBC3.PIBA, 0xF0, Local1)
117                     ShiftRight (Local1, 0x04, Local1)
118                     Store (Local1, Local2)
119                     If (LGreater (Local1, 0x07))
120                     {
121                         Subtract (Local1, 0x08, Local1)
122                     }
123
124                     ShiftLeft (Local3, Local1, Local3)
125                     Not (Local3, Local3)
126                     And (\_SB.PCI0.SBC3.PIBA, 0x0F, \_SB.PCI0.SBC3.PIBA)
127                 }
128
129                 Method (_CRS, 0, NotSerialized)
130                 {
131                     Name (BUFB, ResourceTemplate ()
132                     {
133                         IRQ (Level, ActiveLow, Shared) {}
134                     })
135                     CreateByteField (BUFB, 0x01, IRB1)
136                     CreateByteField (BUFB, 0x02, IRB2)
137                     Store (0x00, Local3)
138                     Store (0x00, Local4)
139                     And (\_SB.PCI0.SBC3.PIBA, 0xF0, Local1)
140                     ShiftRight (Local1, 0x04, Local1)
141                     If (LNot (LEqual (Local1, 0x00)))
142                     {
143                         If (LGreater (Local1, 0x07))
144                         {
145                             Subtract (Local1, 0x08, Local2)
146                             ShiftLeft (One, Local2, Local4)
147                         }
148                         Else
149                         {
150                             If (LGreater (Local1, 0x00))
151                             {
152                                 ShiftLeft (One, Local1, Local3)
153                             }
154                         }
155
156                         Store (Local3, IRB1)
157                         Store (Local4, IRB2)
158                     }
159
160                     Return (BUFB)
161                 }
162
163                 Method (_SRS, 1, NotSerialized)
164                 {
165                     CreateByteField (Arg0, 0x01, IRB1)
166                     CreateByteField (Arg0, 0x02, IRB2)
167                     ShiftLeft (IRB2, 0x08, Local0)
168                     Or (Local0, IRB1, Local0)
169                     Store (0x00, Local1)
170                     ShiftRight (Local0, 0x01, Local0)
171                     While (LGreater (Local0, 0x00))
172                     {
173                         Increment (Local1)
174                         ShiftRight (Local0, 0x01, Local0)
175                     }
176
177                     And (\_SB.PCI0.SBC3.PIBA, 0x0F, \_SB.PCI0.SBC3.PIBA)
178                     ShiftLeft (Local1, 0x04, Local1)
179                     Or (\_SB.PCI0.SBC3.PIBA, Local1, \_SB.PCI0.SBC3.PIBA)
180                 }
181             }
182
183             Device (LNKC)
184             {
185                 Name (_HID, EisaId ("PNP0C0F"))
186                 Name (_UID, 0x03)
187                 Method (_STA, 0, NotSerialized)
188                 {
189                     And (\_SB.PCI0.SBC3.PIDC, 0x0F, Local0)
190                     If (LEqual (Local0, 0x00)) { Return (0x09) }
191                     Else { Return (0x0B) }
192                 }
193
194                 Method (_PRS, 0, NotSerialized)
195                 {
196                     Name (BUFA, ResourceTemplate ()
197                     {
198                         IRQ (Level, ActiveLow, Shared) {3,5,10,11}
199                     })
200                     Return (BUFA)
201                 }
202
203                 Method (_DIS, 0, NotSerialized)
204                 {
205                     Store (0x01, Local3)
206                     And (\_SB.PCI0.SBC3.PIDC, 0x0F, Local1)
207                     Store (Local1, Local2)
208                     If (LGreater (Local1, 0x07))
209                     {
210                         Subtract (Local1, 0x08, Local1)
211                     }
212
213                     ShiftLeft (Local3, Local1, Local3)
214                     Not (Local3, Local3)
215                     And (\_SB.PCI0.SBC3.PIDC, 0xF0, \_SB.PCI0.SBC3.PIDC)
216                 }
217
218                 Method (_CRS, 0, NotSerialized)
219                 {
220                     Name (BUFA, ResourceTemplate ()
221                     {
222                         IRQ (Level, ActiveLow, Shared) {}
223                     })
224                     CreateByteField (BUFA, 0x01, IRA1)
225                     CreateByteField (BUFA, 0x02, IRA2)
226                     Store (0x00, Local3)
227                     Store (0x00, Local4)
228                     And (\_SB.PCI0.SBC3.PIDC, 0x0F, Local1)
229                     If (LNot (LEqual (Local1, 0x00)))
230                     {
231                         If (LGreater (Local1, 0x07))
232                         {
233                             Subtract (Local1, 0x08, Local2)
234                             ShiftLeft (One, Local2, Local4)
235                         }
236                         Else
237                         {
238                             If (LGreater (Local1, 0x00))
239                             {
240                                 ShiftLeft (One, Local1, Local3)
241                             }
242                         }
243
244                         Store (Local3, IRA1)
245                         Store (Local4, IRA2)
246                     }
247
248                     Return (BUFA)
249                 }
250
251                 Method (_SRS, 1, NotSerialized)
252                 {
253                     CreateByteField (Arg0, 0x01, IRA1)
254                     CreateByteField (Arg0, 0x02, IRA2)
255                     ShiftLeft (IRA2, 0x08, Local0)
256                     Or (Local0, IRA1, Local0)
257                     Store (0x00, Local1)
258                     ShiftRight (Local0, 0x01, Local0)
259                     While (LGreater (Local0, 0x00))
260                     {
261                         Increment (Local1)
262                         ShiftRight (Local0, 0x01, Local0)
263                     }
264
265                     And (\_SB.PCI0.SBC3.PIDC, 0xF0, \_SB.PCI0.SBC3.PIDC)
266                     Or (\_SB.PCI0.SBC3.PIDC, Local1, \_SB.PCI0.SBC3.PIDC)
267                 }
268             }
269
270             Device (LNKD)
271             {
272                 Name (_HID, EisaId ("PNP0C0F"))
273                 Name (_UID, 0x04)
274                 Method (_STA, 0, NotSerialized)
275                 {
276                     And (\_SB.PCI0.SBC3.PIDC, 0xF0, Local0)
277                     If (LEqual (Local0, 0x00)) { Return (0x09) }
278                     Else { Return (0x0B) }
279                 }
280
281                 Method (_PRS, 0, NotSerialized)
282                 {
283                     Name (BUFB, ResourceTemplate ()
284                     {
285                         IRQ (Level, ActiveLow, Shared) {3,5,10,11}
286                     })
287                     Return (BUFB)
288                 }
289
290                 Method (_DIS, 0, NotSerialized)
291                 {
292                     Store (0x01, Local3)
293                     And (\_SB.PCI0.SBC3.PIDC, 0xF0, Local1)
294                     ShiftRight (Local1, 0x04, Local1)
295                     Store (Local1, Local2)
296                     If (LGreater (Local1, 0x07))
297                     {
298                         Subtract (Local1, 0x08, Local1)
299                     }
300
301                     ShiftLeft (Local3, Local1, Local3)
302                     Not (Local3, Local3)
303                     And (\_SB.PCI0.SBC3.PIDC, 0x0F, \_SB.PCI0.SBC3.PIDC)
304                 }
305
306                 Method (_CRS, 0, NotSerialized)
307                 {
308                     Name (BUFB, ResourceTemplate ()
309                     {
310                         IRQ (Level, ActiveLow, Shared) {}
311                     })
312                     CreateByteField (BUFB, 0x01, IRB1)
313                     CreateByteField (BUFB, 0x02, IRB2)
314                     Store (0x00, Local3)
315                     Store (0x00, Local4)
316                     And (\_SB.PCI0.SBC3.PIDC, 0xF0, Local1)
317                     ShiftRight (Local1, 0x04, Local1)
318                     If (LNot (LEqual (Local1, 0x00)))
319                     {
320                         If (LGreater (Local1, 0x07))
321                         {
322                             Subtract (Local1, 0x08, Local2)
323                             ShiftLeft (One, Local2, Local4)
324                         }
325                         Else
326                         {
327                             If (LGreater (Local1, 0x00))
328                             {
329                                 ShiftLeft (One, Local1, Local3)
330                             }
331                         }
332
333                         Store (Local3, IRB1)
334                         Store (Local4, IRB2)
335                     }
336
337                     Return (BUFB)
338                 }
339
340                 Method (_SRS, 1, NotSerialized)
341                 {
342                     CreateByteField (Arg0, 0x01, IRB1)
343                     CreateByteField (Arg0, 0x02, IRB2)
344                     ShiftLeft (IRB2, 0x08, Local0)
345                     Or (Local0, IRB1, Local0)
346                     Store (0x00, Local1)
347                     ShiftRight (Local0, 0x01, Local0)
348                     While (LGreater (Local0, 0x00))
349                     {
350                         Increment (Local1)
351                         ShiftRight (Local0, 0x01, Local0)
352                     }
353
354                     And (\_SB.PCI0.SBC3.PIDC, 0x0F, \_SB.PCI0.SBC3.PIDC)
355                     ShiftLeft (Local1, 0x04, Local1)
356                     Or (\_SB.PCI0.SBC3.PIDC, Local1, \_SB.PCI0.SBC3.PIDC)
357                 }
358             }
359
360