]>
Commit | Line | Data |
---|---|---|
3cbfba02 DW |
1 | /**************************************************************************;\r |
2 | ;* *;\r | |
3 | ;* *;\r | |
4 | ;* Intel Corporation - ACPI Reference Code for the Baytrail *;\r | |
5 | ;* Family of Customer Reference Boards. *;\r | |
6 | ;* *;\r | |
7 | ;* *;\r | |
8 | ;* Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved *;\r | |
9 | ;\r | |
7ede8060 | 10 | ; SPDX-License-Identifier: BSD-2-Clause-Patent\r |
3cbfba02 DW |
11 | ;\r |
12 | ;* *;\r | |
13 | ;* *;\r | |
14 | ;**************************************************************************/\r | |
15 | \r | |
16 | \r | |
17 | // Define the following External variables to prevent a WARNING when\r | |
18 | // using ASL.EXE and an ERROR when using IASL.EXE.\r | |
19 | \r | |
20 | External(PDC0)\r | |
21 | External(PDC1)\r | |
22 | External(PDC2)\r | |
23 | External(PDC3)\r | |
24 | External(CFGD)\r | |
25 | External(\_PR.CPU0._PPC, IntObj)\r | |
26 | External(\_SB.PCI0.LPCB.TPM.PTS, MethodObj)\r | |
27 | External(\_SB.STR3, DeviceObj)\r | |
28 | External(\_SB.I2C1.BATC, DeviceObj)\r | |
29 | External(\_SB.DPTF, DeviceObj)\r | |
30 | External(\_SB.TCHG, DeviceObj)\r | |
31 | External(\_SB.IAOE.PTSL)\r | |
32 | External(\_SB.IAOE.WKRS)\r | |
33 | \r | |
34 | //\r | |
35 | // Create a Global MUTEX.\r | |
36 | //\r | |
37 | Mutex(MUTX,0)\r | |
38 | \r | |
39 | \r | |
40 | \r | |
41 | // Port 80h Update:\r | |
42 | // Update 8 bits of the 32-bit Port 80h.\r | |
43 | //\r | |
44 | // Arguments:\r | |
45 | // Arg0: 0 = Write Port 80h, Bits 7:0 Only.\r | |
46 | // 1 = Write Port 80h, Bits 15:8 Only.\r | |
47 | // 2 = Write Port 80h, Bits 23:16 Only.\r | |
48 | // 3 = Write Port 80h, Bits 31:24 Only.\r | |
49 | // Arg1: 8-bit Value to write\r | |
50 | //\r | |
51 | // Return Value:\r | |
52 | // None\r | |
53 | \r | |
54 | Method(P8XH,2,Serialized)\r | |
55 | {\r | |
56 | If(LEqual(Arg0,0)) // Write Port 80h, Bits 7:0.\r | |
57 | {\r | |
58 | Store(Or(And(P80D,0xFFFFFF00),Arg1),P80D)\r | |
59 | }\r | |
60 | \r | |
61 | If(LEqual(Arg0,1)) // Write Port 80h, Bits 15:8.\r | |
62 | {\r | |
63 | Store(Or(And(P80D,0xFFFF00FF),ShiftLeft(Arg1,8)),P80D)\r | |
64 | }\r | |
65 | \r | |
66 | If(LEqual(Arg0,2)) // Write Port 80h, Bits 23:16.\r | |
67 | {\r | |
68 | Store(Or(And(P80D,0xFF00FFFF),ShiftLeft(Arg1,16)),P80D)\r | |
69 | }\r | |
70 | \r | |
71 | If(LEqual(Arg0,3)) // Write Port 80h, Bits 31:24.\r | |
72 | {\r | |
73 | Store(Or(And(P80D,0x00FFFFFF),ShiftLeft(Arg1,24)),P80D)\r | |
74 | }\r | |
75 | \r | |
76 | }\r | |
77 | \r | |
78 | //\r | |
79 | // Define SW SMI port as an ACPI Operating Region to use for generate SW SMI.\r | |
80 | //\r | |
81 | OperationRegion (SPRT, SystemIO, 0xB2, 2)\r | |
82 | Field (SPRT, ByteAcc, Lock, Preserve)\r | |
83 | {\r | |
84 | SSMP, 8\r | |
85 | }\r | |
86 | \r | |
87 | // The _PIC Control Method is optional for ACPI design. It allows the\r | |
88 | // OS to inform the ASL code which interrupt controller is being used,\r | |
89 | // the 8259 or APIC. The reference code in this document will address\r | |
90 | // PCI IRQ Routing and resource allocation for both cases.\r | |
91 | //\r | |
92 | // The values passed into _PIC are:\r | |
93 | // 0 = 8259\r | |
94 | // 1 = IOAPIC\r | |
95 | \r | |
96 | Method(\_PIC,1)\r | |
97 | {\r | |
98 | Store(Arg0,GPIC)\r | |
99 | Store(Arg0,PICM)\r | |
100 | }\r | |
101 | \r | |
102 | OperationRegion(SWC0, SystemIO, 0x610, 0x0F)\r | |
103 | Field(SWC0, ByteAcc, NoLock, Preserve)\r | |
104 | {\r | |
105 | G1S, 8, //SWC GPE1_STS\r | |
106 | Offset(0x4),\r | |
107 | G1E, 8,\r | |
108 | Offset(0xA),\r | |
109 | G1S2, 8, //SWC GPE1_STS_2\r | |
110 | G1S3, 8 //SWC GPE1_STS_3\r | |
111 | }\r | |
112 | \r | |
113 | OperationRegion (SWC1, SystemIO, \PMBS, 0x2C)\r | |
114 | Field(SWC1, DWordAcc, NoLock, Preserve)\r | |
115 | {\r | |
116 | Offset(0x20),\r | |
117 | G0S, 32, //GPE0_STS\r | |
118 | Offset(0x28),\r | |
119 | G0EN, 32 //GPE0_EN\r | |
120 | }\r | |
121 | \r | |
122 | // Prepare to Sleep. The hook is called when the OS is about to\r | |
123 | // enter a sleep state. The argument passed is the numeric value of\r | |
124 | // the Sx state.\r | |
125 | \r | |
126 | Method(_PTS,1)\r | |
127 | {\r | |
128 | Store(0,P80D) // Zero out the entire Port 80h DWord.\r | |
129 | P8XH(0,Arg0) // Output Sleep State to Port 80h, Byte 0.\r | |
130 | \r | |
131 | //clear the 3 SWC status bits\r | |
132 | Store(Ones, G1S3)\r | |
133 | Store(Ones, G1S2)\r | |
134 | Store(1, G1S)\r | |
135 | \r | |
136 | //set SWC GPE1_EN\r | |
137 | Store(1,G1E)\r | |
138 | \r | |
139 | //clear GPE0_STS\r | |
140 | Store(Ones, G0S)\r | |
141 | \r | |
142 | \r | |
143 | If(LEqual(Arg0,3)) // If S3 Suspend\r | |
144 | {\r | |
145 | //\r | |
146 | // Disable Digital Thermal Sensor function when doing S3 suspend\r | |
147 | //\r | |
148 | If(CondRefOf(DTSE))\r | |
149 | {\r | |
150 | If(LGreaterEqual(DTSE, 0x01))\r | |
151 | {\r | |
152 | Store(30, DTSF) // DISABLE_UPDATE_DTS_EVERY_SMI\r | |
153 | Store(0xD0, SSMP) // DTS SW SMI\r | |
154 | }\r | |
155 | }\r | |
156 | }\r | |
157 | }\r | |
158 | \r | |
159 | // Wake. This hook is called when the OS is about to wake from a\r | |
160 | // sleep state. The argument passed is the numeric value of the\r | |
161 | // sleep state the system is waking from.\r | |
162 | Method(_WAK,1,Serialized)\r | |
163 | {\r | |
164 | P8XH(1,0xAB) // Beginning of _WAK.\r | |
165 | \r | |
166 | Notify(\_SB.PWRB,0x02)\r | |
167 | \r | |
168 | If(NEXP)\r | |
169 | {\r | |
170 | // Reinitialize the Native PCI Express after resume\r | |
171 | If(And(OSCC,0x02))\r | |
172 | {\r | |
173 | \_SB.PCI0.NHPG()\r | |
174 | }\r | |
175 | \r | |
176 | If(And(OSCC,0x04)) // PME control granted?\r | |
177 | {\r | |
178 | \_SB.PCI0.NPME()\r | |
179 | }\r | |
180 | }\r | |
181 | \r | |
182 | If(LOr(LEqual(Arg0,3), LEqual(Arg0,4))) // If S3 or S4 Resume\r | |
183 | {\r | |
184 | \r | |
185 | \r | |
186 | // If CMP is enabled, we may need to restore the C-State and/or\r | |
187 | // P-State configuration, as it may have been saved before the\r | |
188 | // configuration was finalized based on OS/driver support.\r | |
189 | //\r | |
190 | // CFGD[24] = Two or more cores enabled\r | |
191 | //\r | |
192 | If(And(CFGD,0x01000000))\r | |
193 | {\r | |
194 | //\r | |
195 | // If CMP and the OSYS is WinXP SP1, we will enable C1-SMI if\r | |
196 | // C-States are enabled.\r | |
197 | //\r | |
198 | // CFGD[7:4] = C4, C3, C2, C1 Capable/Enabled\r | |
199 | //\r | |
200 | //\r | |
201 | }\r | |
202 | \r | |
203 | // Windows XP SP2 does not properly restore the P-State\r | |
204 | // upon resume from S4 or S3 with degrade modes enabled.\r | |
205 | // Use the existing _PPC methods to cycle the available\r | |
206 | // P-States such that the processor ends up running at\r | |
207 | // the proper P-State.\r | |
208 | //\r | |
209 | // Note: For S4, another possible W/A is to always boot\r | |
210 | // the system in LFM.\r | |
211 | //\r | |
212 | If(LEqual(OSYS,2002))\r | |
213 | {\r | |
214 | If(And(CFGD,0x01))\r | |
215 | {\r | |
216 | If(LGreater(\_PR.CPU0._PPC,0))\r | |
217 | {\r | |
218 | Subtract(\_PR.CPU0._PPC,1,\_PR.CPU0._PPC)\r | |
219 | PNOT()\r | |
220 | Add(\_PR.CPU0._PPC,1,\_PR.CPU0._PPC)\r | |
221 | PNOT()\r | |
222 | }\r | |
223 | Else\r | |
224 | {\r | |
225 | Add(\_PR.CPU0._PPC,1,\_PR.CPU0._PPC)\r | |
226 | PNOT()\r | |
227 | Subtract(\_PR.CPU0._PPC,1,\_PR.CPU0._PPC)\r | |
228 | PNOT()\r | |
229 | }\r | |
230 | }\r | |
231 | }\r | |
232 | }\r | |
233 | Return(Package() {0,0})\r | |
234 | }\r | |
235 | \r | |
236 | // Power Notification:\r | |
237 | // Perform all needed OS notifications during a\r | |
238 | // Power Switch.\r | |
239 | //\r | |
240 | // Arguments:\r | |
241 | // None\r | |
242 | //\r | |
243 | // Return Value:\r | |
244 | // None\r | |
245 | \r | |
246 | Method(PNOT,0,Serialized)\r | |
247 | {\r | |
248 | // If MP enabled and driver support is present, notify all\r | |
249 | // processors.\r | |
250 | \r | |
251 | If(MPEN)\r | |
252 | {\r | |
253 | If(And(PDC0,0x0008))\r | |
254 | {\r | |
255 | Notify(\_PR.CPU0,0x80) // Eval CPU0 _PPC.\r | |
256 | \r | |
257 | If(And(PDC0,0x0010))\r | |
258 | {\r | |
259 | Sleep(100)\r | |
260 | Notify(\_PR.CPU0,0x81) // Eval _CST.\r | |
261 | }\r | |
262 | }\r | |
263 | \r | |
264 | If(And(PDC1,0x0008))\r | |
265 | {\r | |
266 | Notify(\_PR.CPU1,0x80) // Eval CPU1 _PPC.\r | |
267 | \r | |
268 | If(And(PDC1,0x0010))\r | |
269 | {\r | |
270 | Sleep(100)\r | |
271 | Notify(\_PR.CPU1,0x81) // Eval _CST.\r | |
272 | }\r | |
273 | }\r | |
274 | \r | |
275 | If(And(PDC2,0x0008))\r | |
276 | {\r | |
277 | Notify(\_PR.CPU2,0x80) // Eval CPU2 _PPC.\r | |
278 | \r | |
279 | If(And(PDC2,0x0010))\r | |
280 | {\r | |
281 | Sleep(100)\r | |
282 | Notify(\_PR.CPU2,0x81) // Eval _CST.\r | |
283 | }\r | |
284 | }\r | |
285 | \r | |
286 | If(And(PDC3,0x0008))\r | |
287 | {\r | |
288 | Notify(\_PR.CPU3,0x80) // Eval CPU3 _PPC.\r | |
289 | \r | |
290 | If(And(PDC3,0x0010))\r | |
291 | {\r | |
292 | Sleep(100)\r | |
293 | Notify(\_PR.CPU3,0x81) // Eval _CST.\r | |
294 | }\r | |
295 | }\r | |
296 | }\r | |
297 | Else\r | |
298 | {\r | |
299 | Notify(\_PR.CPU0,0x80) // Eval _PPC.\r | |
300 | Sleep(100)\r | |
301 | Notify(\_PR.CPU0,0x81) // Eval _CST\r | |
302 | }\r | |
303 | }\r | |
304 | \r | |
305 | //\r | |
306 | // System Bus\r | |
307 | //\r | |
308 | Scope(\_SB)\r | |
309 | {\r | |
310 | Name(CRTT, 110) // Processor critical temperature\r | |
311 | Name(ACTT, 77) // Active temperature limit for processor participant\r | |
312 | Name(GCR0, 70) // Critical temperature for Generic participant 0 in degree celsius\r | |
313 | Name(GCR1, 70) // Critical temperature for Generic participant 1 in degree celsius\r | |
314 | Name(GCR2, 70) // Critical temperature for Generic participant 2 in degree celsius\r | |
315 | Name(GCR3, 70) // Critical temperature for Generic participant 3 in degree celsius\r | |
316 | Name(GCR4, 70) // Critical temperature for Generic participant 4 in degree celsius\r | |
317 | Name(GCR5, 70) // Critical temperature for Generic participant 5 in degree celsius\r | |
318 | Name(GCR6, 70) // Critical temperature for Generic participant 6 in degree celsius\r | |
319 | Name(PST0, 60) // Passive temperature limit for Generic Participant 0 in degree celsius\r | |
320 | Name(PST1, 60) // Passive temperature limit for Generic Participant 1 in degree celsius\r | |
321 | Name(PST2, 60) // Passive temperature limit for Generic Participant 2 in degree celsius\r | |
322 | Name(PST3, 60) // Passive temperature limit for Generic Participant 3 in degree celsius\r | |
323 | Name(PST4, 60) // Passive temperature limit for Generic Participant 4 in degree celsius\r | |
324 | Name(PST5, 60) // Passive temperature limit for Generic Participant 5 in degree celsius\r | |
325 | Name(PST6, 60) // Passive temperature limit for Generic Participant 6 in degree celsius\r | |
326 | Name(LPMV, 3)\r | |
327 | Name(PDBG, 0) // DPTF Super debug option\r | |
328 | Name(PDPM, 1) // DPTF DPPM enable\r | |
329 | Name(PDBP, 1) // DPTF DBPT enable (dynamic battery protection technology)\r | |
330 | Name(DLPO, Package()\r | |
331 | {\r | |
332 | 0x1, // Revision\r | |
333 | 0x1, // LPO Enable\r | |
334 | 0x1, // LPO StartPState\r | |
335 | 25, // LPO StepSize\r | |
336 | 0x1, //\r | |
337 | 0x1, //\r | |
338 | })\r | |
339 | Name(BRQD, 0x00) // This is used to determine if DPTF display participant requested Brightness level change\r | |
340 | // or it is from Graphics driver. Value of 1 is for DPTF else it is 0\r | |
341 | \r | |
342 | Method(_INI,0)\r | |
343 | {\r | |
344 | // NVS has stale DTS data. Get and update the values\r | |
345 | // with current temperatures. Note that this will also\r | |
346 | // re-arm any AP Thermal Interrupts.\r | |
347 | // Read temperature settings from global NVS\r | |
348 | Store(DPCT, CRTT)\r | |
349 | Store(Subtract(DPPT, 8), ACTT) // Active Trip point = Passive trip point - 8\r | |
350 | Store(DGC0, GCR0)\r | |
351 | Store(DGC0, GCR1)\r | |
352 | Store(DGC1, GCR2)\r | |
353 | Store(DGC1, GCR3)\r | |
354 | Store(DGC1, GCR4)\r | |
355 | Store(DGC2, GCR5)\r | |
356 | Store(DGC2, GCR6)\r | |
357 | Store(DGP0, PST0)\r | |
358 | Store(DGP0, PST1)\r | |
359 | Store(DGP1, PST2)\r | |
360 | Store(DGP1, PST3)\r | |
361 | Store(DGP1, PST4)\r | |
362 | Store(DGP2, PST5)\r | |
363 | Store(DGP2, PST6)\r | |
364 | // Read Current low power mode setting from global NVS\r | |
365 | Store(DLPM, LPMV)\r | |
366 | \r | |
367 | \r | |
368 | // Update DPTF Super Debug option\r | |
369 | Store(DDBG, PDBG)\r | |
370 | \r | |
371 | \r | |
372 | // Update DPTF LPO Options\r | |
373 | Store(LPOE, Index(DLPO,1))\r | |
374 | Store(LPPS, Index(DLPO,2))\r | |
375 | Store(LPST, Index(DLPO,3))\r | |
376 | Store(LPPC, Index(DLPO,4))\r | |
377 | Store(LPPF, Index(DLPO,5))\r | |
378 | Store(DPME, PDPM)\r | |
379 | }\r | |
380 | \r | |
381 | // Define a (Control Method) Power Button.\r | |
382 | Device(PWRB)\r | |
383 | {\r | |
384 | Name(_HID,EISAID("PNP0C0C"))\r | |
385 | \r | |
386 | // GPI_SUS0 = GPE16 = Waketime SCI. The PRW isn't working when\r | |
387 | // placed in any of the logical locations ( PS2K, PS2M),\r | |
388 | // so a Power Button Device was created specifically\r | |
389 | // for the WAKETIME_SCI PRW.\r | |
390 | \r | |
391 | Name(_PRW, Package() {16,4})\r | |
392 | }\r | |
393 | \r | |
394 | Device(SLPB)\r | |
395 | {\r | |
396 | Name(_HID, EISAID("PNP0C0E"))\r | |
397 | } // END SLPB\r | |
398 | \r | |
399 | Scope(PCI0)\r | |
400 | {\r | |
401 | Method(_INI,0)\r | |
402 | {\r | |
403 | // Determine the OS and store the value, where:\r | |
404 | //\r | |
405 | // OSYS = 2009 = Windows 7 and Windows Server 2008 R2.\r | |
406 | // OSYS = 2012 = Windows 8 and Windows Server 2012.\r | |
407 | //\r | |
408 | // Assume Windows 7 at a minimum.\r | |
409 | \r | |
410 | Store(2009,OSYS)\r | |
411 | \r | |
412 | // Check for a specific OS which supports _OSI.\r | |
413 | \r | |
414 | If(CondRefOf(\_OSI,Local0))\r | |
415 | {\r | |
416 | // Linux returns _OSI = TRUE for numerous Windows\r | |
417 | // strings so that it is fully compatible with\r | |
418 | // BIOSes available in the market today. There are\r | |
419 | // currently 2 known exceptions to this model:\r | |
420 | // 1) Video Repost - Linux supports S3 without\r | |
421 | // requireing a Driver, meaning a Video\r | |
422 | // Repost will be required.\r | |
423 | // 2) On-Screen Branding - a full CMT Logo\r | |
424 | // is limited to the WIN2K and WINXP\r | |
425 | // Operating Systems only.\r | |
426 | \r | |
427 | // Use OSYS for Windows Compatibility.\r | |
428 | If(\_OSI("Windows 2009")) // Windows 7 or Windows Server 2008 R2\r | |
429 | {\r | |
430 | Store(2009,OSYS)\r | |
431 | }\r | |
432 | If(\_OSI("Windows 2012")) // Windows 8 or Windows Server 2012\r | |
433 | {\r | |
434 | Store(2012,OSYS)\r | |
435 | }\r | |
436 | If(\_OSI("Windows 2013")) //Windows Blue\r | |
437 | {\r | |
438 | Store(2013,OSYS)\r | |
439 | }\r | |
440 | \r | |
441 | //\r | |
442 | // If CMP is enabled, enable SMM C-State\r | |
443 | // coordination. SMM C-State coordination\r | |
444 | // will be disabled in _PDC if driver support\r | |
445 | // for independent C-States deeper than C1\r | |
446 | // is indicated.\r | |
447 | }\r | |
448 | }\r | |
449 | \r | |
450 | Method(NHPG,0,Serialized)\r | |
451 | {\r | |
452 | \r | |
453 | }\r | |
454 | \r | |
455 | Method(NPME,0,Serialized)\r | |
456 | {\r | |
457 | \r | |
458 | }\r | |
459 | } // end Scope(PCI0)\r | |
460 | \r | |
461 | Device (GPED) //virtual GPIO device for ASL based AC/Battery/Expection notification\r | |
462 | {\r | |
463 | Name (_ADR, 0)\r | |
464 | Name (_HID, "INT0002")\r | |
465 | Name (_CID, "INT0002")\r | |
466 | Name (_DDN, "Virtual GPIO controller" )\r | |
467 | Name (_UID, 1)\r | |
468 | \r | |
469 | Method (_CRS, 0x0, Serialized)\r | |
470 | {\r | |
471 | Name (RBUF, ResourceTemplate ()\r | |
472 | {\r | |
473 | Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) {0x9} // Was 9\r | |
474 | })\r | |
475 | Return (RBUF)\r | |
476 | }\r | |
477 | \r | |
478 | Method (_STA, 0x0, NotSerialized)\r | |
479 | {\r | |
480 | Return(0x0)\r | |
481 | }\r | |
482 | \r | |
483 | Method (_AEI, 0x0, Serialized)\r | |
484 | {\r | |
485 | Name(RBUF, ResourceTemplate()\r | |
486 | {\r | |
487 | GpioInt(Edge, ActiveHigh, ExclusiveAndWake, PullDown,,"\\_SB.GPED",) {2} //pin 2\r | |
488 | })\r | |
489 | Return(RBUF)\r | |
490 | }\r | |
491 | \r | |
492 | Method(_E02) // _Exx method will be called when interrupt is raised\r | |
493 | {\r | |
494 | If (LEqual (PWBS, 1))\r | |
495 | {\r | |
496 | Store (1, PWBS) //Clear PowerButton Status\r | |
497 | }\r | |
498 | If (LEqual (PMEB, 1))\r | |
499 | {\r | |
500 | Store (1, PMEB) //Clear PME_B0_STS\r | |
501 | }\r | |
502 | If (LEqual (\_SB.PCI0.SATA.PMES, 1))\r | |
503 | {\r | |
504 | Store (1, \_SB.PCI0.SATA.PMES)\r | |
505 | Notify (\_SB.PCI0.SATA, 0x02)\r | |
506 | }\r | |
507 | //\r | |
508 | // eMMC 4.41\r | |
509 | //\r | |
510 | If (LAnd(LEqual (\_SB.PCI0.EM41.PMES, 1), LEqual(PCIM, 1)))\r | |
511 | {\r | |
512 | Store (1, \_SB.PCI0.EM41.PMES)\r | |
513 | Notify (\_SB.PCI0.EM41, 0x02)\r | |
514 | }\r | |
515 | \r | |
516 | //\r | |
517 | // eMMC 4.5\r | |
518 | //\r | |
519 | If (LAnd(LEqual (\_SB.PCI0.EM45.PMES, 1), LEqual(PCIM, 1)))\r | |
520 | {\r | |
521 | Store (1, \_SB.PCI0.EM45.PMES)\r | |
522 | Notify (\_SB.PCI0.EM45, 0x02)\r | |
523 | }\r | |
524 | \r | |
525 | If (LEqual(HDAD, 0))\r | |
526 | {\r | |
527 | If (LEqual (\_SB.PCI0.HDEF.PMES, 1))\r | |
528 | {\r | |
529 | Store (1, \_SB.PCI0.HDEF.PMES)\r | |
530 | Notify (\_SB.PCI0.HDEF, 0x02)\r | |
531 | }\r | |
532 | }\r | |
533 | \r | |
534 | If (LEqual (\_SB.PCI0.EHC1.PMES, 1))\r | |
535 | {\r | |
536 | Store (1, \_SB.PCI0.EHC1.PMES)\r | |
537 | Notify (\_SB.PCI0.EHC1, 0x02)\r | |
538 | }\r | |
539 | If (LEqual (\_SB.PCI0.XHC1.PMES, 1))\r | |
540 | {\r | |
541 | Store (1, \_SB.PCI0.XHC1.PMES)\r | |
542 | Notify (\_SB.PCI0.XHC1, 0x02)\r | |
543 | }\r | |
544 | If (LEqual (\_SB.PCI0.SEC0.PMES, 1))\r | |
545 | {\r | |
546 | Or (\_SB.PCI0.SEC0.PMES, Zero, \_SB.PCI0.SEC0.PMES)\r | |
547 | Notify (\_SB.PCI0.SEC0, 0x02)\r | |
548 | }\r | |
549 | }\r | |
550 | } // Device (GPED)\r | |
551 | \r | |
552 | //--------------------\r | |
553 | // GPIO\r | |
554 | //--------------------\r | |
555 | Device (GPO0)\r | |
556 | {\r | |
557 | Name (_ADR, 0)\r | |
558 | Name (_HID, "INT33FC")\r | |
559 | Name (_CID, "INT33B2")\r | |
560 | Name (_DDN, "ValleyView2 General Purpose Input/Output (GPIO) controller" )\r | |
561 | Name (_UID, 1)\r | |
562 | Method (_CRS, 0x0, Serialized)\r | |
563 | {\r | |
564 | Name (RBUF, ResourceTemplate ()\r | |
565 | {\r | |
566 | Memory32Fixed (ReadWrite, 0x0FED0C000, 0x00001000)\r | |
567 | Interrupt(ResourceConsumer, Level, ActiveLow, Shared, , , ) {49}\r | |
568 | \r | |
569 | })\r | |
570 | Return (RBUF)\r | |
571 | }\r | |
572 | \r | |
573 | Method (_STA, 0x0, NotSerialized)\r | |
574 | {\r | |
575 | //\r | |
576 | // GPO driver will report present if any of below New IO bus exist\r | |
577 | //\r | |
578 | If (LOr(LEqual(L11D, 0), LEqual(L12D, 0))) // LPIO1 PWM #1 or #2 exist\r | |
579 | { Return(0xF) }\r | |
580 | If (LOr(LEqual(L13D, 0), LEqual(L14D, 0))) // LPIO1 HS-UART #1 or #2 exist\r | |
581 | { Return(0xF) }\r | |
582 | If (LOr(LEqual(L15D, 0), LEqual(SD1D, 0))) // LPIO1 SPI or SCC SDIO #1 exist\r | |
583 | { Return(0xF) }\r | |
584 | If (LOr(LEqual(SD2D, 0), LEqual(SD3D, 0))) // SCC SDIO #2 or #3 exist\r | |
585 | { Return(0xF) }\r | |
586 | If (LOr(LEqual(L21D, 0), LEqual(L22D, 0))) // LPIO2 I2C #1 or #2 exist\r | |
587 | { Return(0xF) }\r | |
588 | If (LOr(LEqual(L23D, 0), LEqual(L24D, 0))) // LPIO2 I2C #3 or #4 exist\r | |
589 | { Return(0xF) }\r | |
590 | If (LOr(LEqual(L25D, 0), LEqual(L26D, 0))) // LPIO2 I2C #5 or #6 exist\r | |
591 | { Return(0xF) }\r | |
592 | If (LEqual(L27D, 0)) // LPIO2 I2C #7 exist\r | |
593 | { Return(0xF) }\r | |
594 | \r | |
595 | Return(0x0)\r | |
596 | }\r | |
597 | \r | |
598 | // Track status of GPIO OpRegion availability for this controller\r | |
599 | Name(AVBL, 0)\r | |
600 | Method(_REG,2)\r | |
601 | {\r | |
602 | If (Lequal(Arg0, 8))\r | |
603 | {\r | |
604 | Store(Arg1, ^AVBL)\r | |
605 | }\r | |
606 | }\r | |
607 | \r | |
608 | OperationRegion(GPOP, SystemIo, \GPBS, 0x50)\r | |
609 | Field(GPOP, ByteAcc, NoLock, Preserve) {\r | |
610 | Offset(0x28), // cfio_ioreg_SC_GP_LVL_63_32_ - [GPIO_BASE_ADDRESS] + 28h\r | |
611 | , 21,\r | |
612 | BTD3, 1, //This field is not used. Pin not defined in schematics. Closest is GPIO_S5_35 - COMBO_BT_WAKEUP\r | |
613 | Offset(0x48), // cfio_ioreg_SC_GP_LVL_95_64_ - [GPIO_BASE_ADDRESS] + 48h\r | |
614 | , 30,\r | |
615 | SHD3, 1 //GPIO_S0_SC_95 - SENS_HUB_RST_N\r | |
616 | }\r | |
617 | \r | |
618 | \r | |
619 | \r | |
620 | } // Device (GPO0)\r | |
621 | \r | |
622 | Device (GPO1)\r | |
623 | {\r | |
624 | Name (_ADR, 0)\r | |
625 | Name (_HID, "INT33FC")\r | |
626 | Name (_CID, "INT33B2")\r | |
627 | Name (_DDN, "ValleyView2 GPNCORE controller" )\r | |
628 | Name (_UID, 2)\r | |
629 | Method (_CRS, 0x0, Serialized)\r | |
630 | {\r | |
631 | Name (RBUF, ResourceTemplate ()\r | |
632 | {\r | |
633 | Memory32Fixed (ReadWrite, 0x0FED0D000, 0x00001000)\r | |
634 | Interrupt(ResourceConsumer, Level, ActiveLow, Shared, , , ) {48}\r | |
635 | })\r | |
636 | Return (RBUF)\r | |
637 | }\r | |
638 | \r | |
639 | Method (_STA, 0x0, NotSerialized)\r | |
640 | {\r | |
641 | Return(\_SB.GPO0._STA)\r | |
642 | }\r | |
643 | } // Device (GPO1)\r | |
644 | \r | |
645 | Device (GPO2)\r | |
646 | {\r | |
647 | Name (_ADR, 0)\r | |
648 | Name (_HID, "INT33FC")\r | |
649 | Name (_CID, "INT33B2")\r | |
650 | Name (_DDN, "ValleyView2 GPSUS controller" )\r | |
651 | Name (_UID, 3)\r | |
652 | Method (_CRS, 0x0, Serialized)\r | |
653 | {\r | |
654 | Name (RBUF, ResourceTemplate ()\r | |
655 | {\r | |
656 | Memory32Fixed (ReadWrite, 0x0FED0E000, 0x00001000)\r | |
657 | Interrupt(ResourceConsumer, Level, ActiveLow, Shared, , , ) {50}\r | |
658 | })\r | |
659 | Return (RBUF)\r | |
660 | }\r | |
661 | \r | |
662 | Method (_STA, 0x0, NotSerialized)\r | |
663 | {\r | |
664 | Return(^^GPO0._STA)\r | |
665 | }\r | |
666 | \r | |
667 | // Track status of GPIO OpRegion availability for this controller\r | |
668 | Name(AVBL, 0)\r | |
669 | Method(_REG,2)\r | |
670 | {\r | |
671 | If (Lequal(Arg0, 8))\r | |
672 | {\r | |
673 | Store(Arg1, ^AVBL)\r | |
674 | }\r | |
675 | }\r | |
676 | //Manipulate GPIO line using GPIO operation regions.\r | |
677 | Name (GMOD, ResourceTemplate () //One method of creating a Connection for OpRegion accesses in Field definitions\r | |
678 | {\r | |
679 | //is creating a named object that refers to the connection attributes\r | |
680 | GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly, "\\_SB.GPO2") {21} //sus 21+128 BT+WLAN_ENABLE\r | |
681 | })\r | |
682 | \r | |
683 | OperationRegion(GPOP, SystemIo, \GPBS, 0x100)\r | |
684 | Field(GPOP, ByteAcc, NoLock, Preserve) {\r | |
685 | Offset(0x88), // cfio_ioreg_SUS_GP_LVL_31_0_ - [GPIO_BASE_ADDRESS] + 88h\r | |
686 | , 20,\r | |
687 | WFD3, 1\r | |
688 | }\r | |
689 | \r | |
690 | \r | |
691 | } // Device (GPO2)\r | |
692 | include ("PchScc.asl")\r | |
693 | include ("PchLpss.asl")\r | |
694 | \r | |
695 | Scope(I2C7)\r | |
696 | {\r | |
697 | \r | |
698 | } //End Scope(I2C7)\r | |
699 | \r | |
3cbfba02 DW |
700 | } // end Scope(\_SB)\r |
701 | \r | |
702 | Name(PICM, 0) // Global Name, returns current Interrupt controller mode; updated from _PIC control method\r | |
703 | \r |