soc: Remove copyright notices
[coreboot.git] / src / soc / amd / stoneyridge / acpi / pci_int.asl
blob13e195a7f7012daf7688065ce076e7374a03e2d3
1 /*
2  * This file is part of the coreboot project.
3  *
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; version 2 of the License.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  */
15         /* PCIe Configuration Space for CONFIG_MMCONF_BUS_NUMBER busses */
16         OperationRegion(PCFG, SystemMemory, PCBA, PCLN) /* Each bus consumes 1MB */
17                 Field(PCFG, ByteAcc, NoLock, Preserve) {
18                 /* Byte offsets are computed using the following technique:
19                  * ((bus number + 1) * ((device number * 8) * 4096)) + register offset
20                  * The 8 comes from 8 functions per device, and 4096 bytes per function config space
21                 */
22                 Offset(0x00088024),     /* Byte offset to SATA register 24h - Bus 0, Device 17, Function 0 */
23                 STB5, 32,
24                 Offset(0x00098042),     /* Byte offset to OHCI0 register 42h - Bus 0, Device 19, Function 0 */
25                 PT0D, 1,
26                 PT1D, 1,
27                 PT2D, 1,
28                 PT3D, 1,
29                 PT4D, 1,
30                 PT5D, 1,
31                 PT6D, 1,
32                 PT7D, 1,
33                 PT8D, 1,
34                 PT9D, 1,
35                 Offset(0x000a0004),     /* Byte offset to SMBUS register 4h - Bus 0, Device 20, Function 0 */
36                 SBIE, 1,
37                 SBME, 1,
38                 Offset(0x000a0008),     /* Byte offset to SMBUS register 8h - Bus 0, Device 20, Function 0 */
39                 SBRI, 8,
40                 Offset(0x000a0014),     /* Byte offset to SMBUS register 14h - Bus 0, Device 20, Function 0 */
41                 SBB1, 32,
42                 Offset(0x000a0078),     /* Byte offset to SMBUS register 78h - Bus 0, Device 20, Function 0 */
43                 ,14,
44                 P92E, 1,                /* Port92 decode enable */
45         }
47         OperationRegion(SB5, SystemMemory, STB5, 0x1000)
48                 Field(SB5, AnyAcc, NoLock, Preserve){
49                 /* Port 0 */
50                 Offset(0x120),          /* Port 0 Task file status */
51                 P0ER, 1,
52                 , 2,
53                 P0DQ, 1,
54                 , 3,
55                 P0BY, 1,
56                 Offset(0x128),          /* Port 0 Serial ATA status */
57                 P0DD, 4,
58                 , 4,
59                 P0IS, 4,
60                 Offset(0x12c),          /* Port 0 Serial ATA control */
61                 P0DI, 4,
62                 Offset(0x130),          /* Port 0 Serial ATA error */
63                 , 16,
64                 P0PR, 1,
66                 /* Port 1 */
67                 offset(0x1a0),          /* Port 1 Task file status */
68                 P1ER, 1,
69                 , 2,
70                 P1DQ, 1,
71                 , 3,
72                 P1BY, 1,
73                 Offset(0x1a8),          /* Port 1 Serial ATA status */
74                 P1DD, 4,
75                 , 4,
76                 P1IS, 4,
77                 Offset(0x1ac),          /* Port 1 Serial ATA control */
78                 P1DI, 4,
79                 Offset(0x1b0),          /* Port 1 Serial ATA error */
80                 , 16,
81                 P1PR, 1,
83                 /* Port 2 */
84                 Offset(0x220),          /* Port 2 Task file status */
85                 P2ER, 1,
86                 , 2,
87                 P2DQ, 1,
88                 , 3,
89                 P2BY, 1,
90                 Offset(0x228),          /* Port 2 Serial ATA status */
91                 P2DD, 4,
92                 , 4,
93                 P2IS, 4,
94                 Offset(0x22c),          /* Port 2 Serial ATA control */
95                 P2DI, 4,
96                 Offset(0x230),          /* Port 2 Serial ATA error */
97                 , 16,
98                 P2PR, 1,
100                 /* Port 3 */
101                 Offset(0x2a0),          /* Port 3 Task file status */
102                 P3ER, 1,
103                 , 2,
104                 P3DQ, 1,
105                 , 3,
106                 P3BY, 1,
107                 Offset(0x2a8),          /* Port 3 Serial ATA status */
108                 P3DD, 4,
109                 , 4,
110                 P3IS, 4,
111                 Offset(0x2aC),          /* Port 3 Serial ATA control */
112                 P3DI, 4,
113                 Offset(0x2b0),          /* Port 3 Serial ATA error */
114                 , 16,
115                 P3PR, 1,
116         }
118         Method(_PIC, 0x01, NotSerialized)
119         {
120                 If (Arg0)
121                 {
122                         \_SB.CIRQ()
123                 }
124                 Store(Arg0, PMOD)
125         }
127         Method(CIRQ, 0x00, NotSerialized){
128         }
130         Name(IRQB, ResourceTemplate(){
131                 IRQ(Level,ActiveLow,Shared){15}
132         })
134         Name(IRQP, ResourceTemplate(){
135                 IRQ(Level,ActiveLow,Exclusive){3, 4, 5, 7, 10, 11, 12, 15}
136         })
138         Name(PITF, ResourceTemplate(){
139                 IRQ(Level,ActiveLow,Exclusive){9}
140         })
142         Device(INTA) {
143                 Name(_HID, EISAID("PNP0C0F"))
144                 Name(_UID, 1)
146                 Method(_STA, 0) {
147                         if (PIRA) {
148                                 Return(0x0b) /* sata is invisible */
149                         } else {
150                                 Return(0x09) /* sata is disabled */
151                         }
152                 } /* End Method(_SB.INTA._STA) */
154                 Method(_DIS ,0) {
155                         /* DBGO("\\_SB\\LNKA\\_DIS\n") */
156                 } /* End Method(_SB.INTA._DIS) */
158                 Method(_PRS ,0) {
159                         /* DBGO("\\_SB\\LNKA\\_PRS\n") */
160                         Return(IRQP)
161                 } /* Method(_SB.INTA._PRS) */
163                 Method(_CRS ,0) {
164                         /* DBGO("\\_SB\\LNKA\\_CRS\n") */
165                         CreateWordField(IRQB, 0x1, IRQN)
166                         ShiftLeft(1, PIRA, IRQN)
167                         Return(IRQB)
168                 } /* Method(_SB.INTA._CRS) */
170                 Method(_SRS, 1) {
171                         /* DBGO("\\_SB\\LNKA\\_SRS\n") */
172                         CreateWordField(ARG0, 1, IRQM)
174                         /* Use lowest available IRQ */
175                         FindSetRightBit(IRQM, Local0)
176                         if (Local0) {
177                                 Decrement(Local0)
178                         }
179                         Store(Local0, PIRA)
180                 } /* End Method(_SB.INTA._SRS) */
181         } /* End Device(INTA) */
183         Device(INTB) {
184                 Name(_HID, EISAID("PNP0C0F"))
185                 Name(_UID, 2)
187                 Method(_STA, 0) {
188                         if (PIRB) {
189                                 Return(0x0b) /* sata is invisible */
190                         } else {
191                                 Return(0x09) /* sata is disabled */
192                         }
193                 } /* End Method(_SB.INTB._STA) */
195                 Method(_DIS ,0) {
196                         /* DBGO("\\_SB\\LNKB\\_DIS\n") */
197                 } /* End Method(_SB.INTB._DIS) */
199                 Method(_PRS ,0) {
200                         /* DBGO("\\_SB\\LNKB\\_PRS\n") */
201                         Return(IRQP)
202                 } /* Method(_SB.INTB._PRS) */
204                 Method(_CRS ,0) {
205                         /* DBGO("\\_SB\\LNKB\\_CRS\n") */
206                         CreateWordField(IRQB, 0x1, IRQN)
207                         ShiftLeft(1, PIRB, IRQN)
208                         Return(IRQB)
209                 } /* Method(_SB.INTB._CRS) */
211                 Method(_SRS, 1) {
212                         /* DBGO("\\_SB\\LNKB\\_CRS\n") */
213                         CreateWordField(ARG0, 1, IRQM)
215                         /* Use lowest available IRQ */
216                         FindSetRightBit(IRQM, Local0)
217                         if (Local0) {
218                                 Decrement(Local0)
219                         }
220                         Store(Local0, PIRB)
221                 } /* End Method(_SB.INTB._SRS) */
222         } /* End Device(INTB)  */
224         Device(INTC) {
225                 Name(_HID, EISAID("PNP0C0F"))
226                 Name(_UID, 3)
228                 Method(_STA, 0) {
229                         if (PIRC) {
230                                 Return(0x0b) /* sata is invisible */
231                         } else {
232                                 Return(0x09) /* sata is disabled */
233                         }
234                 } /* End Method(_SB.INTC._STA) */
236                 Method(_DIS ,0) {
237                         /* DBGO("\\_SB\\LNKC\\_DIS\n") */
238                 } /* End Method(_SB.INTC._DIS) */
240                 Method(_PRS ,0) {
241                         /* DBGO("\\_SB\\LNKC\\_PRS\n") */
242                         Return(IRQP)
243                 } /* Method(_SB.INTC._PRS) */
245                 Method(_CRS ,0) {
246                         /* DBGO("\\_SB\\LNKC\\_CRS\n") */
247                         CreateWordField(IRQB, 0x1, IRQN)
248                         ShiftLeft(1, PIRC, IRQN)
249                         Return(IRQB)
250                 } /* Method(_SB.INTC._CRS) */
252                 Method(_SRS, 1) {
253                         /* DBGO("\\_SB\\LNKC\\_CRS\n") */
254                         CreateWordField(ARG0, 1, IRQM)
256                         /* Use lowest available IRQ */
257                         FindSetRightBit(IRQM, Local0)
258                         if (Local0) {
259                                 Decrement(Local0)
260                         }
261                         Store(Local0, PIRC)
262                 } /* End Method(_SB.INTC._SRS) */
263         } /* End Device(INTC)  */
265         Device(INTD) {
266                 Name(_HID, EISAID("PNP0C0F"))
267                 Name(_UID, 4)
269                 Method(_STA, 0) {
270                         if (PIRD) {
271                                 Return(0x0b) /* sata is invisible */
272                         } else {
273                                 Return(0x09) /* sata is disabled */
274                         }
275                 } /* End Method(_SB.INTD._STA) */
277                 Method(_DIS ,0) {
278                         /* DBGO("\\_SB\\LNKD\\_DIS\n") */
279                 } /* End Method(_SB.INTD._DIS) */
281                 Method(_PRS ,0) {
282                         /* DBGO("\\_SB\\LNKD\\_PRS\n") */
283                         Return(IRQP)
284                 } /* Method(_SB.INTD._PRS) */
286                 Method(_CRS ,0) {
287                         /* DBGO("\\_SB\\LNKD\\_CRS\n") */
288                         CreateWordField(IRQB, 0x1, IRQN)
289                         ShiftLeft(1, PIRD, IRQN)
290                         Return(IRQB)
291                 } /* Method(_SB.INTD._CRS) */
293                 Method(_SRS, 1) {
294                         /* DBGO("\\_SB\\LNKD\\_CRS\n") */
295                         CreateWordField(ARG0, 1, IRQM)
297                         /* Use lowest available IRQ */
298                         FindSetRightBit(IRQM, Local0)
299                         if (Local0) {
300                                 Decrement(Local0)
301                         }
302                         Store(Local0, PIRD)
303                 } /* End Method(_SB.INTD._SRS) */
304         } /* End Device(INTD)  */
306         Device(INTE) {
307                 Name(_HID, EISAID("PNP0C0F"))
308                 Name(_UID, 5)
310                 Method(_STA, 0) {
311                         if (PIRE) {
312                                 Return(0x0b) /* sata is invisible */
313                         } else {
314                                 Return(0x09) /* sata is disabled */
315                         }
316                 } /* End Method(_SB.INTE._STA) */
318                 Method(_DIS ,0) {
319                         /* DBGO("\\_SB\\LNKE\\_DIS\n") */
320                 } /* End Method(_SB.INTE._DIS) */
322                 Method(_PRS ,0) {
323                         /* DBGO("\\_SB\\LNKE\\_PRS\n") */
324                         Return(IRQP)
325                 } /* Method(_SB.INTE._PRS) */
327                 Method(_CRS ,0) {
328                         /* DBGO("\\_SB\\LNKE\\_CRS\n") */
329                         CreateWordField(IRQB, 0x1, IRQN)
330                         ShiftLeft(1, PIRE, IRQN)
331                         Return(IRQB)
332                 } /* Method(_SB.INTE._CRS) */
334                 Method(_SRS, 1) {
335                         /* DBGO("\\_SB\\LNKE\\_CRS\n") */
336                         CreateWordField(ARG0, 1, IRQM)
338                         /* Use lowest available IRQ */
339                         FindSetRightBit(IRQM, Local0)
340                         if (Local0) {
341                                 Decrement(Local0)
342                         }
343                         Store(Local0, PIRE)
344                 } /* End Method(_SB.INTE._SRS) */
345         } /* End Device(INTE)  */
347         Device(INTF) {
348                 Name(_HID, EISAID("PNP0C0F"))
349                 Name(_UID, 6)
351                 Method(_STA, 0) {
352                         if (PIRF) {
353                                 Return(0x0b) /* sata is invisible */
354                         } else {
355                                 Return(0x09) /* sata is disabled */
356                         }
357                 } /* End Method(_SB.INTF._STA) */
359                 Method(_DIS ,0) {
360                         /* DBGO("\\_SB\\LNKF\\_DIS\n") */
361                 } /* End Method(_SB.INTF._DIS) */
363                 Method(_PRS ,0) {
364                         /* DBGO("\\_SB\\LNKF\\_PRS\n") */
365                         Return(PITF)
366                 } /* Method(_SB.INTF._PRS) */
368                 Method(_CRS ,0) {
369                         /* DBGO("\\_SB\\LNKF\\_CRS\n") */
370                         CreateWordField(IRQB, 0x1, IRQN)
371                         ShiftLeft(1, PIRF, IRQN)
372                         Return(IRQB)
373                 } /* Method(_SB.INTF._CRS) */
375                 Method(_SRS, 1) {
376                         /* DBGO("\\_SB\\LNKF\\_CRS\n") */
377                         CreateWordField(ARG0, 1, IRQM)
379                         /* Use lowest available IRQ */
380                         FindSetRightBit(IRQM, Local0)
381                         if (Local0) {
382                                 Decrement(Local0)
383                         }
384                         Store(Local0, PIRF)
385                 } /*  End Method(_SB.INTF._SRS) */
386         } /* End Device(INTF)  */
388         Device(INTG) {
389                 Name(_HID, EISAID("PNP0C0F"))
390                 Name(_UID, 7)
392                 Method(_STA, 0) {
393                         if (PIRG) {
394                                 Return(0x0b) /* sata is invisible */
395                         } else {
396                                 Return(0x09) /* sata is disabled */
397                         }
398                 } /* End Method(_SB.INTG._STA)  */
400                 Method(_DIS ,0) {
401                         /* DBGO("\\_SB\\LNKG\\_DIS\n") */
402                 } /* End Method(_SB.INTG._DIS)  */
404                 Method(_PRS ,0) {
405                         /* DBGO("\\_SB\\LNKG\\_PRS\n") */
406                         Return(IRQP)
407                 } /* Method(_SB.INTG._CRS)  */
409                 Method(_CRS ,0) {
410                         /* DBGO("\\_SB\\LNKG\\_CRS\n") */
411                         CreateWordField(IRQB, 0x1, IRQN)
412                         ShiftLeft(1, PIRG, IRQN)
413                         Return(IRQB)
414                 } /* Method(_SB.INTG._CRS)  */
416                 Method(_SRS, 1) {
417                         /* DBGO("\\_SB\\LNKG\\_CRS\n") */
418                         CreateWordField(ARG0, 1, IRQM)
420                         /* Use lowest available IRQ */
421                         FindSetRightBit(IRQM, Local0)
422                         if (Local0) {
423                                 Decrement(Local0)
424                         }
425                         Store(Local0, PIRG)
426                 } /* End Method(_SB.INTG._SRS)  */
427         } /* End Device(INTG)  */
429         Device(INTH) {
430                 Name(_HID, EISAID("PNP0C0F"))
431                 Name(_UID, 8)
433                 Method(_STA, 0) {
434                         if (PIRH) {
435                                 Return(0x0b) /* sata is invisible */
436                         } else {
437                                 Return(0x09) /* sata is disabled */
438                         }
439                 } /* End Method(_SB.INTH._STA)  */
441                 Method(_DIS ,0) {
442                         /* DBGO("\\_SB\\LNKH\\_DIS\n") */
443                 } /* End Method(_SB.INTH._DIS)  */
445                 Method(_PRS ,0) {
446                         /* DBGO("\\_SB\\LNKH\\_PRS\n") */
447                         Return(IRQP)
448                 } /* Method(_SB.INTH._CRS)  */
450                 Method(_CRS ,0) {
451                         /* DBGO("\\_SB\\LNKH\\_CRS\n") */
452                         CreateWordField(IRQB, 0x1, IRQN)
453                         ShiftLeft(1, PIRH, IRQN)
454                         Return(IRQB)
455                 } /* Method(_SB.INTH._CRS)  */
457                 Method(_SRS, 1) {
458                         /* DBGO("\\_SB\\LNKH\\_CRS\n") */
459                         CreateWordField(ARG0, 1, IRQM)
461                         /* Use lowest available IRQ */
462                         FindSetRightBit(IRQM, Local0)
463                         if (Local0) {
464                                 Decrement(Local0)
465                         }
466                         Store(Local0, PIRH)
467                 } /* End Method(_SB.INTH._SRS)  */
468         } /* End Device(INTH)   */