blob: 5d685bb96b6fc0545a825cf3e0e89b905bf09cdf [file] [log] [blame]
Martin Rothebabfad2016-04-10 11:09:16 -06001/*
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 Leahy77ff0b12015-05-05 15:07:29 -070015/* Thermal Threshold Event Handler */
16Method (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 */
38Method (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
52Device (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 Leahy32471722015-04-20 15:20:28 -070077 Return (CTOK (DPTF_TSR0_PASSIVE))
Lee Leahy77ff0b12015-05-05 15:07:29 -070078 }
79
80 Method (_CRT)
81 {
Lee Leahy32471722015-04-20 15:20:28 -070082 Return (CTOK (DPTF_TSR0_CRITICAL))
Lee Leahy77ff0b12015-05-05 15:07:29 -070083 }
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
108Device (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 Leahy32471722015-04-20 15:20:28 -0700133 Return (CTOK (DPTF_TSR1_PASSIVE))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700134 }
135
136 Method (_CRT)
137 {
Lee Leahy32471722015-04-20 15:20:28 -0700138 Return (CTOK (DPTF_TSR1_CRITICAL))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700139 }
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
164Device (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 Leahy32471722015-04-20 15:20:28 -0700189 Return (CTOK (DPTF_TSR2_PASSIVE))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700190 }
191
192 Method (_CRT)
193 {
Lee Leahy32471722015-04-20 15:20:28 -0700194 Return (CTOK (DPTF_TSR2_CRITICAL))
Lee Leahy77ff0b12015-05-05 15:07:29 -0700195 }
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