2 * This file is part of the coreboot project.
4 * Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
25 // Thermal zone polling frequency: 10 seconds
28 // Thermal sampling period for passive cooling: 2 seconds
31 // Convert from Degrees C to 1/10 Kelvin for ACPI
34 Multiply (Arg0, 10, Local0)
37 Add (Local0, 2732, Local0)
42 // Threshold for OS to shutdown
43 Method (_CRT, 0, Serialized)
48 // Threshold for passive cooling
49 Method (_PSV, 0, Serialized)
54 // Processors used for passive cooling
55 Method (_PSL, 0, Serialized)
60 // Start fan at state 4 = lowest temp state
64 Store (\F4PW, \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
65 Notify (\_TZ.THRM, 0x81)
68 Method (TCHK, 0, Serialized)
70 // Get CPU Temperature from PECI via SuperIO TMPIN3
71 Store (\_SB.PCI0.LPCB.SIO.ENVC.TIN3, Local0)
73 // Check for "no reading available"
74 If (LEqual (Local0, 0x80)) {
78 // Check for invalid readings
79 If (LOr (LEqual (Local0, 255), LEqual (Local0, 0))) {
83 // PECI raw value is an offset from Tj_max
84 Subtract (255, Local0, Local1)
86 // Handle values greater than Tj_max
87 If (LGreaterEqual (Local1, \TMAX)) {
91 // Subtract from Tj_max to get temperature
92 Subtract (\TMAX, Local1, Local0)
93 Return (CTOK (Local0))
96 Method (_TMP, 0, Serialized)
98 // Get temperature from SuperIO in deci-kelvin
99 Store (TCHK (), Local0)
101 // Critical temperature in deci-kelvin
102 Store (CTOK (\TMAX), Local1)
104 If (LGreaterEqual (Local0, Local1)) {
105 Store ("CRITICAL TEMPERATURE", Debug)
106 Store (Local0, Debug)
108 // Wait 1 second for SuperIO to re-poll
111 // Re-read temperature from SuperIO
112 Store (TCHK (), Local0)
114 Store ("RE-READ TEMPERATURE", Debug)
115 Store (Local0, Debug)
122 If (LLessEqual (\FLVL, 0)) {
123 Return (CTOK (\F0OF))
125 Return (CTOK (\F0ON))
130 If (LLessEqual (\FLVL, 1)) {
131 Return (CTOK (\F1OF))
133 Return (CTOK (\F1ON))
138 If (LLessEqual (\FLVL, 2)) {
139 Return (CTOK (\F2OF))
141 Return (CTOK (\F2ON))
146 If (LLessEqual (\FLVL, 3)) {
147 Return (CTOK (\F3OF))
149 Return (CTOK (\F3ON))
154 If (LLessEqual (\FLVL, 4)) {
155 Return (CTOK (\F4OF))
157 Return (CTOK (\F4ON))
161 Name (_AL0, Package () { FAN0 })
162 Name (_AL1, Package () { FAN1 })
163 Name (_AL2, Package () { FAN2 })
164 Name (_AL3, Package () { FAN3 })
165 Name (_AL4, Package () { FAN4 })
167 PowerResource (FNP0, 0, 0)
170 If (LLessEqual (\FLVL, 0)) {
177 If (LNot (_STA ())) {
180 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
181 Notify (\_TZ.THRM, 0x81)
188 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
189 Notify (\_TZ.THRM, 0x81)
194 PowerResource (FNP1, 0, 0)
197 If (LLessEqual (\FLVL, 1)) {
204 If (LNot (_STA ())) {
207 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
208 Notify (\_TZ.THRM, 0x81)
215 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
216 Notify (\_TZ.THRM, 0x81)
221 PowerResource (FNP2, 0, 0)
224 If (LLessEqual (\FLVL, 2)) {
231 If (LNot (_STA ())) {
234 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
235 Notify (\_TZ.THRM, 0x81)
242 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
243 Notify (\_TZ.THRM, 0x81)
248 PowerResource (FNP3, 0, 0)
251 If (LLessEqual (\FLVL, 3)) {
258 If (LNot (_STA ())) {
261 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
262 Notify (\_TZ.THRM, 0x81)
269 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
270 Notify (\_TZ.THRM, 0x81)
275 PowerResource (FNP4, 0, 0)
278 If (LLessEqual (\FLVL, 4)) {
285 If (LNot (_STA ())) {
288 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
289 Notify (\_TZ.THRM, 0x81)
296 \_SB.PCI0.LPCB.SIO.ENVC.F2PS)
297 Notify (\_TZ.THRM, 0x81)
304 Name (_HID, EISAID ("PNP0C0B"))
306 Name (_PR0, Package () { FNP0 })
311 Name (_HID, EISAID ("PNP0C0B"))
313 Name (_PR0, Package () { FNP1 })
318 Name (_HID, EISAID ("PNP0C0B"))
320 Name (_PR0, Package () { FNP2 })
325 Name (_HID, EISAID ("PNP0C0B"))
327 Name (_PR0, Package () { FNP3 })
332 Name (_HID, EISAID ("PNP0C0B"))
334 Name (_PR0, Package () { FNP4 })