Stefan Reinauer | 6651da3 | 2012-04-27 23:16:30 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 The Chromium OS Authors. All rights reserved. |
| 5 | * |
| 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. |
| 9 | * |
| 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. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | // Thermal Zone |
| 21 | |
| 22 | Scope (\_TZ) |
| 23 | { |
| 24 | ThermalZone (THRM) |
| 25 | { |
| 26 | Name (_TC1, 0x02) |
| 27 | Name (_TC2, 0x05) |
| 28 | |
| 29 | // Thermal zone polling frequency: 10 seconds |
| 30 | Name (_TZP, 100) |
| 31 | |
| 32 | // Thermal sampling period for passive cooling: 2 seconds |
| 33 | Name (_TSP, 20) |
| 34 | |
| 35 | // Convert from Degrees C to 1/10 Kelvin for ACPI |
| 36 | Method (CTOK, 1) { |
| 37 | // 10th of Degrees C |
| 38 | Multiply (Arg0, 10, Local0) |
| 39 | |
| 40 | // Convert to Kelvin |
| 41 | Add (Local0, 2732, Local0) |
| 42 | |
| 43 | Return (Local0) |
| 44 | } |
| 45 | |
| 46 | // Threshold for OS to shutdown |
| 47 | Method (_CRT, 0, Serialized) |
| 48 | { |
| 49 | Return (CTOK (\TCRT)) |
| 50 | } |
| 51 | |
| 52 | // Threshold for passive cooling |
| 53 | Method (_PSV, 0, Serialized) |
| 54 | { |
| 55 | Return (CTOK (\TPSV)) |
| 56 | } |
| 57 | |
| 58 | // Processors used for passive cooling |
| 59 | Method (_PSL, 0, Serialized) |
| 60 | { |
| 61 | Return (\PPKG ()) |
| 62 | } |
| 63 | |
| 64 | Method (_TMP, 0, Serialized) |
| 65 | { |
| 66 | // Get CPU Temperature from PECI via SuperIO TMPIN3 |
| 67 | Store (\_SB.PCI0.LPCB.SIO.ENVC.TIN3, Local0) |
| 68 | |
| 69 | // Check for invalid readings |
| 70 | If (LOr (LEqual (Local0, 255), LEqual (Local0, 0))) { |
| 71 | Return (CTOK (\F2ON)) |
| 72 | } |
| 73 | |
| 74 | // PECI raw value is an offset from Tj_max |
| 75 | Subtract (255, Local0, Local1) |
| 76 | |
| 77 | // Handle values greater than Tj_max |
| 78 | If (LGreaterEqual (Local1, \TMAX)) { |
| 79 | Return (CTOK (\TMAX)) |
| 80 | } |
| 81 | |
| 82 | // Subtract from Tj_max to get temperature |
| 83 | Subtract (\TMAX, Local1, Local0) |
| 84 | Return (CTOK (Local0)) |
| 85 | } |
| 86 | |
| 87 | Method (_AC0) { |
| 88 | If (LLessEqual (\FLVL, 0)) { |
| 89 | Return (CTOK (\F0OF)) |
| 90 | } Else { |
| 91 | Return (CTOK (\F0ON)) |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | Method (_AC1) { |
| 96 | If (LLessEqual (\FLVL, 1)) { |
| 97 | Return (CTOK (\F1OF)) |
| 98 | } Else { |
| 99 | Return (CTOK (\F1ON)) |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | Method (_AC2) { |
| 104 | If (LLessEqual (\FLVL, 2)) { |
| 105 | Return (CTOK (\F2OF)) |
| 106 | } Else { |
| 107 | Return (CTOK (\F2ON)) |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | Method (_AC3) { |
| 112 | If (LLessEqual (\FLVL, 3)) { |
| 113 | Return (CTOK (\F3OF)) |
| 114 | } Else { |
| 115 | Return (CTOK (\F3ON)) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | Method (_AC4) { |
| 120 | If (LLessEqual (\FLVL, 4)) { |
| 121 | Return (CTOK (\F4OF)) |
| 122 | } Else { |
| 123 | Return (CTOK (\F4ON)) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | Name (_AL0, Package () { FAN0 }) |
| 128 | Name (_AL1, Package () { FAN1 }) |
| 129 | Name (_AL2, Package () { FAN2 }) |
| 130 | Name (_AL3, Package () { FAN3 }) |
| 131 | Name (_AL4, Package () { FAN4 }) |
| 132 | |
| 133 | PowerResource (FNP0, 0, 0) |
| 134 | { |
| 135 | Method (_STA) { |
| 136 | If (LLessEqual (\FLVL, 0)) { |
| 137 | Return (One) |
| 138 | } Else { |
| 139 | Return (Zero) |
| 140 | } |
| 141 | } |
| 142 | Method (_ON) { |
| 143 | Store (0, \FLVL) |
| 144 | Store (\F0PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 145 | Notify (\_TZ.THRM, 0x81) |
| 146 | } |
| 147 | Method (_OFF) { |
| 148 | Store (1, \FLVL) |
| 149 | Store (\F1PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 150 | Notify (\_TZ.THRM, 0x81) |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | PowerResource (FNP1, 0, 0) |
| 155 | { |
| 156 | Method (_STA) { |
| 157 | If (LLessEqual (\FLVL, 1)) { |
| 158 | Return (One) |
| 159 | } Else { |
| 160 | Return (Zero) |
| 161 | } |
| 162 | } |
| 163 | Method (_ON) { |
| 164 | Store (1, \FLVL) |
| 165 | Store (\F1PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 166 | Notify (\_TZ.THRM, 0x81) |
| 167 | } |
| 168 | Method (_OFF) { |
| 169 | Store (2, \FLVL) |
| 170 | Store (\F2PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 171 | Notify (\_TZ.THRM, 0x81) |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | PowerResource (FNP2, 0, 0) |
| 176 | { |
| 177 | Method (_STA) { |
| 178 | If (LLessEqual (\FLVL, 2)) { |
| 179 | Return (One) |
| 180 | } Else { |
| 181 | Return (Zero) |
| 182 | } |
| 183 | } |
| 184 | Method (_ON) { |
| 185 | Store (2, \FLVL) |
| 186 | Store (\F2PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 187 | Notify (\_TZ.THRM, 0x81) |
| 188 | } |
| 189 | Method (_OFF) { |
| 190 | Store (3, \FLVL) |
| 191 | Store (\F3PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 192 | Notify (\_TZ.THRM, 0x81) |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | PowerResource (FNP3, 0, 0) |
| 197 | { |
| 198 | Method (_STA) { |
| 199 | If (LLessEqual (\FLVL, 3)) { |
| 200 | Return (One) |
| 201 | } Else { |
| 202 | Return (Zero) |
| 203 | } |
| 204 | } |
| 205 | Method (_ON) { |
| 206 | Store (3, \FLVL) |
| 207 | Store (\F3PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 208 | Notify (\_TZ.THRM, 0x81) |
| 209 | } |
| 210 | Method (_OFF) { |
| 211 | Store (4, \FLVL) |
| 212 | Store (\F4PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 213 | Notify (\_TZ.THRM, 0x81) |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | PowerResource (FNP4, 0, 0) |
| 218 | { |
| 219 | Method (_STA) { |
| 220 | If (LLessEqual (\FLVL, 4)) { |
| 221 | Return (One) |
| 222 | } Else { |
| 223 | Return (Zero) |
| 224 | } |
| 225 | } |
| 226 | Method (_ON) { |
| 227 | Store (4, \FLVL) |
| 228 | Store (\F4PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 229 | Notify (\_TZ.THRM, 0x81) |
| 230 | } |
| 231 | Method (_OFF) { |
| 232 | Store (4, \FLVL) |
| 233 | Store (\F4PW, \_SB.PCI0.LPCB.SIO.ENVC.F3PS) |
| 234 | Notify (\_TZ.THRM, 0x81) |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | Device (FAN0) |
| 239 | { |
| 240 | Name (_HID, EISAID ("PNP0C0B")) |
| 241 | Name (_UID, 0) |
| 242 | Name (_PR0, Package () { FNP0 }) |
| 243 | } |
| 244 | |
| 245 | Device (FAN1) |
| 246 | { |
| 247 | Name (_HID, EISAID ("PNP0C0B")) |
| 248 | Name (_UID, 1) |
| 249 | Name (_PR0, Package () { FNP1 }) |
| 250 | } |
| 251 | |
| 252 | Device (FAN2) |
| 253 | { |
| 254 | Name (_HID, EISAID ("PNP0C0B")) |
| 255 | Name (_UID, 2) |
| 256 | Name (_PR0, Package () { FNP2 }) |
| 257 | } |
| 258 | |
| 259 | Device (FAN3) |
| 260 | { |
| 261 | Name (_HID, EISAID ("PNP0C0B")) |
| 262 | Name (_UID, 3) |
| 263 | Name (_PR0, Package () { FNP3 }) |
| 264 | } |
| 265 | |
| 266 | Device (FAN4) |
| 267 | { |
| 268 | Name (_HID, EISAID ("PNP0C0B")) |
| 269 | Name (_UID, 4) |
| 270 | Name (_PR0, Package () { FNP4 }) |
| 271 | } |
| 272 | } |
| 273 | } |
| 274 | |