]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
Vlv2DeviceRefCodePkg: Fixed thermal issue.
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / AcpiTablesPCAT / THERMAL.ASL
1 /**************************************************************************;
2 ;* *;
3 ;* *;
4 ;* Intel Corporation - ACPI Reference Code for the Baytrail *;
5 ;* Family of Customer Reference Boards. *;
6 ;* *;
7 ;* *;
8 ;* Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved *;
9 ;
10 ; This program and the accompanying materials are licensed and made available under
11 ; the terms and conditions of the BSD License that accompanies this distribution.
12 ; The full text of the license may be found at
13 ; http://opensource.org/licenses/bsd-license.php.
14 ;
15 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 ;
18 ;* *;
19 ;* *;
20 ;**************************************************************************/
21
22
23 // THERMAL.ASL represents a Thermal Zone to be used for testing on the
24 // Customer Reference Boards.
25
26 External(\_SB.DPTF.CTOK, MethodObj)
27
28 Scope(\_TZ)
29 {
30
31 // Thermal Zone 1 = DTS Thermal Zone.
32
33 ThermalZone(TZ01)
34 {
35 // Return the temperature at which the OS must perform a Critcal
36 // Shutdown.
37
38 Method(_CRT,0,Serialized)
39 {
40 Return(Add(2732,Multiply(CRTT,10)))
41 }
42
43 // Notifies ASL Code the current cooling mode.
44 // 0 - Active cooling
45 // 1 - Passive cooling
46
47 Method(_SCP,1,Serialized)
48 {
49 Store(Arg0,CTYP)
50 }
51
52 // _TMP (Temperature)
53 //
54 // Return the highest of the CPU temperatures to the OS.
55 //
56 // Arguments: (0)
57 // None
58 // Return Value:
59 // An Integer containing the current temperature of the thermal zone (in tenths of degrees Kelvin)
60 //
61 Method(_TMP,0,Serialized)
62 {
63 If(DTSE)
64 {
65 If(LGreater(DTS2, DTS1))
66 {
67 Store(DTS2,Local0)
68 } else
69 {
70 Store(DTS1,Local0)
71 }
72 If (LEqual(And(Local0, 0x80), 0)) {
73 Return(Add(2732,Multiply(Local0,10)))
74 } else {
75 Add(Subtract(255, Local0), 1, Local0)
76 Return(Subtract(2732,Multiply(Local0,10)))
77 }
78 //
79 // Else return a static value if both EC and DTS are unavailable.
80 //
81 } Else
82 {
83 Return(3000) // (3000-2732)/10 = 26.8 degree C
84 }
85 }
86
87 // Return the Processor(s) used for Passive Cooling.
88
89 Method(_PSL,0,Serialized)
90 {
91 If(LEqual(MPEN, 4))
92 {
93 // CMP - Throttling controls all four logical CPUs.
94 Return(Package() {\_PR.CPU0,\_PR.CPU1,\_PR.CPU2,\_PR.CPU3})
95 }
96
97 If(MPEN)
98 {
99 // CMP - Throttling controls both CPUs.
100
101 Return(Package() {\_PR.CPU0,\_PR.CPU1})
102 }
103
104 Return(Package() {\_PR.CPU0})
105 }
106
107 // Returns the temperature at which the OS initiates CPU throttling.
108
109 Method(_PSV,0,Serialized)
110 {
111 Return(Add(2732,Multiply(PSVT,10)))
112 }
113
114 // Returns TC1 value used in the passive cooling formula.
115
116 Method(_TC1,0,Serialized)
117 {
118 Return(TC1V)
119 }
120
121 // Returns TC2 value used in the passive cooling formula.
122
123 Method(_TC2,0,Serialized)
124 {
125 Return(TC2V)
126 }
127
128 // Returns the sampling period used in the passive cooling formula.
129
130 Method(_TSP,0,Serialized)
131 {
132 Return(TSPV)
133 }
134
135 // Returns Hot Temperature
136
137 Method(_HOT,0,Serialized)
138 {
139 Subtract(CRTT, 5, Local0)
140 Return(Add(2732,Multiply(Local0,10)))
141 }
142 }
143 }