xref: /freebsd/sys/dev/asmc/asmcvar.h (revision 716fd348)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2007, 2008 Rui Paulo <rpaulo@FreeBSD.org>
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  *
30  */
31 
32 #define ASMC_MAXFANS	6
33 
34 struct asmc_softc {
35 	device_t 		sc_dev;
36 	struct mtx 		sc_mtx;
37 	int 			sc_nfan;
38 	int16_t			sms_rest_x;
39 	int16_t			sms_rest_y;
40 	int16_t			sms_rest_z;
41 	struct sysctl_oid 	*sc_fan_tree[ASMC_MAXFANS+1];
42 	struct sysctl_oid 	*sc_temp_tree;
43 	struct sysctl_oid 	*sc_sms_tree;
44 	struct sysctl_oid 	*sc_light_tree;
45 	const struct asmc_model *sc_model;
46 	int 			sc_rid_port;
47 	int 			sc_rid_irq;
48 	struct resource 	*sc_ioport;
49 	struct resource 	*sc_irq;
50 	void 			*sc_cookie;
51 	int 			sc_sms_intrtype;
52 	struct taskqueue 	*sc_sms_tq;
53 	struct task 		sc_sms_task;
54 	uint8_t			sc_sms_intr_works;
55 };
56 
57 /*
58  * Data port.
59  */
60 #define ASMC_DATAPORT_READ(sc)	bus_read_1(sc->sc_ioport, 0x00)
61 #define ASMC_DATAPORT_WRITE(sc, val) \
62 	bus_write_1(sc->sc_ioport, 0x00, val)
63 #define ASMC_STATUS_MASK 	0x0f
64 
65 /*
66  * Command port.
67  */
68 #define ASMC_CMDPORT_READ(sc)	bus_read_1(sc->sc_ioport, 0x04)
69 #define ASMC_CMDPORT_WRITE(sc, val) \
70 	bus_write_1(sc->sc_ioport, 0x04, val)
71 #define ASMC_CMDREAD		0x10
72 #define ASMC_CMDWRITE		0x11
73 
74 /*
75  * Interrupt port.
76  */
77 #define ASMC_INTPORT_READ(sc)	bus_read_1(sc->sc_ioport, 0x1f)
78 
79 /* Number of keys */
80 #define ASMC_NKEYS		"#KEY"	/* RO; 4 bytes */
81 
82 /*
83  * Fan control via SMC.
84  */
85 #define ASMC_KEY_FANCOUNT	"FNum"	/* RO; 1 byte */
86 #define ASMC_KEY_FANMANUAL	"FS! "	/* RW; 2 bytes */
87 #define ASMC_KEY_FANID		"F%dID"	/* RO; 16 bytes */
88 #define ASMC_KEY_FANSPEED	"F%dAc"	/* RO; 2 bytes */
89 #define ASMC_KEY_FANMINSPEED	"F%dMn"	/* RO; 2 bytes */
90 #define ASMC_KEY_FANMAXSPEED	"F%dMx"	/* RO; 2 bytes */
91 #define ASMC_KEY_FANSAFESPEED	"F%dSf"	/* RO; 2 bytes */
92 #define ASMC_KEY_FANTARGETSPEED	"F%dTg"	/* RW; 2 bytes */
93 
94 /*
95  * Sudden Motion Sensor (SMS).
96  */
97 #define ASMC_SMS_INIT1		0xe0
98 #define ASMC_SMS_INIT2		0xf8
99 #define ASMC_KEY_SMS		"MOCN"	/* RW; 2 bytes */
100 #define ASMC_KEY_SMS_X		"MO_X"	/* RO; 2 bytes */
101 #define ASMC_KEY_SMS_Y		"MO_Y"	/* RO; 2 bytes */
102 #define ASMC_KEY_SMS_Z		"MO_Z"	/* RO; 2 bytes */
103 #define ASMC_KEY_SMS_LOW	"MOLT"	/* RW; 2 bytes */
104 #define ASMC_KEY_SMS_HIGH	"MOHT"	/* RW; 2 bytes */
105 #define ASMC_KEY_SMS_LOW_INT	"MOLD"	/* RW; 1 byte */
106 #define ASMC_KEY_SMS_HIGH_INT	"MOHD"	/* RW; 1 byte */
107 #define ASMC_KEY_SMS_FLAG	"MSDW"	/* RW; 1 byte */
108 #define ASMC_SMS_INTFF		0x60	/* Free fall Interrupt */
109 #define ASMC_SMS_INTHA		0x6f	/* High Acceleration Interrupt */
110 #define ASMC_SMS_INTSH		0x80	/* Shock Interrupt */
111 
112 /*
113  * Keyboard backlight.
114  */
115 #define ASMC_KEY_LIGHTLEFT	"ALV0"	/* RO; 6 bytes */
116 #define ASMC_KEY_LIGHTRIGHT	"ALV1"	/* RO; 6 bytes */
117 #define ASMC_KEY_LIGHTVALUE	"LKSB"	/* WO; 2 bytes */
118 
119 /*
120  * Clamshell.
121  */
122 #define ASMC_KEY_CLAMSHELL	"MSLD"	/* RO; 1 byte */
123 
124 /*
125  * Interrupt keys.
126  */
127 #define ASMC_KEY_INTOK		"NTOK"	/* WO; 1 byte */
128 
129 /*
130  * Temperatures.
131  *
132  * First for MacBook, second for MacBook Pro, third for Intel Mac Mini,
133  * fourth the Mac Pro 8-core and finally the MacBook Air.
134  *
135  */
136 /* maximum array size for temperatures including the last NULL */
137 #define ASMC_TEMP_MAX		80
138 #define ASMC_MB_TEMPS		{ "TB0T", "TN0P", "TN1P", "Th0H", "Th1H", \
139 				  "TM0P", NULL }
140 #define ASMC_MB_TEMPNAMES	{ "enclosure", "northbridge1", \
141 				  "northbridge2", "heatsink1", \
142 				  "heatsink2", "memory", }
143 #define ASMC_MB_TEMPDESCS	{ "Enclosure Bottomside", \
144 				  "Northbridge Point 1", \
145 				  "Northbridge Point 2", "Heatsink 1", \
146 				  "Heatsink 2", "Memory Bank A", }
147 
148 #define ASMC_MB31_TEMPS		{ "TB0T", "TN0P",  "Th0H", "Th1H", \
149 				  "TM0P", NULL }
150 
151 #define ASMC_MB31_TEMPNAMES	{ "enclosure", "northbridge1", \
152 				  "heatsink1", "heatsink2", \
153 				  "memory", }
154 
155 #define ASMC_MB31_TEMPDESCS	{ "Enclosure Bottomside", \
156 				  "Northbridge Point 1", \
157 				  "Heatsink 1","Heatsink 2" \
158 				  "Memory Bank A", }
159 
160 #define ASMC_MB71_TEMPS		{ "TB0T", "TB1T", "TB2T", "TC0D", "TC0P", \
161 				  "TH0P", "TN0D", "TN0P", "TN0S", "TN1D", \
162 				  "TN1E", "TN1F", "TN1G", "TN1S", "Th1H", \
163 				  "Ts0P", "Ts0S", NULL }
164 
165 #define ASMC_MB71_TEMPNAMES	{ "enclosure_bottom0", "battery_1", "battery_2", "cpu_package", "cpu_proximity", \
166 				  "hdd_bay", "northbridge0_diode", "northbridge0_proximity", "TN0S", "mpc_die2", \
167 				  "TN1E", "TN1F", "TN1G", "TN1S", "heatsink1", \
168 				  "palm_rest", "memory_proximity", }
169 
170 #define ASMC_MB71_TEMPDESCS	{ "Enclosure Bottom 0", "Battery 1", "Battery 2", "CPU Package", "CPU Proximity", \
171 				  "HDD Bay", "Northbridge Diode", "Northbridge Proximity", "TN0S", "MPC Die 2", \
172 				  "TN1E", "TN1F", "TN1G", "TN1S", "Heatsink 1", \
173 				  "Palm Rest", "Memory Proximity", }
174 
175 #define ASMC_MBP_TEMPS		{ "TB0T", "Th0H", "Th1H", "Tm0P",	\
176 				  "TG0H", "TG0P", "TG0T", NULL }
177 
178 #define ASMC_MBP_TEMPNAMES	{ "enclosure", "heatsink1", \
179 				  "heatsink2", "memory", "graphics", \
180 				  "graphicssink", "unknown", }
181 
182 #define ASMC_MBP_TEMPDESCS	{ "Enclosure Bottomside", \
183 				  "Heatsink 1", "Heatsink 2", \
184 				  "Memory Controller", \
185 				  "Graphics Chip", "Graphics Heatsink", \
186 				  "Unknown", }
187 
188 #define ASMC_MBP4_TEMPS		{ "TB0T", "Th0H", "Th1H", "Th2H", "Tm0P", \
189 				  "TG0H", "TG0D", "TC0D", "TC0P", "Ts0P", \
190 				  "TTF0", "TW0P", NULL }
191 
192 #define ASMC_MBP4_TEMPNAMES	{ "enclosure", "heatsink1", "heatsink2", \
193 				  "heatsink3", "memory", "graphicssink", \
194 				  "graphics", "cpu", "cpu2", "unknown1", \
195 				  "unknown2", "wireless", }
196 
197 #define ASMC_MBP4_TEMPDESCS	{ "Enclosure Bottomside", \
198 				  "Main Heatsink 1", "Main Heatsink 2", \
199 				  "Main Heatsink 3", \
200 				  "Memory Controller", \
201 				  "Graphics Chip Heatsink", \
202 				  "Graphics Chip Diode", \
203 				  "CPU Temperature Diode", "CPU Point 2", \
204 				  "Unknown", "Unknown", \
205 				  "Wireless Module", }
206 
207 #define ASMC_MBP5_TEMPS		{ "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", \
208 				  "TC0F", "TC0P", "TG0D", "TG0F", "TG0H", \
209 				  "TG0P", "TG0T", "TG1H", "TN0D", "TN0P", \
210 				  "TTF0", "Th2H", "Tm0P", "Ts0P", "Ts0S", \
211 				  NULL }
212 
213 #define ASMC_MBP5_TEMPNAMES	{ "enclosure_bottom_0", "enclosure_bottom_1", \
214 				  "enclosure_bottom_2", "enclosure_bottom_3", \
215 				  "cpu_diode", "cpu", \
216 				  "cpu_pin", "gpu_diode", \
217 				  "gpu", "gpu_heatsink", \
218 				  "gpu_pin", "gpu_transistor", \
219 				  "gpu_2_heatsink", "northbridge_diode", \
220 				  "northbridge_pin", "unknown", \
221 				  "heatsink_2", "memory_controller", \
222 				  "pci_express_slot_pin", "pci_express_slot_unk" }
223 
224 #define ASMC_MBP5_TEMPDESCS	{ "Enclosure Bottom 0", "Enclosure Bottom 1", \
225 				  "Enclosure Bottom 2", "Enclosure Bottom 3", \
226 				  "CPU Diode", "CPU ???", \
227 				  "CPU Pin", "GPU Diode", \
228 				  "GPU ???", "GPU Heatsink", \
229 				  "GPU Pin", "GPU Transistor", \
230 				  "GPU 2 Heatsink", "Northbridge Diode", \
231 				  "Northbridge Pin", "Unknown", \
232 				  "Heatsink 2", "Memory Controller", \
233 				  "PCI Express Slot Pin", "PCI Express Slot (unk)" }
234 
235 #define ASMC_MBP81_TEMPS	{ "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \
236 				  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
237 				  "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
238 				  "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \
239 				  "Ts0S", NULL }
240 
241 #define ASMC_MBP81_TEMPNAMES	{ "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
242 				  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
243 				  "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
244 				  "TP0P", "TPCD", "wireless", "Th1H", "Ts0P", \
245 				  "Ts0S" }
246 
247 #define ASMC_MBP81_TEMPDESCS	{ "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \
248 				  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
249 				  "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \
250 				  "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \
251 				  "Ts0S" }
252 
253 #define ASMC_MBP82_TEMPS	{ "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \
254 				  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
255 				  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
256 				  "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \
257 				  "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \
258 				  "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL }
259 
260 #define ASMC_MBP82_TEMPNAMES	{ "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \
261 				  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
262 				  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
263 				  "TCTD", "graphics", "TG0P", "THSP", "TM0S", \
264 				  "TMBS", "TP0P", "TPCD", "wireless", "Th1H", \
265 				  "Th2H", "memory", "Ts0P", "Ts0S" }
266 
267 #define ASMC_MBP82_TEMPDESCS	{ "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \
268 				  "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \
269 				  "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \
270 				  "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \
271 				  "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \
272 				  "Th2H", "Tm0P", "Ts0P", "Ts0S" }
273 
274 #define ASMC_MBP91_TEMPS	{ "TA0P", "TB0T", "TB1T", "TB2T", "TC0E", \
275 				  "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \
276 				  "TC4C", "TCGC", "TCSA", "TCXC", "TG0D", \
277 				  "TG0P", "TG1D", "TG1F", "TG1d", "TGTC", \
278 				  "TGTD", "TM0P", "TM0S", "TP0P", "TPCD", \
279 				  "Th1H", "Th2H", "Ts0P", "Ts0S", "Tsqf", NULL }
280 
281 #define ASMC_MBP91_TEMPNAMES	{ "ambient", "enclosure_bottom_1", "enclosure_bottom_2", \
282 				  "enclosure_bottom_3", "cpu_die_peci_0", "cpu_die_peci_1", \
283 				  "cpu_proximity", "cpu_core_1", "cpu_core_2", "cpu_core_3", \
284 				  "cpu_core_4", "intel_gpu", "cpu_sys_agent", \
285 				  "cpu_core_peci", "gpu_analog", \
286 				  "gpu_proximity", "geforce_gpu_digital", "tg1f", \
287 				  "gpu_2_die", "tgtc", "tgtd", "memory_proximity", \
288 				  "mem_bank_a1", "platform_ctrl_hub", "pch_digital", \
289 				  "main_heatsink_r", "main_heatsink_l", "palm_rest", \
290 				  "bottom_skin", "tsqf" }
291 
292 #define ASMC_MBP91_TEMPDESCS	{ "Ambient", "Enclosure Bottom 1", "Enclosure Bottom 2", \
293 				  "Enclosure Bottom 3", "CPU Die PECI 0", "CPU Die PECI 1", \
294 				  "CPU Proximity", "CPU Core 1", "CPU Core 2", \
295 				  "CPU Core 3", "CPU Core 4", "Intel GPU", \
296 				  "CPU System Agent Core", "CPU Core - PECI", \
297 				  "GPU Die - Analog", "GPU Proximity", \
298 				  "GeForce GPU Die - Digital", "TG1F", "GPU 2 Die" \
299 				  "TGTC", "TGTD", "Memory Proximity", \
300 				  "Memory Bank A1", "Platform Controller Hub", "PCH Die - Digital", \
301 				  "Main Heatsink Right", "Main Heatsink Left", "Palm Rest",  \
302 				  "Bottom Skin", "Tsqf" }
303 
304 #define ASMC_MBP92_TEMPS	{ "Ts0P", "Ts0S", "TA0P", "TB1T", "TB2T", \
305 				  "TB0T", "TC1C", "TC2C", "TC0E", "TC0F", \
306 				  "TC0J", "TC0P", "TCFC", "TCGC", "TCSA", \
307 				  "TCTD", "TCXC", "TG1D", "TM0P", "TM0S", \
308 				  "TPCD", NULL }
309 
310 #define ASMC_MBP92_TEMPNAMES	{ "Ts0P", "Ts0S", "TA0P", "TB1T", "TB2T", \
311 				  "TB0T", "TC1C", "TC2C", "TC0E", "TC0F", \
312 				  "TC0J", "TC0P", "TCFC", "TCGC", "TCSA", \
313 				  "TCTD", "TCXC", "TG1D", "TM0P", "TM0S", \
314 				  "TPCD" }
315 
316 #define ASMC_MBP92_TEMPDESCS	{ "Palm Rest", "Memory Proximity", "Airflow 1", \
317 				  "Battery 1", "Battery 2", "Battery TS_MAX", \
318 				  "CPU Core 1", "CPU Core 2", "CPU1", "CPU1", \
319 				  "TC0J", "CPU 1 Proximity", "TCFC", \
320 				  "PECI GPU", "PECI SA", "TCTD", "PECI CPU", \
321 				  "GPU Die", "Memory Bank A1", "Memory Module A1", \
322 				  "PCH Die" }
323 
324 #define ASMC_MBP112_TEMPS	{ "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \
325 				  "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \
326 				  "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \
327 				  "TCXC", "TH0A", "TH0B", "TH0F", "TH0R", \
328 				  "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \
329 				  "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \
330 				  "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \
331 				  "Ts1S", NULL }
332 
333 #define ASMC_MBP112_TEMPNAMES	{ "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \
334 				  "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \
335 				  "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \
336 				  "TCXC", "TH0A", "TH0B", "TH0F", "TH0R", \
337 				  "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \
338 				  "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \
339 				  "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \
340 				  "Ts1S" }
341 
342 #define ASMC_MBP112_TEMPDESCS	{ "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \
343 				  "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \
344 				  "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \
345 				  "TCXC", "TH0A", "TH0B", "TH0F", "TH0R", \
346 				  "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \
347 				  "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \
348 				  "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \
349 				  "Ts1S" }
350 
351 #define ASMC_MBP113_TEMPS	{ "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \
352 				  "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \
353 				  "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \
354 				  "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \
355 				  "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \
356 				  "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \
357 				  "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \
358 				  "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \
359 				  "Ts1S", NULL }
360 
361 #define ASMC_MBP113_TEMPNAMES	{ "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \
362 				  "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \
363 				  "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \
364 				  "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \
365 				  "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \
366 				  "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \
367 				  "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \
368 				  "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \
369 				  "Ts1S" }
370 
371 #define ASMC_MBP113_TEMPDESCS	{ "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \
372 				  "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \
373 				  "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \
374 				  "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \
375 				  "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \
376 				  "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \
377 				  "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \
378 				  "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \
379 				  "Ts1S" }
380 #define ASMC_MM_TEMPS		{ "TN0P", "TN1P", NULL }
381 #define ASMC_MM_TEMPNAMES	{ "northbridge1", "northbridge2" }
382 #define ASMC_MM_TEMPDESCS	{ "Northbridge Point 1", \
383 				  "Northbridge Point 2" }
384 
385 #define ASMC_MM21_TEMPS		{ "TA0P", "TC0D", \
386 				  "TC0H", "TC0P", \
387 				  "TC1P", "TN0P", \
388 				  "TN1P", NULL }
389 
390 #define ASMC_MM21_TEMPNAMES	{ "ambient_air", "cpu_die", \
391 				  "cpu_heatsink", "cpu_proximity1", \
392 				  "cpu_proximity2", "northbridge_proximity1", \
393 				  "northbridge_proximity2", }
394 
395 #define ASMC_MM21_TEMPDESCS	{ "Ambient Air Temperature" \
396 				  "CPU Die Core Temperature", \
397 				  "CPU Heatsink Temperature", \
398 				  "CPU Proximity 1 Temperature", \
399 				  "CPU Proximity 2 Temperature", \
400 				  "Northbridge Proximity 1 Temperature", \
401 				  "Northbridge Proximity 2 Temperature", }
402 
403 #define ASMC_MM31_TEMPS		{ "TC0D", "TC0H", \
404 				  "TC0P", "TH0P", \
405 				  "TN0D", "TN0P", \
406 				  "TW0P", NULL }
407 
408 #define ASMC_MM31_TEMPNAMES	{ "cpu0_die", "cpu0_heatsink", \
409 				  "cpu0_proximity", "hdd_bay", \
410 				  "northbridge_die", \
411 				  "northbridge_proximity", \
412 				  "wireless_proximity", }
413 
414 #define ASMC_MM31_TEMPDESCS	{ "CPU0 Die Core Temperature", \
415 				  "CPU0 Heatsink Temperature", \
416 				  "CPU0 Proximity Temperature", \
417 				  "HDD Bay Temperature", \
418 				  "Northbridge Die Core Temperature", \
419 				  "Northbridge Proximity Temperature", \
420 				  "Wireless Module Proximity Temperature", }
421 
422 #define ASMC_MM41_TEMPS		{ "TA0P", "TC0D", "TC0G", "TC0H", "TC0P", \
423 				  "TC0p", "TCPG", "TH0G", "TH0P", "TH0p", \
424 				  "TM0G", "TM0P", "TM0p", "TN0D", "TN0G", \
425 				  "TN0P", "TN0p", "TN1D", "TN1E", "TN1F", \
426 				  "TN1G", "TN1S", "TNPG", "TO0P", "TO0p", \
427 				  "TW0P", "Tm0P", "Tp0C", NULL }
428 
429 #define ASMC_MM41_TEMPNAMES	{ "TA0P", "TC0D", "TC0G", "TC0H", "TC0P", \
430 				  "TC0p", "TCPG", "TH0G", "TH0P", "TH0p", \
431 				  "TM0G", "TM0P", "TM0p", "TN0D", "TN0G", \
432 				  "TN0P", "TN0p", "TN1D", "TN1E", "TN1F", \
433 				  "TN1G", "TN1S", "TNPG", "TO0P", "TO0p", \
434 				  "TW0P", "Tm0P", "Tp0C", NULL }
435 
436 #define ASMC_MM41_TEMPDESCS	{ "TA0P", "TC0D", "TC0G", "TC0H", "TC0P", \
437 				  "TC0p", "TCPG", "TH0G", "TH0P", "TH0p", \
438 				  "TM0G", "TM0P", "TM0p", "TN0D", "TN0G", \
439 				  "TN0P", "TN0p", "TN1D", "TN1E", "TN1F", \
440 				  "TN1G", "TN1S", "TNPG", "TO0P", "TO0p", \
441 				  "TW0P", "Tm0P", "Tp0C", NULL }
442 
443 #define ASMC_MM52_TEMPS		{ "TA0P", "TA1P", \
444 				  "TC0D", "TC0P", \
445 				  "TG0D", "TG1D", \
446 				  "TG0P", "TG0M", \
447 				  "TI0P", \
448 				  "TM0S", "TMBS", \
449 				  "TM0P", "TP0P", \
450 				  "TPCD", "Tp0C", \
451 				  "TW0P", NULL }
452 
453 #define ASMC_MM52_TEMPNAMES	{ "ambient_air_proximity", "ambient_cpu_pch_wireless_dimm", \
454 				  "cpu_die", "cpu_proximity", \
455 				  "gpu_diode1", "gpu_diode2", \
456 				  "gpu_proximity", "gpu_integrated_switcher", \
457 				  "thunderbolt_proximity", \
458 				  "memory_slot1", "memory_slot2", \
459 				  "memory_proximity", "pch_controller_proximity", \
460 				  "pch_controller_die", "pwr_supply", \
461 				  "wireless_proximity", }
462 
463 #define ASMC_MM52_TEMPDESCS	{ "Ambient Air Proximity Temperature", \
464 				  "Combo Ambient CPU PCH Wireless DIMM Temperature", \
465 				  "CPU Die Temperature", "CPU Proximity Temperature", \
466 				  "GPU Diode 1 Temperature" , "GPU Diode 2 Temperature", \
467 				  "GPU Proximity Temperature", \
468 				  "Integrated Graphics/GPU Switcher Temperature", \
469 				  "Thunderbolt Proximity Temperature", \
470 				  "Memory Slot 1 Temperature", \
471 				  "Memory Slot 2 Temperature", \
472 				  "Memory Slots Proximity Temperature", \
473 				  "Platform Controller Hub Proximity Temperature", \
474 				  "Platform Controller Hub Die Temperature", \
475 				  "Power Supply Temperature", \
476 				  "Wireless Module Proximity Temperature", }
477 
478 #define ASMC_MM71_TEMPS		{ "TA0p", "TA1p", \
479 				  "TA2p", "TC0c", \
480 				  "TC0p", "TC1c", \
481 				  "TCGc", "TCSc", \
482 				  "TCXC", "TCXR", \
483 				  "TM0p", "TPCd", \
484 				  "TW0p", "Te0T", \
485 				  "Tm0P", NULL }
486 
487 #define ASMC_MM71_TEMPNAMES	{ "ambient_air1", "ambient_air2", \
488 				  "ambient_air3", "cpu_core1_peci", \
489 				  "cpu_proximity", "cpu_core2_peci", \
490 				  "intel_gpu", "cpu_sa_core_peci", \
491 				  "cpu_core", "cpu_peci_dts", \
492 				  "memory_proximity", "pch_controller_die", \
493 				  "wireless_proximity", "thunderbolt_diode", \
494 				  "logic_board", }
495 
496 #define ASMC_MM71_TEMPDESCS	{ "Ambient Air Temperature 1", \
497 				  "Ambient Air Temperature 2", \
498 				  "Ambient Air Temperature 3", \
499 				  "CPU Core 1 PECI Temperature", "CPU Proximity Temperature", \
500 				  "CPU Core 2 PECI Temperature", "Intel GPU Temperature", \
501 				  "CPU System Agent Core PECI Temperature", \
502 				  "CPU Core Temperature", "CPU PECI DTS Temperature", \
503 				  "Memory Proximity Temperature", \
504 				  "Platform Controller Hub Die Temperature", \
505 				  "Wireless Module Proximity Temperature", \
506 				  "Thunderbolt Diode Temperature", \
507 				  "Logic Board temperature", }
508 
509 #define ASMC_MP1_TEMPS		{ "TA0P", \
510 				  "TCAH", "TCBH", \
511 				  "TC0P", "TC0C", "TC1C", \
512 				  "TC2C", "TC3C", "THTG", \
513 				  "TH0P", "TH1P", \
514 				  "TH2P", "TH3P", \
515 				  "TM0P", "TM1P", "TM2P", \
516 				  "TM8P", "TM9P", "TMAP", \
517 				  "TM0S", "TM1S", "TM2P", "TM3S", \
518 				  "TM8S", "TM9S", "TMAS", "TMBS", \
519 				  "TN0H", "TS0C", \
520 				  "Tp0C", "Tp1C", "Tv0S", "Tv1S", NULL }
521 
522 #define ASMC_MP1_TEMPNAMES	{ "ambient", \
523 				  "cpu_a_heatsink", "cpu_b_heatsink", \
524 				  "cpu_a_proximity", "cpu_core0", "cpu_core1", \
525 				  "cpu_core2", "cpu_core3", "THTG", \
526 				  "hdd_bay0", "hdd_bay1", \
527 				  "hdd_bay2", "hdd_bay3", \
528 				  "memory_card_a_proximity0", \
529 				  "memory_card_a_proximity1", \
530 				  "memory_card_a_proximity2", \
531 				  "memory_card_b_proximity0", \
532 				  "memory_card_b_proximity1", \
533 				  "memory_card_b_proximity2", \
534 				  "memory_card_a_slot0", \
535 				  "memory_card_a_slot1", \
536 				  "memory_card_a_slot2", \
537 				  "memory_card_a_slot3", \
538 				  "memory_card_b_slot0", \
539 				  "memory_card_b_slot1", \
540 				  "memory_card_b_slot2", \
541 				  "memory_card_b_slot3", \
542 				  "mch_heatsink", "expansion_slots", \
543 				  "power_supply_loc0", "power_supply_loc1", \
544 				  "Tv0S", "Tv1S", }
545 
546 #define ASMC_MP1_TEMPDESCS	{ "Ambient Air", \
547 				  "CPU A Heatsink", "CPU B Heatsink", \
548 				  "CPU A Proximity", \
549 				  "CPU Core 1", "CPU Core 2", \
550 				  "CPU Core 3", "CPU Core 4", "THTG", \
551 				  "Hard Drive Bay 1", "Hard Drive Bay 2", \
552 				  "Hard Drive Bay 3", "Hard Drive Bay 4", \
553 				  "Memory Riser A, Proximity 1", \
554 				  "Memory Riser A, Proximity 2", \
555 				  "Memory Riser A, Proximity 3", \
556 				  "Memory Riser B, Proximity 1", \
557 				  "Memory Riser B, Proximity 2", \
558 				  "Memory Riser B, Proximity 3", \
559 				  "Memory Riser A, Slot 1", \
560 				  "Memory Riser A, Slot 2", \
561 				  "Memory Riser A, Slot 3", \
562 				  "Memory Riser A, Slot 4", \
563 				  "Memory Riser B, Slot 1", \
564 				  "Memory Riser B, Slot 2", \
565 				  "Memory Riser B, Slot 3", \
566 				  "Memory Riser B, Slot 4", \
567 				  "MCH Heatsink", "Expansion Slots", \
568 				  "Power Supply, Location 1", \
569 				  "Power Supply, Location 2", \
570 				  "Tv0S", "Tv1S", }
571 
572 #define ASMC_MP2_TEMPS		{ "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \
573 				  "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \
574 				  "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \
575 				  "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \
576 				  "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \
577 				  "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \
578 				  "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \
579 				  NULL }
580 
581 #define ASMC_MP2_TEMPNAMES	{ "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \
582 				  "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \
583 				  "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \
584 				  "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \
585 				  "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \
586 				  "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \
587 				  "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", }
588 
589 #define ASMC_MP2_TEMPDESCS	{ "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \
590 				  "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \
591 				  "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \
592 				  "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \
593 				  "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \
594 				  "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \
595 				  "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", }
596 
597 #define ASMC_MP5_TEMPS		{ "TA0P", "TCAC", "TCAD", "TCAG", "TCAH", \
598 				  "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \
599 				  "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \
600 				  "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \
601 				  "TH4F", "TH4P", "TH4V", "THPS", "THTG", \
602 				  "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \
603 				  "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \
604 				  "TM7V", "TM8P", "TM8V", "TM9V", "TMA1", \
605 				  "TMA2", "TMA3", "TMA4", "TMB1", "TMB2", \
606 				  "TMB3", "TMB4", "TMHS", "TMLS", "TMPS", \
607 				  "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \
608 				  "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \
609 				  "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \
610 				  "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \
611 				  "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", \
612 				  NULL }
613 
614 #define ASMC_MP5_TEMPNAMES	{ "ambient", "TCAC", "TCAD", "TCAG", "TCAH", \
615 				  "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \
616 				  "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \
617 				  "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \
618 				  "TH4F", "TH4P", "TH4V", "THPS", "THTG", \
619 				  "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \
620 				  "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \
621 				  "TM7V", "TM8P", "TM8V", "TM9V", "ram_a1", \
622 				  "ram_a2", "ram_a3", "ram_a4", "ram_b1", "ram_b2", \
623 				  "ram_b3", "ram_b4", "TMHS", "TMLS", "TMPS", \
624 				  "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \
625 				  "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \
626 				  "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \
627 				  "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \
628 				  "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", }
629 
630 #define ASMC_MP5_TEMPDESCS	{ "TA0P", "TCAC", "TCAD", "TCAG", "TCAH", \
631 				  "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \
632 				  "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \
633 				  "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \
634 				  "TH4F", "TH4P", "TH4V", "THPS", "THTG", \
635 				  "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \
636 				  "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \
637 				  "TM7V", "TM8P", "TM8V", "TM9V", "TMA1", \
638 				  "TMA2", "TMA3", "TMA4", "TMB1", "TMB2", \
639 				  "TMB3", "TMB4", "TMHS", "TMLS", "TMPS", \
640 				  "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \
641 				  "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \
642 				  "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \
643 				  "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \
644 				  "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", }
645 
646 #define ASMC_MP6_TEMPS		{ "TA0P", "TA1P", "TC0P", "TG0D", "TG0P", \
647 				  "TG1D", "TG1P", "TM0P", "TM1P", NULL }
648 
649 #define ASMC_MP6_TEMPNAMES	{ "ambient_air_1", "ambient_air_2", \
650 				  "cpu_proximity", "gpu_diode_1", \
651 				  "gpu_proximity_1", "gpu_diode_2", \
652 				  "gpu_proximity_2", "mem_proximity_1", \
653 				  "mem_proximity_2" }
654 
655 #define ASMC_MP6_TEMPDESCS	{ "Ambient Air 1", "Ambient Air 2", \
656 				  "CPU Proximity", "GPU Diode 1", \
657 				  "GPU Proximity 1", "GPU Diode 2", \
658 				  "GPU Proximity 2", "Memory Bank A", \
659 				  "Memory Bank B" }
660 
661 #define	ASMC_MBA_TEMPS		{ "TB0T", NULL }
662 #define	ASMC_MBA_TEMPNAMES	{ "enclosure" }
663 #define	ASMC_MBA_TEMPDESCS	{ "Enclosure Bottom" }
664 
665 #define	ASMC_MBA3_TEMPS		{ "TB0T", "TB1T", "TB2T", \
666 				  "TC0D", "TC0E", "TC0P", NULL }
667 
668 #define	ASMC_MBA3_TEMPNAMES	{ "enclosure", "TB1T", "TB2T", \
669 				  "TC0D", "TC0E", "TC0P" }
670 
671 #define	ASMC_MBA3_TEMPDESCS	{ "Enclosure Bottom", "TB1T", "TB2T", \
672 				  "TC0D", "TC0E", "TC0P" }
673 
674 #define	ASMC_MBA4_TEMPS		{ "TB0T", "TB1T", "TB2T", "TC0C", \
675 				  "TC0D", "TC0E", "TC0F", "TC0P", \
676 				  "TC1C", "TC2C", "TCGC", "TCSA", \
677 				  "TH0F", "TH0J", "TH0O", "TH0o", \
678 				  "TM0P", "TPCD", "Ta0P", "Th1H", \
679 				  "Tm0P", "Tm1P", "Ts0P", "Ts0S", \
680 				  NULL }
681 
682 #define	ASMC_MBA4_TEMPNAMES	{ "TB0T", "TB1T", "TB2T", "TC0C", \
683 				  "TC0D", "TC0E", "TC0F", "TC0P", \
684 				  "TC1C", "TC2C", "TCGC", "TCSA", \
685 				  "TH0F", "TH0J", "TH0O", "TH0o", \
686 				  "TM0P", "TPCD", "Ta0P", "Th1H", \
687 				  "Tm0P", "Tm1P", "Ts0P", "Ts0S", \
688 				  NULL }
689 
690 #define	ASMC_MBA4_TEMPDESCS	{ "TB0T", "TB1T", "TB2T", "TC0C", \
691 				  "TC0D", "TC0E", "TC0F", "TC0P", \
692 				  "TC1C", "TC2C", "TCGC", "TCSA", \
693 				  "TH0F", "TH0J", "TH0O", "TH0o", \
694 				  "TM0P", "TPCD", "Ta0P", "Th1H", \
695 				  "Tm0P", "Tm1P", "Ts0P", "Ts0S", \
696 				  NULL }
697 
698 #define	ASMC_MBA5_TEMPS		{ "TB0T", "TB1T", "TB2T", "TC0C", \
699                          	  "TC0D", "TC0E", "TC0F", "TC0P", \
700 	                          "TC1C", "TC2C", "TCGC", "TCSA", \
701 	                          "TCXC", "THSP", "TM0P", "TPCD", \
702 	                          "Ta0P", "Th1H", "Tm0P", "Tm1P", \
703 	                          "Ts0P", "Ts0S", NULL }
704 
705 #define	ASMC_MBA5_TEMPNAMES	{ "enclosure1", "enclosure2", "enclosure3", "TC0C", \
706 	                          "cpudiode", "cputemp1", "cputemp2", "cpuproximity", \
707 	                          "cpucore1", "cpucore2", "cpupeci", "pecisa", \
708 	                          "TCXC", "THSP", "memorybank", "pchdie", \
709 	                          "Ta0P", "heatpipe", "mainboardproximity1", "mainboardproximity2", \
710 	                          "palmrest", "memoryproximity" }
711 
712 #define	ASMC_MBA5_TEMPDESCS	{ "Enclosure Bottom 1", "Enclosure Bottom 2", "Enclosure Bottom 3", "TC0C",\
713 	                          "CPU Diode", "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \
714 	                          "CPU Core 1", "CPU Core 2", "CPU Peci Core", "PECI SA", \
715 	                          "TCXC", "THSP", "Memory Bank A", "PCH Die", \
716 	                          "Ta0P", "Heatpipe", "Mainboard Proximity 1", "Mainboard Proximity 2", \
717 	                          "Palm Rest", "Memory Proximity" }
718 
719 #define	ASMC_MBA7_TEMPS		{ "TB0T", "TB1T", "TB2T", \
720                          	  "TC0E", "TC0F", "TC0P", \
721 	                          "TC1C", "TC2C", \
722 	                          "TCGC", "TCSA", "TCXC", \
723 	                          "THSP", "TM0P", "TPCD", \
724 	                          "TW0P" "Ta0P", "Th1H", \
725 	                          "Tm0P", "Ts0P", "Ts0S", NULL }
726 
727 #define	ASMC_MBA7_TEMPNAMES	{ "enclosure1", "enclosure2", "enclosure3", \
728 	                          "cputemp1", "cputemp2", "cpuproximity", \
729 	                          "cpucore1", "cpucore2", \
730 	                          "pecigpu", "pecisa", "pecicpu", \
731 	                          "thunderboltproximity", "memorybank", "pchdie", \
732 	                          "wirelessproximity", "airflowproximity", "heatpipe", \
733 	                          "mainboardproximity", "palmrest", "memoryproximity" }
734 
735 #define	ASMC_MBA7_TEMPDESCS	{ "Enclosure Bottom 1", "Enclosure Bottom 2", "Enclosure Bottom 3", \
736 	                          "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \
737 	                          "CPU Core 1", "CPU Core 2", \
738 	                          "PECI GPU", "PECI SA", "PECI CPU", \
739 	                          "Thunderbolt Proximity", "Memory Bank A", "PCH Die", \
740 	                          "Wireless Proximity", "Airflow Proxmity", "Heatpipe", \
741 	                          "Mainboard Proximity", "Palm Rest", "Memory Proximity" }
742