]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/THERMAL.ASL
Vlv2DeviceRefCodePkg: Replace BSD License with BSD+Patent License
[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 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// THERMAL.ASL represents a Thermal Zone to be used for testing on the\r
18// Customer Reference Boards.\r
19\r
20External(\_SB.DPTF.CTOK, MethodObj)\r
21\r
22Scope(\_TZ)\r
23{\r
24\r
25 // Thermal Zone 1 = DTS Thermal Zone.\r
26\r
27 ThermalZone(TZ01)\r
28 {\r
29 // Return the temperature at which the OS must perform a Critcal\r
30 // Shutdown.\r
31\r
32 Method(_CRT,0,Serialized)\r
33 {\r
34 Return(Add(2732,Multiply(CRTT,10)))\r
35 }\r
36\r
37 // Notifies ASL Code the current cooling mode.\r
38 // 0 - Active cooling\r
39 // 1 - Passive cooling\r
40\r
41 Method(_SCP,1,Serialized)\r
42 {\r
43 Store(Arg0,CTYP)\r
44 }\r
45\r
46 // _TMP (Temperature)\r
47 //\r
48 // Return the highest of the CPU temperatures to the OS.\r
49 //\r
50 // Arguments: (0)\r
51 // None\r
52 // Return Value:\r
53 // An Integer containing the current temperature of the thermal zone (in tenths of degrees Kelvin)\r
54 //\r
55 Method(_TMP,0,Serialized)\r
56 {\r
57 If(DTSE)\r
58 {\r
59 If(LGreater(DTS2, DTS1))\r
60 {\r
61 Store(DTS2,Local0)\r
62 } else\r
63 {\r
64 Store(DTS1,Local0)\r
65 }\r
cc204110 66 If (LEqual(And(Local0, 0x80), 0)) {\r
67 Return(Add(2732,Multiply(Local0,10)))\r
68 } else {\r
69 Add(Subtract(255, Local0), 1, Local0)\r
70 Return(Subtract(2732,Multiply(Local0,10)))\r
71 }\r
3cbfba02
DW
72 //\r
73 // Else return a static value if both EC and DTS are unavailable.\r
74 //\r
75 } Else\r
76 {\r
77 Return(3000) // (3000-2732)/10 = 26.8 degree C\r
78 }\r
79 }\r
80\r
81 // Return the Processor(s) used for Passive Cooling.\r
82\r
83 Method(_PSL,0,Serialized)\r
84 {\r
85 If(LEqual(MPEN, 4))\r
86 {\r
87 // CMP - Throttling controls all four logical CPUs.\r
88 Return(Package() {\_PR.CPU0,\_PR.CPU1,\_PR.CPU2,\_PR.CPU3})\r
89 }\r
90\r
91 If(MPEN)\r
92 {\r
93 // CMP - Throttling controls both CPUs.\r
94\r
95 Return(Package() {\_PR.CPU0,\_PR.CPU1})\r
96 }\r
97\r
98 Return(Package() {\_PR.CPU0})\r
99 }\r
100\r
101 // Returns the temperature at which the OS initiates CPU throttling.\r
102\r
103 Method(_PSV,0,Serialized)\r
104 {\r
105 Return(Add(2732,Multiply(PSVT,10)))\r
106 }\r
107\r
108 // Returns TC1 value used in the passive cooling formula.\r
109\r
110 Method(_TC1,0,Serialized)\r
111 {\r
112 Return(TC1V)\r
113 }\r
114\r
115 // Returns TC2 value used in the passive cooling formula.\r
116\r
117 Method(_TC2,0,Serialized)\r
118 {\r
119 Return(TC2V)\r
120 }\r
121\r
122 // Returns the sampling period used in the passive cooling formula.\r
123\r
124 Method(_TSP,0,Serialized)\r
125 {\r
126 Return(TSPV)\r
127 }\r
128\r
129 // Returns Hot Temperature\r
130\r
131 Method(_HOT,0,Serialized)\r
132 {\r
133 Subtract(CRTT, 5, Local0)\r
134 Return(Add(2732,Multiply(Local0,10)))\r
135 }\r
136 }\r
137}\r