soc/intel/ptl: Update ME specification version to 21
[coreboot.git] / src / mainboard / google / link / acpi / thermal.asl
blobdf174d3092e139b71439381110fb3ef718e7c989
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 // Thermal Zone
5 External (\PPKG, MethodObj)
7 #define HAVE_THERMALZONE
8 Scope (\_TZ)
10         ThermalZone (CRIT)
11         {
12                 // Thermal zone polling frequency: 5 seconds
13                 Name (_TZP, 50)
15                 // Convert from Degrees C to 1/10 Kelvin for ACPI
16                 Method (CTOK, 1) {
17                         // 10th of Degrees C
18                         Local0 = Arg0 * 10
20                         // Convert to Kelvin
21                         Local0 += 2732
23                         Return (Local0)
24                 }
26                 // Threshold for OS to shutdown
27                 Method (_CRT, 0, Serialized)
28                 {
29                         Return (CTOK (\TCRT))
30                 }
32                 Method (_TMP, 0, Serialized)
33                 {
34                         // Get CPU Temperature from TIN9/PECI via EC
35                         Local0 = \_SB.PCI0.LPCB.EC0.TIN9
37                         // Check for sensor not calibrated
38                         If (Local0 == \_SB.PCI0.LPCB.EC0.TNCA) {
39                                 Return (CTOK(0))
40                         }
42                         // Check for sensor not present
43                         If (Local0 == \_SB.PCI0.LPCB.EC0.TNPR) {
44                                 Return (CTOK(0))
45                         }
47                         // Check for sensor not powered
48                         If (Local0 == \_SB.PCI0.LPCB.EC0.TNOP) {
49                                 Return (CTOK(0))
50                         }
52                         // Check for sensor bad reading
53                         If (Local0 == \_SB.PCI0.LPCB.EC0.TBAD) {
54                                 Return (CTOK(0))
55                         }
57                         // Adjust by offset to get Kelvin
58                         Local0 += \_SB.PCI0.LPCB.EC0.TOFS
60                         // Convert to 1/10 Kelvin
61                         Local0 *= 10
62                         Return (Local0)
63                 }
64         }
66         ThermalZone (THRM)
67         {
68                 Name (_TC1, 0x02)
69                 Name (_TC2, 0x05)
71                 // Thermal zone polling frequency: 10 seconds
72                 Name (_TZP, 100)
74                 // Thermal sampling period for passive cooling: 2 seconds
75                 Name (_TSP, 20)
77                 // Convert from Degrees C to 1/10 Kelvin for ACPI
78                 Method (CTOK, 1) {
79                         // 10th of Degrees C
80                         Local0 = Arg0 * 10
82                         // Convert to Kelvin
83                         Local0 += 2732
85                         Return (Local0)
86                 }
88                 // Threshold for OS to shutdown
89                 Method (_CRT, 0, Serialized)
90                 {
91                         Return (CTOK (\TCRT))
92                 }
94                 // Threshold for passive cooling
95                 Method (_PSV, 0, Serialized)
96                 {
97                         Return (CTOK (\TPSV))
98                 }
100                 // Processors used for passive cooling
101                 Method (_PSL, 0, Serialized)
102                 {
103                         Return (\PPKG ())
104                 }
106                 Method (_TMP, 0, Serialized)
107                 {
108                         // Get Temperature from TIN# set in NVS
109                         Local0 = \_SB.PCI0.LPCB.EC0.TINS (TMPS)
111                         // Check for sensor not present
112                         If (Local0 == \_SB.PCI0.LPCB.EC0.TNPR) {
113                                 Return (CTOK(0))
114                         }
116                         // Check for sensor not powered
117                         If (Local0 == \_SB.PCI0.LPCB.EC0.TNOP) {
118                                 Return (CTOK(0))
119                         }
121                         // Check for sensor bad reading
122                         If (Local0 == \_SB.PCI0.LPCB.EC0.TBAD) {
123                                 Return (CTOK(0))
124                         }
126                         // Adjust by offset to get Kelvin
127                         Local0 += \_SB.PCI0.LPCB.EC0.TOFS
129                         // Convert to 1/10 Kelvin
130                         Local0 *= 10
131                         Return (Local0)
132                 }
134                 /* CTDP Down */
135                 Method (_AC0) {
136                         If (\FLVL <= 0) {
137                                 Return (CTOK (\F0OF))
138                         } Else {
139                                 Return (CTOK (\F0ON))
140                         }
141                 }
143                 /* CTDP Nominal */
144                 Method (_AC1) {
145                         If (\FLVL <= 1) {
146                                 Return (CTOK (\F1OF))
147                         } Else {
148                                 Return (CTOK (\F1ON))
149                         }
150                 }
152                 Name (_AL0, Package () { TDP0 })
153                 Name (_AL1, Package () { TDP1 })
155                 PowerResource (TNP0, 0, 0)
156                 {
157                         Method (_STA) {
158                                 If (\FLVL <= 0) {
159                                         Return (1)
160                                 } Else {
161                                         Return (0)
162                                 }
163                         }
164                         Method (_ON)  {
165                                 \FLVL = 0
166                                 \_SB.PCI0.MCHC.STND ()
167                                 Notify (\_TZ.THRM, 0x81)
168                         }
169                         Method (_OFF) {
170                                 \FLVL = 1
171                                 \_SB.PCI0.MCHC.STDN ()
172                                 Notify (\_TZ.THRM, 0x81)
173                         }
174                 }
176                 PowerResource (TNP1, 0, 0)
177                 {
178                         Method (_STA) {
179                                 If (\FLVL <= 1) {
180                                         Return (1)
181                                 } Else {
182                                         Return (0)
183                                 }
184                         }
185                         Method (_ON)  {
186                                 \FLVL = 1
187                                 Notify (\_TZ.THRM, 0x81)
188                         }
189                         Method (_OFF) {
190                                 \FLVL = 1
191                                 Notify (\_TZ.THRM, 0x81)
192                         }
193                 }
195                 Device (TDP0)
196                 {
197                         Name (_HID, EISAID ("PNP0C0B"))
198                         Name (_UID, 0)
199                         Name (_PR0, Package () { TNP0 })
200                 }
202                 Device (TDP1)
203                 {
204                         Name (_HID, EISAID ("PNP0C0B"))
205                         Name (_UID, 1)
206                         Name (_PR0, Package () { TNP1 })
207                 }
208         }