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