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