Martin Roth | ebabfad | 2016-04-10 11:09:16 -0600 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License as |
| 6 | * published by the Free Software Foundation; version 2 of |
| 7 | * the License. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | */ |
| 14 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 15 | /* Thermal Threshold Event Handler */ |
| 16 | Method (TEVT, 1, NotSerialized) |
| 17 | { |
| 18 | Store (ToInteger (Arg0), Local0) |
| 19 | |
| 20 | #ifdef DPTF_TSR0_SENSOR_ID |
| 21 | If (LEqual (Local0, DPTF_TSR0_SENSOR_ID)) { |
| 22 | Notify (^TSR0, 0x90) |
| 23 | } |
| 24 | #endif |
| 25 | #ifdef DPTF_TSR1_SENSOR_ID |
| 26 | If (LEqual (Local0, DPTF_TSR1_SENSOR_ID)) { |
| 27 | Notify (^TSR1, 0x90) |
| 28 | } |
| 29 | #endif |
| 30 | #ifdef DPTF_TSR2_SENSOR_ID |
| 31 | If (LEqual (Local0, DPTF_TSR2_SENSOR_ID)) { |
| 32 | Notify (^TSR2, 0x90) |
| 33 | } |
| 34 | #endif |
| 35 | } |
| 36 | |
| 37 | /* Thermal device initialization - Disable Aux Trip Points */ |
| 38 | Method (TINI) |
| 39 | { |
| 40 | #ifdef DPTF_TSR0_SENSOR_ID |
| 41 | ^TSR0.PATD () |
| 42 | #endif |
| 43 | #ifdef DPTF_TSR1_SENSOR_ID |
| 44 | ^TSR1.PATD () |
| 45 | #endif |
| 46 | #ifdef DPTF_TSR2_SENSOR_ID |
| 47 | ^TSR2.PATD () |
| 48 | #endif |
| 49 | } |
| 50 | |
| 51 | #ifdef DPTF_TSR0_SENSOR_ID |
| 52 | Device (TSR0) |
| 53 | { |
| 54 | Name (_HID, EISAID ("INT3403")) |
| 55 | Name (_UID, 1) |
| 56 | Name (PTYP, 0x03) |
| 57 | Name (TMPI, DPTF_TSR0_SENSOR_ID) |
| 58 | Name (_STR, Unicode (DPTF_TSR0_SENSOR_NAME)) |
| 59 | Name (GTSH, 20) /* 2 degree hysteresis */ |
| 60 | |
| 61 | Method (_STA) |
| 62 | { |
| 63 | If (LEqual (\DPTE, One)) { |
| 64 | Return (0xF) |
| 65 | } Else { |
| 66 | Return (0x0) |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | Method (_TMP, 0, Serialized) |
| 71 | { |
| 72 | Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI)) |
| 73 | } |
| 74 | |
| 75 | Method (_PSV) |
| 76 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 77 | Return (CTOK (DPTF_TSR0_PASSIVE)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | Method (_CRT) |
| 81 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 82 | Return (CTOK (DPTF_TSR0_CRITICAL)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | Name (PATC, 2) |
| 86 | |
| 87 | /* Set Aux Trip Point */ |
| 88 | Method (PAT0, 1, Serialized) |
| 89 | { |
| 90 | \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0) |
| 91 | } |
| 92 | |
| 93 | /* Set Aux Trip Point */ |
| 94 | Method (PAT1, 1, Serialized) |
| 95 | { |
| 96 | \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0) |
| 97 | } |
| 98 | |
| 99 | /* Disable Aux Trip Point */ |
| 100 | Method (PATD, 0, Serialized) |
| 101 | { |
| 102 | \_SB.PCI0.LPCB.EC0.PATD (TMPI) |
| 103 | } |
| 104 | } |
| 105 | #endif |
| 106 | |
| 107 | #ifdef DPTF_TSR1_SENSOR_ID |
| 108 | Device (TSR1) |
| 109 | { |
| 110 | Name (_HID, EISAID ("INT3403")) |
| 111 | Name (_UID, 2) |
| 112 | Name (PTYP, 0x03) |
| 113 | Name (TMPI, DPTF_TSR1_SENSOR_ID) |
| 114 | Name (_STR, Unicode (DPTF_TSR1_SENSOR_NAME)) |
| 115 | Name (GTSH, 20) /* 2 degree hysteresis */ |
| 116 | |
| 117 | Method (_STA) |
| 118 | { |
| 119 | If (LEqual (\DPTE, One)) { |
| 120 | Return (0xF) |
| 121 | } Else { |
| 122 | Return (0x0) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | Method (_TMP, 0, Serialized) |
| 127 | { |
| 128 | Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI)) |
| 129 | } |
| 130 | |
| 131 | Method (_PSV) |
| 132 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 133 | Return (CTOK (DPTF_TSR1_PASSIVE)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | Method (_CRT) |
| 137 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 138 | Return (CTOK (DPTF_TSR1_CRITICAL)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | Name (PATC, 2) |
| 142 | |
| 143 | /* Set Aux Trip Point */ |
| 144 | Method (PAT0, 1, Serialized) |
| 145 | { |
| 146 | \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0) |
| 147 | } |
| 148 | |
| 149 | /* Set Aux Trip Point */ |
| 150 | Method (PAT1, 1, Serialized) |
| 151 | { |
| 152 | \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0) |
| 153 | } |
| 154 | |
| 155 | /* Disable Aux Trip Point */ |
| 156 | Method (PATD, 0, Serialized) |
| 157 | { |
| 158 | \_SB.PCI0.LPCB.EC0.PATD (TMPI) |
| 159 | } |
| 160 | } |
| 161 | #endif |
| 162 | |
| 163 | #ifdef DPTF_TSR2_SENSOR_ID |
| 164 | Device (TSR2) |
| 165 | { |
| 166 | Name (_HID, EISAID ("INT3403")) |
| 167 | Name (_UID, 3) |
| 168 | Name (PTYP, 0x03) |
| 169 | Name (TMPI, DPTF_TSR2_SENSOR_ID) |
| 170 | Name (_STR, Unicode (DPTF_TSR2_SENSOR_NAME)) |
| 171 | Name (GTSH, 20) /* 2 degree hysteresis */ |
| 172 | |
| 173 | Method (_STA) |
| 174 | { |
| 175 | If (LEqual (\DPTE, One)) { |
| 176 | Return (0xF) |
| 177 | } Else { |
| 178 | Return (0x0) |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | Method (_TMP, 0, Serialized) |
| 183 | { |
| 184 | Return (\_SB.PCI0.LPCB.EC0.TSRD (TMPI)) |
| 185 | } |
| 186 | |
| 187 | Method (_PSV) |
| 188 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 189 | Return (CTOK (DPTF_TSR2_PASSIVE)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | Method (_CRT) |
| 193 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 194 | Return (CTOK (DPTF_TSR2_CRITICAL)) |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | Name (PATC, 2) |
| 198 | |
| 199 | /* Set Aux Trip Point */ |
| 200 | Method (PAT0, 1, Serialized) |
| 201 | { |
| 202 | \_SB.PCI0.LPCB.EC0.PAT0 (TMPI, Arg0) |
| 203 | } |
| 204 | |
| 205 | /* Set Aux Trip Point */ |
| 206 | Method (PAT1, 1, Serialized) |
| 207 | { |
| 208 | \_SB.PCI0.LPCB.EC0.PAT1 (TMPI, Arg0) |
| 209 | } |
| 210 | |
| 211 | /* Disable Aux Trip Point */ |
| 212 | Method (PATD, 0, Serialized) |
| 213 | { |
| 214 | \_SB.PCI0.LPCB.EC0.PATD (TMPI) |
| 215 | } |
| 216 | } |
| 217 | #endif |