blob: 45b2821aef938ce2c8ce286ae95149a496c225c8 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Mike Loptien573a1d62013-03-18 11:19:26 -06003
4Scope(\) {
5 /* PCI IRQ mapping registers, C00h-C01h. */
6 OperationRegion(PRQM, SystemIO, 0x00000C00, 0x00000002)
7 Field(PRQM, ByteAcc, NoLock, Preserve) {
8 PRQI, 0x00000008,
9 PRQD, 0x00000008, /* Offset: 1h */
10 }
11 IndexField(PRQI, PRQD, ByteAcc, NoLock, Preserve) {
12 PIRA, 0x00000008, /* Index 0 */
13 PIRB, 0x00000008, /* Index 1 */
14 PIRC, 0x00000008, /* Index 2 */
15 PIRD, 0x00000008, /* Index 3 */
16 PIRE, 0x00000008, /* Index 4 */
17 PIRF, 0x00000008, /* Index 5 */
18 PIRG, 0x00000008, /* Index 6 */
19 PIRH, 0x00000008, /* Index 7 */
20 }
21
22 /* PCI Error control register */
23 OperationRegion(PERC, SystemIO, 0x00000C14, 0x00000001)
24 Field(PERC, ByteAcc, NoLock, Preserve) {
25 SENS, 0x00000001,
26 PENS, 0x00000001,
27 SENE, 0x00000001,
28 PENE, 0x00000001,
29 }
30}
31
32Scope(\_SB) {
33 /* PCIe Configuration Space for 16 busses */
34 OperationRegion(PCFG, SystemMemory, PCBA, 0x01000000) /* Each bus consumes 1MB */
35 Field(PCFG, ByteAcc, NoLock, Preserve) {
36 /* Byte offsets are computed using the following technique:
37 * ((bus number + 1) * ((device number * 8) * 4096)) + register offset
38 * The 8 comes from 8 functions per device, and 4096 bytes per function config space
39 */
40 Offset(0x00088024), /* SATA reg 24h Bus 0, Device 17, Function 0 */
41 STB5, 32,
42 Offset(0x00098042), /* OHCI0 reg 42h - Bus 0, Device 19, Function 0 */
43 PT0D, 1,
44 PT1D, 1,
45 PT2D, 1,
46 PT3D, 1,
47 PT4D, 1,
48 PT5D, 1,
49 PT6D, 1,
50 PT7D, 1,
51 PT8D, 1,
52 PT9D, 1,
53 Offset(0x000A0004), /* SMBUS reg 4h - Bus 0, Device 20, Function 0 */
54 SBIE, 1,
55 SBME, 1,
56 Offset(0x000A0008), /* SMBUS reg 8h - Bus 0, Device 20, Function 0 */
57 SBRI, 8,
58 Offset(0x000A0014), /* SMBUS reg 14h - Bus 0, Device 20, Function 0 */
59 SBB1, 32,
60 Offset(0x000A0078), /* SMBUS reg 78h - Bus 0, Device 20, Function 0 */
61 ,14,
62 P92E, 1, /* Port92 decode enable */
63 }
64
65 OperationRegion(SB5, SystemMemory, STB5, 0x1000)
66 Field(SB5, AnyAcc, NoLock, Preserve){
67 /* Port 0 */
68 Offset(0x120), /* Port 0 Task file status */
69 P0ER, 1,
70 , 2,
71 P0DQ, 1,
72 , 3,
73 P0BY, 1,
74 Offset(0x128), /* Port 0 Serial ATA status */
75 P0DD, 4,
76 , 4,
77 P0IS, 4,
78 Offset(0x12C), /* Port 0 Serial ATA control */
79 P0DI, 4,
80 Offset(0x130), /* Port 0 Serial ATA error */
81 , 16,
82 P0PR, 1,
83
84 /* Port 1 */
85 offset(0x1A0), /* Port 1 Task file status */
86 P1ER, 1,
87 , 2,
88 P1DQ, 1,
89 , 3,
90 P1BY, 1,
91 Offset(0x1A8), /* Port 1 Serial ATA status */
92 P1DD, 4,
93 , 4,
94 P1IS, 4,
95 Offset(0x1AC), /* Port 1 Serial ATA control */
96 P1DI, 4,
97 Offset(0x1B0), /* Port 1 Serial ATA error */
98 , 16,
99 P1PR, 1,
100
101 /* Port 2 */
102 Offset(0x220), /* Port 2 Task file status */
103 P2ER, 1,
104 , 2,
105 P2DQ, 1,
106 , 3,
107 P2BY, 1,
108 Offset(0x228), /* Port 2 Serial ATA status */
109 P2DD, 4,
110 , 4,
111 P2IS, 4,
112 Offset(0x22C), /* Port 2 Serial ATA control */
113 P2DI, 4,
114 Offset(0x230), /* Port 2 Serial ATA error */
115 , 16,
116 P2PR, 1,
117
118 /* Port 3 */
119 Offset(0x2A0), /* Port 3 Task file status */
120 P3ER, 1,
121 , 2,
122 P3DQ, 1,
123 , 3,
124 P3BY, 1,
125 Offset(0x2A8), /* Port 3 Serial ATA status */
126 P3DD, 4,
127 , 4,
128 P3IS, 4,
129 Offset(0x2AC), /* Port 3 Serial ATA control */
130 P3DI, 4,
131 Offset(0x2B0), /* Port 3 Serial ATA error */
132 , 16,
133 P3PR, 1,
134 }
135
136 Method(_PIC, 0x01, NotSerialized)
137 {
138 If (Arg0)
139 {
140 \_SB.CIRQ()
141 }
142 Store(Arg0, PMOD)
143 }
144
145 Method(CIRQ, 0x00, NotSerialized){
146 Store(0, PIRA)
147 Store(0, PIRB)
148 Store(0, PIRC)
149 Store(0, PIRD)
150 Store(0, PIRE)
151 Store(0, PIRF)
152 Store(0, PIRG)
153 Store(0, PIRH)
154 }
155
156 Name(IRQB, ResourceTemplate(){
157 IRQ(Level,ActiveLow,Shared){15}
158 })
159
160 Name(IRQP, ResourceTemplate(){
161 IRQ(Level,ActiveLow,Exclusive){3, 4, 5, 7, 10, 11, 12, 15}
162 })
163
164 Name(PITF, ResourceTemplate(){
165 IRQ(Level,ActiveLow,Exclusive){9}
166 })
167
168 Device(INTA) {
169 Name(_HID, EISAID("PNP0C0F"))
170 Name(_UID, 1)
171
172 Method(_STA, 0) {
173 if (PIRA) {
174 Return(0x0B) /* sata is invisible */
175 } else {
176 Return(0x09) /* sata is disabled */
177 }
178 } /* End Method(_SB.INTA._STA) */
179
180 Method(_DIS ,0) {
181 /* DBGO("\\_SB\\LNKA\\_DIS\n") */
182 Store(0, PIRA)
183 } /* End Method(_SB.INTA._DIS) */
184
185 Method(_PRS ,0) {
186 /* DBGO("\\_SB\\LNKA\\_PRS\n") */
187 Return(IRQP)
188 } /* Method(_SB.INTA._PRS) */
189
190 Method(_CRS ,0) {
191 /* DBGO("\\_SB\\LNKA\\_CRS\n") */
192 CreateWordField(IRQB, 0x1, IRQN)
193 ShiftLeft(1, PIRA, IRQN)
194 Return(IRQB)
195 } /* Method(_SB.INTA._CRS) */
196
197 Method(_SRS, 1) {
198 /* DBGO("\\_SB\\LNKA\\_SRS\n") */
199 CreateWordField(ARG0, 1, IRQM)
200
201 /* Use lowest available IRQ */
202 FindSetRightBit(IRQM, Local0)
203 if (Local0) {
204 Decrement(Local0)
205 }
206 Store(Local0, PIRA)
207 } /* End Method(_SB.INTA._SRS) */
208 } /* End Device(INTA) */
209
210 Device(INTB) {
211 Name(_HID, EISAID("PNP0C0F"))
212 Name(_UID, 2)
213
214 Method(_STA, 0) {
215 if (PIRB) {
216 Return(0x0B) /* sata is invisible */
217 } else {
218 Return(0x09) /* sata is disabled */
219 }
220 } /* End Method(_SB.INTB._STA) */
221
222 Method(_DIS ,0) {
223 /* DBGO("\\_SB\\LNKB\\_DIS\n") */
224 Store(0, PIRB)
225 } /* End Method(_SB.INTB._DIS) */
226
227 Method(_PRS ,0) {
228 /* DBGO("\\_SB\\LNKB\\_PRS\n") */
229 Return(IRQP)
230 } /* Method(_SB.INTB._PRS) */
231
232 Method(_CRS ,0) {
233 /* DBGO("\\_SB\\LNKB\\_CRS\n") */
234 CreateWordField(IRQB, 0x1, IRQN)
235 ShiftLeft(1, PIRB, IRQN)
236 Return(IRQB)
237 } /* Method(_SB.INTB._CRS) */
238
239 Method(_SRS, 1) {
240 /* DBGO("\\_SB\\LNKB\\_CRS\n") */
241 CreateWordField(ARG0, 1, IRQM)
242
243 /* Use lowest available IRQ */
244 FindSetRightBit(IRQM, Local0)
245 if (Local0) {
246 Decrement(Local0)
247 }
248 Store(Local0, PIRB)
249 } /* End Method(_SB.INTB._SRS) */
250 } /* End Device(INTB) */
251
252 Device(INTC) {
253 Name(_HID, EISAID("PNP0C0F"))
254 Name(_UID, 3)
255
256 Method(_STA, 0) {
257 if (PIRC) {
258 Return(0x0B) /* sata is invisible */
259 } else {
260 Return(0x09) /* sata is disabled */
261 }
262 } /* End Method(_SB.INTC._STA) */
263
264 Method(_DIS ,0) {
265 /* DBGO("\\_SB\\LNKC\\_DIS\n") */
266 Store(0, PIRC)
267 } /* End Method(_SB.INTC._DIS) */
268
269 Method(_PRS ,0) {
270 /* DBGO("\\_SB\\LNKC\\_PRS\n") */
271 Return(IRQP)
272 } /* Method(_SB.INTC._PRS) */
273
274 Method(_CRS ,0) {
275 /* DBGO("\\_SB\\LNKC\\_CRS\n") */
276 CreateWordField(IRQB, 0x1, IRQN)
277 ShiftLeft(1, PIRC, IRQN)
278 Return(IRQB)
279 } /* Method(_SB.INTC._CRS) */
280
281 Method(_SRS, 1) {
282 /* DBGO("\\_SB\\LNKC\\_CRS\n") */
283 CreateWordField(ARG0, 1, IRQM)
284
285 /* Use lowest available IRQ */
286 FindSetRightBit(IRQM, Local0)
287 if (Local0) {
288 Decrement(Local0)
289 }
290 Store(Local0, PIRC)
291 } /* End Method(_SB.INTC._SRS) */
292 } /* End Device(INTC) */
293
294 Device(INTD) {
295 Name(_HID, EISAID("PNP0C0F"))
296 Name(_UID, 4)
297
298 Method(_STA, 0) {
299 if (PIRD) {
300 Return(0x0B) /* sata is invisible */
301 } else {
302 Return(0x09) /* sata is disabled */
303 }
304 } /* End Method(_SB.INTD._STA) */
305
306 Method(_DIS ,0) {
307 /* DBGO("\\_SB\\LNKD\\_DIS\n") */
308 Store(0, PIRD)
309 } /* End Method(_SB.INTD._DIS) */
310
311 Method(_PRS ,0) {
312 /* DBGO("\\_SB\\LNKD\\_PRS\n") */
313 Return(IRQP)
314 } /* Method(_SB.INTD._PRS) */
315
316 Method(_CRS ,0) {
317 /* DBGO("\\_SB\\LNKD\\_CRS\n") */
318 CreateWordField(IRQB, 0x1, IRQN)
319 ShiftLeft(1, PIRD, IRQN)
320 Return(IRQB)
321 } /* Method(_SB.INTD._CRS) */
322
323 Method(_SRS, 1) {
324 /* DBGO("\\_SB\\LNKD\\_CRS\n") */
325 CreateWordField(ARG0, 1, IRQM)
326
327 /* Use lowest available IRQ */
328 FindSetRightBit(IRQM, Local0)
329 if (Local0) {
330 Decrement(Local0)
331 }
332 Store(Local0, PIRD)
333 } /* End Method(_SB.INTD._SRS) */
334 } /* End Device(INTD) */
335
336 Device(INTE) {
337 Name(_HID, EISAID("PNP0C0F"))
338 Name(_UID, 5)
339
340 Method(_STA, 0) {
341 if (PIRE) {
342 Return(0x0B) /* sata is invisible */
343 } else {
344 Return(0x09) /* sata is disabled */
345 }
346 } /* End Method(_SB.INTE._STA) */
347
348 Method(_DIS ,0) {
349 /* DBGO("\\_SB\\LNKE\\_DIS\n") */
350 Store(0, PIRE)
351 } /* End Method(_SB.INTE._DIS) */
352
353 Method(_PRS ,0) {
354 /* DBGO("\\_SB\\LNKE\\_PRS\n") */
355 Return(IRQP)
356 } /* Method(_SB.INTE._PRS) */
357
358 Method(_CRS ,0) {
359 /* DBGO("\\_SB\\LNKE\\_CRS\n") */
360 CreateWordField(IRQB, 0x1, IRQN)
361 ShiftLeft(1, PIRE, IRQN)
362 Return(IRQB)
363 } /* Method(_SB.INTE._CRS) */
364
365 Method(_SRS, 1) {
366 /* DBGO("\\_SB\\LNKE\\_CRS\n") */
367 CreateWordField(ARG0, 1, IRQM)
368
369 /* Use lowest available IRQ */
370 FindSetRightBit(IRQM, Local0)
371 if (Local0) {
372 Decrement(Local0)
373 }
374 Store(Local0, PIRE)
375 } /* End Method(_SB.INTE._SRS) */
376 } /* End Device(INTE) */
377
378 Device(INTF) {
379 Name(_HID, EISAID("PNP0C0F"))
380 Name(_UID, 6)
381
382 Method(_STA, 0) {
383 if (PIRF) {
384 Return(0x0B) /* sata is invisible */
385 } else {
386 Return(0x09) /* sata is disabled */
387 }
388 } /* End Method(_SB.INTF._STA) */
389
390 Method(_DIS ,0) {
391 /* DBGO("\\_SB\\LNKF\\_DIS\n") */
392 Store(0, PIRF)
393 } /* End Method(_SB.INTF._DIS) */
394
395 Method(_PRS ,0) {
396 /* DBGO("\\_SB\\LNKF\\_PRS\n") */
397 Return(PITF)
398 } /* Method(_SB.INTF._PRS) */
399
400 Method(_CRS ,0) {
401 /* DBGO("\\_SB\\LNKF\\_CRS\n") */
402 CreateWordField(IRQB, 0x1, IRQN)
403 ShiftLeft(1, PIRF, IRQN)
404 Return(IRQB)
405 } /* Method(_SB.INTF._CRS) */
406
407 Method(_SRS, 1) {
408 /* DBGO("\\_SB\\LNKF\\_CRS\n") */
409 CreateWordField(ARG0, 1, IRQM)
410
411 /* Use lowest available IRQ */
412 FindSetRightBit(IRQM, Local0)
413 if (Local0) {
414 Decrement(Local0)
415 }
416 Store(Local0, PIRF)
417 } /* End Method(_SB.INTF._SRS) */
418 } /* End Device(INTF) */
419
420 Device(INTG) {
421 Name(_HID, EISAID("PNP0C0F"))
422 Name(_UID, 7)
423
424 Method(_STA, 0) {
425 if (PIRG) {
426 Return(0x0B) /* sata is invisible */
427 } else {
428 Return(0x09) /* sata is disabled */
429 }
430 } /* End Method(_SB.INTG._STA) */
431
432 Method(_DIS ,0) {
433 /* DBGO("\\_SB\\LNKG\\_DIS\n") */
434 Store(0, PIRG)
435 } /* End Method(_SB.INTG._DIS) */
436
437 Method(_PRS ,0) {
438 /* DBGO("\\_SB\\LNKG\\_PRS\n") */
439 Return(IRQP)
440 } /* Method(_SB.INTG._CRS) */
441
442 Method(_CRS ,0) {
443 /* DBGO("\\_SB\\LNKG\\_CRS\n") */
444 CreateWordField(IRQB, 0x1, IRQN)
445 ShiftLeft(1, PIRG, IRQN)
446 Return(IRQB)
447 } /* Method(_SB.INTG._CRS) */
448
449 Method(_SRS, 1) {
450 /* DBGO("\\_SB\\LNKG\\_CRS\n") */
451 CreateWordField(ARG0, 1, IRQM)
452
453 /* Use lowest available IRQ */
454 FindSetRightBit(IRQM, Local0)
455 if (Local0) {
456 Decrement(Local0)
457 }
458 Store(Local0, PIRG)
459 } /* End Method(_SB.INTG._SRS) */
460 } /* End Device(INTG) */
461
462 Device(INTH) {
463 Name(_HID, EISAID("PNP0C0F"))
464 Name(_UID, 8)
465
466 Method(_STA, 0) {
467 if (PIRH) {
468 Return(0x0B) /* sata is invisible */
469 } else {
470 Return(0x09) /* sata is disabled */
471 }
472 } /* End Method(_SB.INTH._STA) */
473
474 Method(_DIS ,0) {
475 /* DBGO("\\_SB\\LNKH\\_DIS\n") */
476 Store(0, PIRH)
477 } /* End Method(_SB.INTH._DIS) */
478
479 Method(_PRS ,0) {
480 /* DBGO("\\_SB\\LNKH\\_PRS\n") */
481 Return(IRQP)
482 } /* Method(_SB.INTH._CRS) */
483
484 Method(_CRS ,0) {
485 /* DBGO("\\_SB\\LNKH\\_CRS\n") */
486 CreateWordField(IRQB, 0x1, IRQN)
487 ShiftLeft(1, PIRH, IRQN)
488 Return(IRQB)
489 } /* Method(_SB.INTH._CRS) */
490
491 Method(_SRS, 1) {
492 /* DBGO("\\_SB\\LNKH\\_CRS\n") */
493 CreateWordField(ARG0, 1, IRQM)
494
495 /* Use lowest available IRQ */
496 FindSetRightBit(IRQM, Local0)
497 if (Local0) {
498 Decrement(Local0)
499 }
500 Store(Local0, PIRH)
501 } /* End Method(_SB.INTH._SRS) */
502 } /* End Device(INTH) */
503
504 } /* End Scope(_SB) */