Please bear with me - another rename checkin. This qualifies as trivial, no
[coreboot.git] / src / mainboard / amd / serengeti_cheetah_fam10 / dx / amd8111_pic.asl
1 //
2 // This file is part of the coreboot project.
3 //
4 // Copyright (C) 2007 Advanced Micro Devices, Inc.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; version 2 of the License.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18 //
19
20 //AMD8111 pic LNKA B C D
21
22         Device (LNKA)
23         {
24                 Name (_HID, EisaId ("PNP0C0F"))
25                 Name (_UID, 0x01)
26                 Method (_STA, 0, NotSerialized)
27                 {
28                         And (\_SB.PCI0.SBC3.PIBA, 0x0F, Local0)
29                         If (LEqual (Local0, 0x00)) { Return (0x09) } //Disabled
30                         Else { Return (0x0B) } //Enabled
31                 }
32
33                 Method (_PRS, 0, NotSerialized)
34                 {
35                          Name (BUFA, ResourceTemplate ()
36                         {
37                                 IRQ (Level, ActiveLow, Shared) {3,5,10,11}
38                         })
39                         Return (BUFA)
40                 }
41
42                 Method (_DIS, 0, NotSerialized)
43                 {
44                         Store (0x01, Local3)
45                         And (\_SB.PCI0.SBC3.PIBA, 0x0F, Local1)
46                         Store (Local1, Local2)
47                         If (LGreater (Local1, 0x07))
48                         {
49                                 Subtract (Local1, 0x08, Local1)
50                         }
51
52                         ShiftLeft (Local3, Local1, Local3)
53                         Not (Local3, Local3)
54                         And (\_SB.PCI0.SBC3.PIBA, 0xF0, \_SB.PCI0.SBC3.PIBA)
55                 }
56
57                 Method (_CRS, 0, NotSerialized)
58                 {
59                         Name (BUFA, ResourceTemplate ()
60                         {
61                                 IRQ (Level, ActiveLow, Shared) {}
62                         })
63                         CreateByteField (BUFA, 0x01, IRA1)
64                         CreateByteField (BUFA, 0x02, IRA2)
65                         Store (0x00, Local3)
66                         Store (0x00, Local4)
67                         And (\_SB.PCI0.SBC3.PIBA, 0x0F, Local1)
68                         If (LNot (LEqual (Local1, 0x00)))
69                         {       // Routing enable
70                                 If (LGreater (Local1, 0x07))
71                                 {
72                                         Subtract (Local1, 0x08, Local2)
73                                         ShiftLeft (One, Local2, Local4)
74                                 }
75                                 Else
76                                 {
77                                         If (LGreater (Local1, 0x00))
78                                         {
79                                                 ShiftLeft (One, Local1, Local3)
80                                         }
81                                 }
82
83                                 Store (Local3, IRA1)
84                                 Store (Local4, IRA2)
85                         }
86
87                         Return (BUFA)
88                 }
89
90                 Method (_SRS, 1, NotSerialized)
91                 {
92                         CreateByteField (Arg0, 0x01, IRA1)
93                         CreateByteField (Arg0, 0x02, IRA2)
94                         ShiftLeft (IRA2, 0x08, Local0)
95                         Or (Local0, IRA1, Local0)
96                         Store (0x00, Local1)
97                         ShiftRight (Local0, 0x01, Local0)
98                         While (LGreater (Local0, 0x00))
99                         {
100                                 Increment (Local1)
101                                 ShiftRight (Local0, 0x01, Local0)
102                         }
103
104                         And (\_SB.PCI0.SBC3.PIBA, 0xF0, \_SB.PCI0.SBC3.PIBA)
105                         Or (\_SB.PCI0.SBC3.PIBA, Local1, \_SB.PCI0.SBC3.PIBA)
106                 }
107         }
108
109         Device (LNKB)
110         {
111                 Name (_HID, EisaId ("PNP0C0F"))
112                 Name (_UID, 0x02)
113                 Method (_STA, 0, NotSerialized)
114                 {
115                         And (\_SB.PCI0.SBC3.PIBA, 0xF0, Local0)
116                         If (LEqual (Local0, 0x00)) { Return (0x09) }
117                         Else { Return (0x0B) }
118                 }
119
120                 Method (_PRS, 0, NotSerialized)
121                 {
122                         Name (BUFB, ResourceTemplate ()
123                         {
124                                 IRQ (Level, ActiveLow, Shared) {3,5,10,11}
125                         })
126                         Return (BUFB)
127                 }
128
129                 Method (_DIS, 0, NotSerialized)
130                 {
131                         Store (0x01, Local3)
132                         And (\_SB.PCI0.SBC3.PIBA, 0xF0, Local1)
133                         ShiftRight (Local1, 0x04, Local1)
134                         Store (Local1, Local2)
135                         If (LGreater (Local1, 0x07))
136                         {
137                                 Subtract (Local1, 0x08, Local1)
138                         }
139
140                         ShiftLeft (Local3, Local1, Local3)
141                         Not (Local3, Local3)
142                         And (\_SB.PCI0.SBC3.PIBA, 0x0F, \_SB.PCI0.SBC3.PIBA)
143                 }
144
145                 Method (_CRS, 0, NotSerialized)
146                 {
147                         Name (BUFB, ResourceTemplate ()
148                         {
149                                 IRQ (Level, ActiveLow, Shared) {}
150                         })
151                         CreateByteField (BUFB, 0x01, IRB1)
152                         CreateByteField (BUFB, 0x02, IRB2)
153                         Store (0x00, Local3)
154                         Store (0x00, Local4)
155                         And (\_SB.PCI0.SBC3.PIBA, 0xF0, Local1)
156                         ShiftRight (Local1, 0x04, Local1)
157                         If (LNot (LEqual (Local1, 0x00)))
158                         {
159                                 If (LGreater (Local1, 0x07))
160                                 {
161                                 Subtract (Local1, 0x08, Local2)
162                                 ShiftLeft (One, Local2, Local4)
163                                 }
164                                 Else
165                                 {
166                                         If (LGreater (Local1, 0x00))
167                                         {
168                                                 ShiftLeft (One, Local1, Local3)
169                                         }
170                                 }
171
172                                 Store (Local3, IRB1)
173                                 Store (Local4, IRB2)
174                         }
175
176                         Return (BUFB)
177                 }
178
179                 Method (_SRS, 1, NotSerialized)
180                 {
181                         CreateByteField (Arg0, 0x01, IRB1)
182                         CreateByteField (Arg0, 0x02, IRB2)
183                         ShiftLeft (IRB2, 0x08, Local0)
184                         Or (Local0, IRB1, Local0)
185                         Store (0x00, Local1)
186                         ShiftRight (Local0, 0x01, Local0)
187                         While (LGreater (Local0, 0x00))
188                         {
189                                 Increment (Local1)
190                                 ShiftRight (Local0, 0x01, Local0)
191                         }
192
193                         And (\_SB.PCI0.SBC3.PIBA, 0x0F, \_SB.PCI0.SBC3.PIBA)
194                         ShiftLeft (Local1, 0x04, Local1)
195                         Or (\_SB.PCI0.SBC3.PIBA, Local1, \_SB.PCI0.SBC3.PIBA)
196                 }
197         }
198
199         Device (LNKC)
200         {
201                 Name (_HID, EisaId ("PNP0C0F"))
202                 Name (_UID, 0x03)
203                 Method (_STA, 0, NotSerialized)
204                 {
205                         And (\_SB.PCI0.SBC3.PIDC, 0x0F, Local0)
206                         If (LEqual (Local0, 0x00)) { Return (0x09) }
207                         Else { Return (0x0B) }
208                 }
209
210                 Method (_PRS, 0, NotSerialized)
211                 {
212                         Name (BUFA, ResourceTemplate ()
213                         {
214                                 IRQ (Level, ActiveLow, Shared) {3,5,10,11}
215                         })
216                         Return (BUFA)
217                 }
218
219                 Method (_DIS, 0, NotSerialized)
220                 {
221                         Store (0x01, Local3)
222                         And (\_SB.PCI0.SBC3.PIDC, 0x0F, Local1)
223                         Store (Local1, Local2)
224                         If (LGreater (Local1, 0x07))
225                         {
226                                 Subtract (Local1, 0x08, Local1)
227                         }
228
229                         ShiftLeft (Local3, Local1, Local3)
230                         Not (Local3, Local3)
231                         And (\_SB.PCI0.SBC3.PIDC, 0xF0, \_SB.PCI0.SBC3.PIDC)
232                 }
233
234                 Method (_CRS, 0, NotSerialized)
235                 {
236                         Name (BUFA, ResourceTemplate ()
237                         {
238                                 IRQ (Level, ActiveLow, Shared) {}
239                         })
240                         CreateByteField (BUFA, 0x01, IRA1)
241                         CreateByteField (BUFA, 0x02, IRA2)
242                         Store (0x00, Local3)
243                         Store (0x00, Local4)
244                         And (\_SB.PCI0.SBC3.PIDC, 0x0F, Local1)
245                         If (LNot (LEqual (Local1, 0x00)))
246                         {
247                                 If (LGreater (Local1, 0x07))
248                                 {
249                                         Subtract (Local1, 0x08, Local2)
250                                         ShiftLeft (One, Local2, Local4)
251                                 }
252                                 Else
253                                 {
254                                         If (LGreater (Local1, 0x00))
255                                         {
256                                                 ShiftLeft (One, Local1, Local3)
257                                         }
258                                 }
259
260                                 Store (Local3, IRA1)
261                                 Store (Local4, IRA2)
262                         }
263
264                         Return (BUFA)
265                 }
266
267                 Method (_SRS, 1, NotSerialized)
268                 {
269                         CreateByteField (Arg0, 0x01, IRA1)
270                         CreateByteField (Arg0, 0x02, IRA2)
271                         ShiftLeft (IRA2, 0x08, Local0)
272                         Or (Local0, IRA1, Local0)
273                         Store (0x00, Local1)
274                         ShiftRight (Local0, 0x01, Local0)
275                         While (LGreater (Local0, 0x00))
276                         {
277                                 Increment (Local1)
278                                 ShiftRight (Local0, 0x01, Local0)
279                         }
280
281                         And (\_SB.PCI0.SBC3.PIDC, 0xF0, \_SB.PCI0.SBC3.PIDC)
282                         Or (\_SB.PCI0.SBC3.PIDC, Local1, \_SB.PCI0.SBC3.PIDC)
283                 }
284         }
285
286         Device (LNKD)
287         {
288                 Name (_HID, EisaId ("PNP0C0F"))
289                 Name (_UID, 0x04)
290                 Method (_STA, 0, NotSerialized)
291                 {
292                         And (\_SB.PCI0.SBC3.PIDC, 0xF0, Local0)
293                         If (LEqual (Local0, 0x00)) { Return (0x09) }
294                         Else { Return (0x0B) }
295                 }
296
297                 Method (_PRS, 0, NotSerialized)
298                 {
299                         Name (BUFB, ResourceTemplate ()
300                         {
301                                 IRQ (Level, ActiveLow, Shared) {3,5,10,11}
302                         })
303                         Return (BUFB)
304                 }
305
306                 Method (_DIS, 0, NotSerialized)
307                 {
308                         Store (0x01, Local3)
309                         And (\_SB.PCI0.SBC3.PIDC, 0xF0, Local1)
310                         ShiftRight (Local1, 0x04, Local1)
311                         Store (Local1, Local2)
312                         If (LGreater (Local1, 0x07))
313                         {
314                                 Subtract (Local1, 0x08, Local1)
315                         }
316
317                         ShiftLeft (Local3, Local1, Local3)
318                         Not (Local3, Local3)
319                         And (\_SB.PCI0.SBC3.PIDC, 0x0F, \_SB.PCI0.SBC3.PIDC)
320                 }
321
322                 Method (_CRS, 0, NotSerialized)
323                 {
324                         Name (BUFB, ResourceTemplate ()
325                         {
326                                 IRQ (Level, ActiveLow, Shared) {}
327                         })
328                         CreateByteField (BUFB, 0x01, IRB1)
329                         CreateByteField (BUFB, 0x02, IRB2)
330                         Store (0x00, Local3)
331                         Store (0x00, Local4)
332                         And (\_SB.PCI0.SBC3.PIDC, 0xF0, Local1)
333                         ShiftRight (Local1, 0x04, Local1)
334                         If (LNot (LEqual (Local1, 0x00)))
335                         {
336                                 If (LGreater (Local1, 0x07))
337                                 {
338                                         Subtract (Local1, 0x08, Local2)
339                                         ShiftLeft (One, Local2, Local4)
340                                 }
341                                 Else
342                                 {
343                                         If (LGreater (Local1, 0x00))
344                                         {
345                                                 ShiftLeft (One, Local1, Local3)
346                                         }
347                                 }
348
349                                 Store (Local3, IRB1)
350                                 Store (Local4, IRB2)
351                         }
352
353                         Return (BUFB)
354                 }
355
356                 Method (_SRS, 1, NotSerialized)
357                 {
358                         CreateByteField (Arg0, 0x01, IRB1)
359                         CreateByteField (Arg0, 0x02, IRB2)
360                         ShiftLeft (IRB2, 0x08, Local0)
361                         Or (Local0, IRB1, Local0)
362                         Store (0x00, Local1)
363                         ShiftRight (Local0, 0x01, Local0)
364                         While (LGreater (Local0, 0x00))
365                         {
366                                 Increment (Local1)
367                                 ShiftRight (Local0, 0x01, Local0)
368                         }
369
370                         And (\_SB.PCI0.SBC3.PIDC, 0x0F, \_SB.PCI0.SBC3.PIDC)
371                         ShiftLeft (Local1, 0x04, Local1)
372                         Or (\_SB.PCI0.SBC3.PIDC, Local1, \_SB.PCI0.SBC3.PIDC)
373                 }
374         }
375
376