]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/PchScc.asl
Vlv2DeviceRefCodePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / AcpiTablesPCAT / PchScc.asl
1 /**************************************************************************;
2 ;* *;
3 ;* *;
4 ;* Intel Corporation - ACPI Reference Code for the Baytrail *;
5 ;* Family of Customer Reference Boards. *;
6 ;* *;
7 ;* *;
8 ;* Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved *;
9 ;
10 ; SPDX-License-Identifier: BSD-2-Clause-Patent
11 ;
12 ;* *;
13 ;* *;
14 ;**************************************************************************/
15 Device (PEPD)
16 {
17 Name (_HID, "INT3396")
18 Name(_CID, 0x800dd041)
19 Name (_UID, 0x1)
20
21 // Indicates if the platform PEP has loaded
22 Name(PEPP, Zero)
23
24 // Devices score-boarded by the PEP, Rev0 format
25 Name (DEVS, Package() {0})
26
27 // Devices score-boarded by the PEP, Rev1 format
28 Name(DEVX, Package()
29 {
30 Package () {"\\_SB.PCI0.XHC1", 0x1},
31 Package () {"\\_SB.PCI0.EHC1", 0x1},
32 Package () {"\\_SB.PCI0.GFX0", 0x1},
33 Package () {"\\_SB.PCI0.GFX0.ISP0", 0x1},
34 Package () {"\\_SB.PCI0.SEC0", 0x1},
35 Package () {"\\_SB.I2C1", 0x1},
36 Package () {"\\_SB.I2C2", 0x1},
37 Package () {"\\_SB.I2C3", 0x1},
38 Package () {"\\_SB.I2C4", 0x1},
39 Package () {"\\_SB.I2C5", 0x1},
40 Package () {"\\_SB.I2C6", 0x1},
41 Package () {"\\_SB.I2C7", 0x1},
42 Package () {"\\_SB.SDHA", 0x1},
43 Package () {"\\_SB.SDHB", 0x1},
44 Package () {"\\_SB.SDHC", 0x1},
45 Package () {"\\_SB.SPI1", 0x1},
46 Package () {"\\_SB.URT1", 0x1},
47 Package () {"\\_SB.URT2", 0x1},
48 })
49 // Crashdump device package
50 Name(CDMP, Package(2) {})
51 // Device dependency for uPEP
52 Name(DEVY, Package()
53 {
54 Package() {"\\_PR.CPU0", 0x1, Package() {Package() {0xFF, 0}}},
55 Package() {"\\_PR.CPU1", 0x1, Package() {Package() {0xFF, 0}}},
56 Package() {"\\_PR.CPU2", 0x1, Package() {Package() {0xFF, 0}}},
57 Package() {"\\_PR.CPU3", 0x1, Package() {Package() {0xFF, 0}}},
58 Package() {"\\_SB.I2C1", 0x1, Package() {Package() {0xFF,3}}},
59 Package() {"\\_SB.I2C2", 0x1, Package() {Package() {0xFF,3}}},
60 Package() {"\\_SB.I2C3", 0x1, Package() {Package() {0xFF,3}}},
61 Package() {"\\_SB.I2C4", 0x1, Package() {Package() {0xFF,3}}},
62 Package() {"\\_SB.I2C5", 0x1, Package() {Package() {0xFF,3}}},
63 Package() {"\\_SB.I2C6", 0x1, Package() {Package() {0xFF,3}}},
64 Package() {"\\_SB.I2C7", 0x1, Package() {Package() {0xFF,3}}},
65 Package() {"\\_SB.PCI0.GFX0", 0x1, Package() {Package() {0xFF,3}}},
66 Package() {"\\_SB.PCI0.SEC0", 0x1, Package() {Package() {0xFF,3}}},
67 Package() {"\\_SB.PCI0.XHC1", 0x1, Package() {Package() {0xFF,3}}},
68 Package() {"\\_SB.PCI0.GFX0.ISP0", 0x1, Package() {Package() {0xFF,3}}},
69 Package() {"\\_SB.LPEA", 0x1, Package() {Package() {0x0,3}, Package() {0x1,0}, Package() {0x2,3}, Package() {0x3,3}}},
70 Package() {"\\_SB.SDHA", 0x1, Package() {Package() {0xFF,3}}},
71 Package() {"\\_SB.SDHB", 0x1, Package() {Package() {0xFF,3}}},
72 Package() {"\\_SB.SDHC", 0x1, Package() {Package() {0xFF,3}}},
73 Package() {"\\_SB.SPI1", 0x1, Package() {Package() {0xFF,3}}},
74 Package() {"\\_SB.URT1", 0x1, Package() {Package() {0xFF,3}}},
75 Package() {"\\_SB.URT2", 0x1, Package() {Package() {0xFF,3}}}
76 })
77 // BCCD crashdump information
78 Name(BCCD, Package()
79 {
80 Package()
81 {
82 "\\_SB.SDHA",
83 Package()
84 {
85 Package() { Package() {0, 32, 0, 3, 0xFFFFFFFFFFFFFFFF}, Package() {0xFFFFFFFC, 0x0, 0x4}, 0}
86 }
87 }
88 })
89
90 Method(_STA, 0x0, NotSerialized)
91 {
92 Return(0xf)
93 }
94
95 Method(_DSM, 0x4, Serialized)
96 {
97 If(LEqual(Arg0,ToUUID("B8FEBFE0-BAF8-454b-AECD-49FB91137B21")))
98 {
99
100 // Number of fn IDs supported
101 If(LEqual(Arg2, Zero))
102 {
103 Return(Buffer(One)
104 {
105 0xf
106 })
107 }
108
109 // Pep presence
110 If(LEqual(Arg2, One))
111 {
112 Store(0x1, PEPP)
113 Return(0xf)
114 }
115
116 // Mitigation devices
117 If(LEqual(Arg2, 0x2))
118 {
119 If(LEqual(Arg1, 0x0))
120 {
121 // Rev0
122 Return(DEVS)
123 }
124 If(LEqual(Arg1, 0x1))
125 {
126 // Rev1
127 Return(DEVX)
128 }
129 }
130
131 // Crashdump device data
132 If(LEqual(Arg2, 0x3))
133 {
134 Store("\\_SB.SDHA", Index(CDMP,0))
135 Store(EM1A, Index(CDMP,1))
136 Return(CDMP)
137 }
138 }
139 // New UUID for built-in uPEP
140 If(LEqual(Arg0,ToUUID("C4EB40A0-6CD2-11E2-BCFD-0800200C9A66")))
141 {
142
143 // Number of fn IDs supported
144 If(LEqual(Arg2, Zero))
145 {
146 Return(Buffer(One)
147 {
148 0x7
149 })
150 }
151 // LPI device dependencies
152 If(LEqual(Arg2, 0x1))
153 {
154 Return(DEVY)
155 }
156 // Crashdump device data
157 If(LEqual(Arg2, 0x2))
158 {
159 Store(EM1A, Local0)
160 Add(Local0, 0x84, Local0)
161 Store(Local0, Index(DerefOf(Index(DerefOf(Index(DerefOf(Index(DerefOf(Index(BCCD, Zero, )), One, )), Zero, )), Zero, )), 0x4, ))
162 Return(BCCD)
163 }
164 }
165
166 Return(One)
167 }
168 }
169
170 //
171 // eMMC 4.41
172 //
173 Device(SDHA)
174 {
175 Name (_ADR, 0)
176 Name (_HID, "80860F14")
177 Name (_CID, "PNP0D40")
178 Name (_DDN, "Intel(R) eMMC Controller - 80860F14")
179 Name (_UID, 1)
180 Name(_DEP, Package(0x1)
181 {
182 PEPD
183 })
184
185 Name (RBF1, ResourceTemplate ()
186 {
187 Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0)
188 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {45} // eMMC 4.41 IRQ
189 })
190
191 Method (_CRS, 0x0, NotSerialized)
192 {
193 // Update the Base address for BAR0 of eMMC 4.41
194 CreateDwordField(^RBF1, ^BAR0._BAS, B0B1)
195 CreateDwordField(^RBF1, ^BAR0._LEN, B0L1)
196 Store(eM0A, B0B1)
197 Store(eM0L, B0L1)
198 Return (RBF1)
199 }
200 Method (_STA, 0x0, NotSerialized)
201 {
202 //
203 // PCIM>> 0:ACPI mode 1:PCI mode
204 // SD1D>> 0:eMMC 4.41 enable 1:eMMC 4.41 disable
205 //
206 If (LAnd(LEqual(PCIM, 0), LEqual(SD1D, 0)))
207 {
208 Return (0xF)
209 }
210 Else
211 {
212 Return (0x0)
213 }
214 }
215
216
217 Method (_PS3, 0, NotSerialized)
218 {
219 OR(PSAT, 0x00000003, PSAT)
220 OR(PSAT, 0X00000000, PSAT)
221 //
222 // If not B1, still keep 2 ms w/a
223 //
224 If(LLess(SOCS, 0x03))
225 {
226 Sleep(2)
227 }
228 }
229 Method (_PS0, 0, NotSerialized)
230 {
231 And(PSAT, 0xfffffffC, PSAT)
232 OR(PSAT, 0X00000000, PSAT)
233 //
234 // If not B1, still keep 2 ms w/a
235 //
236 If(LLess(SOCS, 0x03))
237 {
238 Sleep(2)
239 }
240 }
241
242 OperationRegion (KEYS, SystemMemory, eM1A, 0x100)
243 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
244 {
245 Offset (0x84),
246 PSAT, 32
247 }
248
249 Method (_DIS, 0x0, NotSerialized)
250 {
251 //Adding dummy disable methods for device EMM0
252 }
253
254 Device (EMMD)
255 {
256 Name (_ADR, 0x00000008) // Slot 0, Function 8
257 Method (_RMV, 0, NotSerialized)
258 {
259 Return (0x0)
260 }
261 }
262 }
263
264
265 //
266 // eMMC 4.5
267 //
268 Device(SDHD)
269 {
270 Name (_ADR, 0)
271 Name (_HID, "80860F14")
272 Name (_CID, "PNP0D40")
273 Name (_DDN, "Intel(R) eMMC Controller - 80860F14")
274 Name (_UID, 1)
275 Name(_DEP, Package(0x1)
276 {
277 PEPD
278 })
279
280 Name (RBF1, ResourceTemplate ()
281 {
282 Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0)
283 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {44} // eMMC 4.5 IRQ
284 })
285 Method (_CRS, 0x0, NotSerialized)
286 {
287 CreateDwordField(^RBF1, ^BAR0._BAS, B0B1)
288 CreateDwordField(^RBF1, ^BAR0._LEN, B0L1)
289 Store(eM0A, B0B1)
290 Store(eM0L, B0L1)
291 Return (RBF1)
292 }
293 Method (_STA, 0x0, NotSerialized)
294 {
295 //
296 // PCIM>> 0:ACPI mode 1:PCI mode
297 // HSID>> 0:eMMC 4.5 enable 1:eMMC 4.5 disable
298 //
299 If (LAnd(LEqual(PCIM, 0), LEqual(HSID, 0)))
300 {
301 Return (0xF)
302 }
303 Else
304 {
305 Return (0x0)
306 }
307 }
308
309
310 Method (_PS3, 0, NotSerialized)
311 {
312 OR(PSAT, 0x00000003, PSAT)
313 OR(PSAT, 0X00000000, PSAT)
314 //
315 // If not B1, still keep 2 ms w/a
316 //
317 If(LLess(SOCS, 0x03))
318 {
319 Sleep(2)
320 }
321 }
322 Method (_PS0, 0, NotSerialized)
323 {
324 And(PSAT, 0xfffffffC, PSAT)
325 OR(PSAT, 0X00000000, PSAT)
326 //
327 // If not B1, still keep 2 ms w/a
328 //
329 If(LLess(SOCS, 0x03))
330 {
331 Sleep(2)
332 }
333 }
334
335 OperationRegion (KEYS, SystemMemory, eM1A, 0x100)
336 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
337 {
338 Offset (0x84),
339 PSAT, 32
340 }
341
342 Method (_DIS, 0x0, NotSerialized)
343 {
344 //Adding dummy disable methods for device EMM0
345 }
346
347 Device (EM45)
348 {
349 Name (_ADR, 0x00000008) // Slot 0, Function 8
350 Method (_RMV, 0, NotSerialized)
351 {
352 Return (0x0)
353 }
354 }
355 }
356
357
358 //
359 // SDIO
360 //
361 Device(SDHB)
362 {
363 Name (_ADR, 0)
364 Name (_HID, "INT33BB")
365 Name (_CID, "PNP0D40")
366 Name (_DDN, "Intel(R) SDIO Controller - 80860F15")
367 Name (_UID, 2)
368 Name (_HRV, 2)
369 Name(_DEP, Package(0x01)
370 {
371 PEPD
372 })
373 Name (PSTS, 0x0)
374
375 Name (RBUF, ResourceTemplate ()
376 {
377 Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0)
378 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {46} // SDIO IRQ
379 })
380
381 Method (_CRS, 0x0, NotSerialized)
382 {
383
384 CreateDwordField(^RBUF, ^BAR0._BAS, B0BA)
385 CreateDwordField(^RBUF, ^BAR0._LEN, B0LN)
386 Store(SI0A, B0BA)
387 Store(SI0L, B0LN)
388 Return (RBUF)
389 }
390 Method (_STA, 0x0, NotSerialized)
391 {
392 If (LLessEqual(STEP, 0x04))
393 {
394 //A stepping
395 Store(SDMD, _HRV)
396 }
397
398 //
399 // PCIM>> 0:ACPI mode 1:PCI mode
400 //
401 If (LEqual(PCIM, 1)) {
402 Return (0x0)
403 }
404
405 If (LOr(LEqual(SI0A, 0), LEqual(SD2D, 1)))
406 {
407 Return (0x0)
408 }
409 Return (0xF)
410 }
411 Method (_DIS, 0x0, NotSerialized)
412 {
413 //Adding dummy disable methods for device EMM0
414 }
415
416 Method (_PS3, 0, NotSerialized)
417 {
418 OR(PSAT, 0x00000003, PSAT)
419 OR(PSAT, 0X00000000, PSAT)
420 }
421 Method (_PS0, 0, NotSerialized)
422 {
423 And(PSAT, 0xfffffffC, PSAT)
424 OR(PSAT, 0X00000000, PSAT)
425
426 if(LEqual(\_SB.SDHB.PSTS,0x0))
427 {
428 if(LEqual (\_SB.GPO2.AVBL, 1))
429 {
430 Store( 0x01, \_SB.GPO2.WFD3 ) // WL_WIFI_REQ_ON = 1 put the device to normal state
431 Store( 0x01, \_SB.SDHB.PSTS) // indicates that the device powered ON
432 }
433 }
434
435
436 }
437 OperationRegion (KEYS, SystemMemory, SI1A, 0x100)
438 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
439 {
440 Offset (0x84),
441 PSAT, 32
442 }
443
444
445 Device (BRCM)
446 {
447 Name (_ADR, 0x01) //SlotNumber + Function
448 Name (_DEP, Package() {\_SB.GPO2})
449
450 Method (_RMV, 0, NotSerialized)
451 {
452 Return (0x0)
453 }
454 Name (_PRW, Package() {0, 0})
455 Name (_S4W, 2)
456
457 Method (_CRS, 0, Serialized)
458 {
459 Name (RBUF, ResourceTemplate ()
460 {
461 Interrupt (ResourceConsumer, Edge, ActiveHigh, ExclusiveAndWake, , , ) {73}
462 })
463 Return (RBUF)
464 }
465
466 Method (_PS3, 0, NotSerialized)
467 {
468 if(LEqual (\_SB.GPO2.AVBL, 1))
469 {
470 Store( 0x00, \_SB.GPO2.WFD3 ) // WL_WIFI_REQ_ON = 0 puts the device in reset state
471 Store( 0x00, \_SB.SDHB.PSTS) //Indicates that the device is powered off
472 }
473
474 }
475 Method (_PS0, 0, NotSerialized)
476 {
477 if(LEqual(\_SB.SDHB.PSTS,0x0))
478 {
479 if(LEqual (\_SB.GPO2.AVBL, 1))
480 {
481 Store( 0x01, \_SB.GPO2.WFD3 ) // WL_WIFI_REQ_ON = 1 put the device to normal state
482 Store( 0x01, \_SB.SDHB.PSTS) // indicates that the device powered ON
483 }
484 }
485 }
486 } // Device (BRCM)
487 //
488 // Secondary Broadcom WIFI function
489 //
490 Device(BRC2)
491 {
492 Name(_ADR, 0x2) // function 2
493 Name(_STA, 0xf)
494 //
495 // The device is not removable. This must be a method.
496 //
497 Method(_RMV, 0x0, NotSerialized)
498 {
499 Return(0x0)
500 }
501
502 //
503 // Describe a vendor-defined connection between this device and the
504 // primary wifi device
505 //
506
507 Method(_CRS)
508 {
509 Name(NAM, Buffer() {"\\_SB.SDHB.BRCM"})
510 Name(SPB, Buffer()
511 {
512 0x8E, // SPB Descriptor
513 0x18, 0x00, // Length including NAM above
514 0x01, // +0x00 SPB Descriptor Revision
515 0x00, // +0x01 Resource Source Index
516 0xc0, // +0x02 Bus type - vendor defined
517 0x02, // +0x03 Consumer + controller initiated
518 0x00, 0x00, // +0x04 Type specific flags
519 0x01, // +0x06 Type specific revision
520 0x00, 0x00 // +0x07 type specific data length
521 // +0x09 - 0xf bytes for NULL-terminated NAM
522 // Length = 0x18
523 })
524
525 Name(END, Buffer() {0x79, 0x00})
526 Concatenate(SPB, NAM, Local0)
527 Concatenate(Local0, END, Local1)
528 Return(Local1)
529 }
530 }
531
532 }
533
534 //
535 // SD Card
536 //
537 Device(SDHC)
538 {
539 Name (_ADR, 0)
540 Name (_HID, "80860F16")
541 Name (_CID, "PNP0D40")
542 Name (_DDN, "Intel(R) SD Card Controller - 80860F16")
543 Name (_UID, 3)
544 Name(_DEP, Package(0x01)
545 {
546 PEPD
547 })
548 Name (RBUF, ResourceTemplate ()
549 {
550 Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0)
551 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {47} // SD Card IRQ
552 })
553 Method (_CRS, 0x0, NotSerialized)
554 {
555 CreateDwordField(^RBUF, ^BAR0._BAS, B0BA)
556 CreateDwordField(^RBUF, ^BAR0._LEN, B0LN)
557 Store(SD0A, B0BA)
558 Store(SD0L, B0LN)
559 Return (RBUF)
560 }
561 Method (_STA, 0x0, NotSerialized)
562 {
563 //
564 // PCIM>> 0:ACPI mode 1:PCI mode
565 //
566 If (LEqual(PCIM, 1)) {
567 Return (0x0)
568 }
569
570 If (LOr(LEqual(SD0A, 0), LEqual(SD3D, 1)))
571 {
572 Return (0x0)
573 }
574 Return (0xF)
575 }
576
577 Method (_PS3, 0, NotSerialized)
578 {
579 OR(PSAT, 0x00000003, PSAT)
580 OR(PSAT, 0X00000000, PSAT)
581 }
582 Method (_PS0, 0, NotSerialized)
583 {
584 And(PSAT, 0xfffffffC, PSAT)
585 OR(PSAT, 0X00000000, PSAT)
586 }
587 OperationRegion (KEYS, SystemMemory, SD1A, 0x100)
588 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
589 {
590 Offset (0x84),
591 PSAT, 32
592 }
593
594 Device (CARD)
595 {
596 Name (_ADR, 0x00000008)
597 Method(_RMV, 0x0, NotSerialized)
598 {
599 // SDRM = 0 non-removable;
600 If (LEqual(SDRM, 0))
601 {
602 Return (0)
603 }
604
605 Return (1)
606 }
607 }
608
609 }
610