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