xref: /openbmc/linux/drivers/hwmon/peci/dimmtemp.c (revision c0c45238fcf44b05c86f2f7d1dda136df7a83ff9)
1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright (c) 2018-2021 Intel Corporation
3 
4 #include <linux/auxiliary_bus.h>
5 #include <linux/bitfield.h>
6 #include <linux/bitops.h>
7 #include <linux/devm-helpers.h>
8 #include <linux/hwmon.h>
9 #include <linux/jiffies.h>
10 #include <linux/module.h>
11 #include <linux/peci.h>
12 #include <linux/peci-cpu.h>
13 #include <linux/units.h>
14 #include <linux/workqueue.h>
15 
16 #include "common.h"
17 
18 #define DIMM_MASK_CHECK_DELAY_JIFFIES	msecs_to_jiffies(5000)
19 
20 /* Max number of channel ranks and DIMM index per channel */
21 #define CHAN_RANK_MAX_ON_HSX	8
22 #define DIMM_IDX_MAX_ON_HSX	3
23 #define CHAN_RANK_MAX_ON_BDX	4
24 #define DIMM_IDX_MAX_ON_BDX	3
25 #define CHAN_RANK_MAX_ON_BDXD	2
26 #define DIMM_IDX_MAX_ON_BDXD	2
27 #define CHAN_RANK_MAX_ON_SKX	6
28 #define DIMM_IDX_MAX_ON_SKX	2
29 #define CHAN_RANK_MAX_ON_ICX	8
30 #define DIMM_IDX_MAX_ON_ICX	2
31 #define CHAN_RANK_MAX_ON_ICXD	4
32 #define DIMM_IDX_MAX_ON_ICXD	2
33 
34 #define CHAN_RANK_MAX		CHAN_RANK_MAX_ON_HSX
35 #define DIMM_IDX_MAX		DIMM_IDX_MAX_ON_HSX
36 #define DIMM_NUMS_MAX		(CHAN_RANK_MAX * DIMM_IDX_MAX)
37 
38 #define CPU_SEG_MASK		GENMASK(23, 16)
39 #define GET_CPU_SEG(x)		(((x) & CPU_SEG_MASK) >> 16)
40 #define CPU_BUS_MASK		GENMASK(7, 0)
41 #define GET_CPU_BUS(x)		((x) & CPU_BUS_MASK)
42 
43 #define DIMM_TEMP_MAX		GENMASK(15, 8)
44 #define DIMM_TEMP_CRIT		GENMASK(23, 16)
45 #define GET_TEMP_MAX(x)		(((x) & DIMM_TEMP_MAX) >> 8)
46 #define GET_TEMP_CRIT(x)	(((x) & DIMM_TEMP_CRIT) >> 16)
47 
48 #define NO_DIMM_RETRY_COUNT_MAX	5
49 
50 struct peci_dimmtemp;
51 
52 struct dimm_info {
53 	int chan_rank_max;
54 	int dimm_idx_max;
55 	u8 min_peci_revision;
56 	int (*read_thresholds)(struct peci_dimmtemp *priv, int dimm_order,
57 			       int chan_rank, u32 *data);
58 };
59 
60 struct peci_dimm_thresholds {
61 	long temp_max;
62 	long temp_crit;
63 	struct peci_sensor_state state;
64 };
65 
66 enum peci_dimm_threshold_type {
67 	temp_max_type,
68 	temp_crit_type,
69 };
70 
71 struct peci_dimmtemp {
72 	struct peci_device *peci_dev;
73 	struct device *dev;
74 	const char *name;
75 	const struct dimm_info *gen_info;
76 	struct delayed_work detect_work;
77 	struct {
78 		struct peci_sensor_data temp;
79 		struct peci_dimm_thresholds thresholds;
80 	} dimm[DIMM_NUMS_MAX];
81 	char **dimmtemp_label;
82 	DECLARE_BITMAP(dimm_mask, DIMM_NUMS_MAX);
83 	u8 no_dimm_retry_count;
84 };
85 
86 static u8 __dimm_temp(u32 reg, int dimm_order)
87 {
88 	return (reg >> (dimm_order * 8)) & 0xff;
89 }
90 
91 static int get_dimm_temp(struct peci_dimmtemp *priv, int dimm_no, long *val)
92 {
93 	int dimm_order = dimm_no % priv->gen_info->dimm_idx_max;
94 	int chan_rank = dimm_no / priv->gen_info->dimm_idx_max;
95 	int ret = 0;
96 	u32 data;
97 
98 	mutex_lock(&priv->dimm[dimm_no].temp.state.lock);
99 	if (!peci_sensor_need_update(&priv->dimm[dimm_no].temp.state))
100 		goto skip_update;
101 
102 	ret = peci_pcs_read(priv->peci_dev, PECI_PCS_DDR_DIMM_TEMP, chan_rank, &data);
103 	if (ret)
104 		goto unlock;
105 
106 	priv->dimm[dimm_no].temp.value = __dimm_temp(data, dimm_order) * MILLIDEGREE_PER_DEGREE;
107 
108 	peci_sensor_mark_updated(&priv->dimm[dimm_no].temp.state);
109 
110 skip_update:
111 	*val = priv->dimm[dimm_no].temp.value;
112 unlock:
113 	mutex_unlock(&priv->dimm[dimm_no].temp.state.lock);
114 	return ret;
115 }
116 
117 static int update_thresholds(struct peci_dimmtemp *priv, int dimm_no)
118 {
119 	int dimm_order = dimm_no % priv->gen_info->dimm_idx_max;
120 	int chan_rank = dimm_no / priv->gen_info->dimm_idx_max;
121 	u32 data;
122 	int ret;
123 
124 	if (!peci_sensor_need_update(&priv->dimm[dimm_no].thresholds.state))
125 		return 0;
126 
127 	ret = priv->gen_info->read_thresholds(priv, dimm_order, chan_rank, &data);
128 	if (ret == -ENODATA) /* Use default or previous value */
129 		return 0;
130 	if (ret)
131 		return ret;
132 
133 	priv->dimm[dimm_no].thresholds.temp_max = GET_TEMP_MAX(data) * MILLIDEGREE_PER_DEGREE;
134 	priv->dimm[dimm_no].thresholds.temp_crit = GET_TEMP_CRIT(data) * MILLIDEGREE_PER_DEGREE;
135 
136 	peci_sensor_mark_updated(&priv->dimm[dimm_no].thresholds.state);
137 
138 	return 0;
139 }
140 
141 static int get_dimm_thresholds(struct peci_dimmtemp *priv, enum peci_dimm_threshold_type type,
142 			       int dimm_no, long *val)
143 {
144 	int ret;
145 
146 	mutex_lock(&priv->dimm[dimm_no].thresholds.state.lock);
147 	ret = update_thresholds(priv, dimm_no);
148 	if (ret)
149 		goto unlock;
150 
151 	switch (type) {
152 	case temp_max_type:
153 		*val = priv->dimm[dimm_no].thresholds.temp_max;
154 		break;
155 	case temp_crit_type:
156 		*val = priv->dimm[dimm_no].thresholds.temp_crit;
157 		break;
158 	default:
159 		ret = -EOPNOTSUPP;
160 		break;
161 	}
162 unlock:
163 	mutex_unlock(&priv->dimm[dimm_no].thresholds.state.lock);
164 
165 	return ret;
166 }
167 
168 static int dimmtemp_read_string(struct device *dev,
169 				enum hwmon_sensor_types type,
170 				u32 attr, int channel, const char **str)
171 {
172 	struct peci_dimmtemp *priv = dev_get_drvdata(dev);
173 
174 	if (attr != hwmon_temp_label)
175 		return -EOPNOTSUPP;
176 
177 	*str = (const char *)priv->dimmtemp_label[channel];
178 
179 	return 0;
180 }
181 
182 static int dimmtemp_read(struct device *dev, enum hwmon_sensor_types type,
183 			 u32 attr, int channel, long *val)
184 {
185 	struct peci_dimmtemp *priv = dev_get_drvdata(dev);
186 
187 	switch (attr) {
188 	case hwmon_temp_input:
189 		return get_dimm_temp(priv, channel, val);
190 	case hwmon_temp_max:
191 		return get_dimm_thresholds(priv, temp_max_type, channel, val);
192 	case hwmon_temp_crit:
193 		return get_dimm_thresholds(priv, temp_crit_type, channel, val);
194 	default:
195 		break;
196 	}
197 
198 	return -EOPNOTSUPP;
199 }
200 
201 static umode_t dimmtemp_is_visible(const void *data, enum hwmon_sensor_types type,
202 				   u32 attr, int channel)
203 {
204 	const struct peci_dimmtemp *priv = data;
205 
206 	if (test_bit(channel, priv->dimm_mask))
207 		return 0444;
208 
209 	return 0;
210 }
211 
212 static const struct hwmon_ops peci_dimmtemp_ops = {
213 	.is_visible = dimmtemp_is_visible,
214 	.read_string = dimmtemp_read_string,
215 	.read = dimmtemp_read,
216 };
217 
218 static int check_populated_dimms(struct peci_dimmtemp *priv)
219 {
220 	int chan_rank_max = priv->gen_info->chan_rank_max;
221 	int dimm_idx_max = priv->gen_info->dimm_idx_max;
222 	u32 chan_rank_empty = 0;
223 	u64 dimm_mask = 0;
224 	int chan_rank, dimm_idx, ret;
225 	u32 pcs;
226 
227 	BUILD_BUG_ON(BITS_PER_TYPE(chan_rank_empty) < CHAN_RANK_MAX);
228 	BUILD_BUG_ON(BITS_PER_TYPE(dimm_mask) < DIMM_NUMS_MAX);
229 	if (chan_rank_max * dimm_idx_max > DIMM_NUMS_MAX) {
230 		WARN_ONCE(1, "Unsupported number of DIMMs - chan_rank_max: %d, dimm_idx_max: %d",
231 			  chan_rank_max, dimm_idx_max);
232 		return -EINVAL;
233 	}
234 
235 	for (chan_rank = 0; chan_rank < chan_rank_max; chan_rank++) {
236 		ret = peci_pcs_read(priv->peci_dev, PECI_PCS_DDR_DIMM_TEMP, chan_rank, &pcs);
237 		if (ret) {
238 			/*
239 			 * Overall, we expect either success or -EINVAL in
240 			 * order to determine whether DIMM is populated or not.
241 			 * For anything else we fall back to deferring the
242 			 * detection to be performed at a later point in time.
243 			 */
244 			if (ret == -EINVAL) {
245 				chan_rank_empty |= BIT(chan_rank);
246 				continue;
247 			}
248 
249 			return -EAGAIN;
250 		}
251 
252 		for (dimm_idx = 0; dimm_idx < dimm_idx_max; dimm_idx++)
253 			if (__dimm_temp(pcs, dimm_idx))
254 				dimm_mask |= BIT(chan_rank * dimm_idx_max + dimm_idx);
255 	}
256 
257 	/*
258 	 * If we got all -EINVALs, it means that the CPU doesn't have any
259 	 * DIMMs. Unfortunately, it may also happen at the very start of
260 	 * host platform boot. Retrying a couple of times lets us make sure
261 	 * that the state is persistent.
262 	 */
263 	if (chan_rank_empty == GENMASK(chan_rank_max - 1, 0)) {
264 		if (priv->no_dimm_retry_count < NO_DIMM_RETRY_COUNT_MAX) {
265 			priv->no_dimm_retry_count++;
266 
267 			return -EAGAIN;
268 		}
269 
270 		return -ENODEV;
271 	}
272 
273 	/*
274 	 * It's possible that memory training is not done yet. In this case we
275 	 * defer the detection to be performed at a later point in time.
276 	 */
277 	if (!dimm_mask) {
278 		priv->no_dimm_retry_count = 0;
279 		return -EAGAIN;
280 	}
281 
282 	dev_dbg(priv->dev, "Scanned populated DIMMs: %#llx\n", dimm_mask);
283 
284 	bitmap_from_u64(priv->dimm_mask, dimm_mask);
285 
286 	return 0;
287 }
288 
289 static int create_dimm_temp_label(struct peci_dimmtemp *priv, int chan)
290 {
291 	int rank = chan / priv->gen_info->dimm_idx_max;
292 	int idx = chan % priv->gen_info->dimm_idx_max;
293 
294 	priv->dimmtemp_label[chan] = devm_kasprintf(priv->dev, GFP_KERNEL,
295 						    "DIMM %c%d", 'A' + rank,
296 						    idx + 1);
297 	if (!priv->dimmtemp_label[chan])
298 		return -ENOMEM;
299 
300 	return 0;
301 }
302 
303 static const u32 peci_dimmtemp_temp_channel_config[] = {
304 	[0 ... DIMM_NUMS_MAX - 1] = HWMON_T_LABEL | HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT,
305 	0
306 };
307 
308 static const struct hwmon_channel_info peci_dimmtemp_temp_channel = {
309 	.type = hwmon_temp,
310 	.config = peci_dimmtemp_temp_channel_config,
311 };
312 
313 static const struct hwmon_channel_info *peci_dimmtemp_temp_info[] = {
314 	&peci_dimmtemp_temp_channel,
315 	NULL
316 };
317 
318 static const struct hwmon_chip_info peci_dimmtemp_chip_info = {
319 	.ops = &peci_dimmtemp_ops,
320 	.info = peci_dimmtemp_temp_info,
321 };
322 
323 static int create_dimm_temp_info(struct peci_dimmtemp *priv)
324 {
325 	int ret, i, channels;
326 	struct device *dev;
327 
328 	/*
329 	 * We expect to either find populated DIMMs and carry on with creating
330 	 * sensors, or find out that there are no DIMMs populated.
331 	 * All other states mean that the platform never reached the state that
332 	 * allows to check DIMM state - causing us to retry later on.
333 	 */
334 	ret = check_populated_dimms(priv);
335 	if (ret == -ENODEV) {
336 		dev_dbg(priv->dev, "No DIMMs found\n");
337 		return 0;
338 	} else if (ret) {
339 		schedule_delayed_work(&priv->detect_work, DIMM_MASK_CHECK_DELAY_JIFFIES);
340 		dev_dbg(priv->dev, "Deferred populating DIMM temp info\n");
341 		return ret;
342 	}
343 
344 	channels = priv->gen_info->chan_rank_max * priv->gen_info->dimm_idx_max;
345 
346 	priv->dimmtemp_label = devm_kzalloc(priv->dev, channels * sizeof(char *), GFP_KERNEL);
347 	if (!priv->dimmtemp_label)
348 		return -ENOMEM;
349 
350 	for_each_set_bit(i, priv->dimm_mask, DIMM_NUMS_MAX) {
351 		ret = create_dimm_temp_label(priv, i);
352 		if (ret)
353 			return ret;
354 		mutex_init(&priv->dimm[i].thresholds.state.lock);
355 		mutex_init(&priv->dimm[i].temp.state.lock);
356 	}
357 
358 	dev = devm_hwmon_device_register_with_info(priv->dev, priv->name, priv,
359 						   &peci_dimmtemp_chip_info, NULL);
360 	if (IS_ERR(dev)) {
361 		dev_err(priv->dev, "Failed to register hwmon device\n");
362 		return PTR_ERR(dev);
363 	}
364 
365 	dev_dbg(priv->dev, "%s: sensor '%s'\n", dev_name(dev), priv->name);
366 
367 	return 0;
368 }
369 
370 static void create_dimm_temp_info_delayed(struct work_struct *work)
371 {
372 	struct peci_dimmtemp *priv = container_of(to_delayed_work(work),
373 						  struct peci_dimmtemp,
374 						  detect_work);
375 	int ret;
376 
377 	ret = create_dimm_temp_info(priv);
378 	if (ret && ret != -EAGAIN)
379 		dev_err(priv->dev, "Failed to populate DIMM temp info\n");
380 }
381 
382 static int peci_dimmtemp_probe(struct auxiliary_device *adev, const struct auxiliary_device_id *id)
383 {
384 	struct device *dev = &adev->dev;
385 	struct peci_device *peci_dev = to_peci_device(dev->parent);
386 	struct peci_dimmtemp *priv;
387 	int ret;
388 
389 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
390 	if (!priv)
391 		return -ENOMEM;
392 
393 	priv->name = devm_kasprintf(dev, GFP_KERNEL, "peci_dimmtemp.cpu%d",
394 				    peci_dev->info.socket_id);
395 	if (!priv->name)
396 		return -ENOMEM;
397 
398 	priv->dev = dev;
399 	priv->peci_dev = peci_dev;
400 	priv->gen_info = (const struct dimm_info *)id->driver_data;
401 
402 	/*
403 	 * This is just a sanity check. Since we're using commands that are
404 	 * guaranteed to be supported on a given platform, we should never see
405 	 * revision lower than expected.
406 	 */
407 	if (peci_dev->info.peci_revision < priv->gen_info->min_peci_revision)
408 		dev_warn(priv->dev,
409 			 "Unexpected PECI revision %#x, some features may be unavailable\n",
410 			 peci_dev->info.peci_revision);
411 
412 	ret = devm_delayed_work_autocancel(priv->dev, &priv->detect_work,
413 					   create_dimm_temp_info_delayed);
414 	if (ret)
415 		return ret;
416 
417 	ret = create_dimm_temp_info(priv);
418 	if (ret && ret != -EAGAIN) {
419 		dev_err(dev, "Failed to populate DIMM temp info\n");
420 		return ret;
421 	}
422 
423 	return 0;
424 }
425 
426 static int
427 read_thresholds_hsx(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u32 *data)
428 {
429 	u8 dev, func;
430 	u16 reg;
431 	int ret;
432 
433 	/*
434 	 * Device 20, Function 0: IMC 0 channel 0 -> rank 0
435 	 * Device 20, Function 1: IMC 0 channel 1 -> rank 1
436 	 * Device 21, Function 0: IMC 0 channel 2 -> rank 2
437 	 * Device 21, Function 1: IMC 0 channel 3 -> rank 3
438 	 * Device 23, Function 0: IMC 1 channel 0 -> rank 4
439 	 * Device 23, Function 1: IMC 1 channel 1 -> rank 5
440 	 * Device 24, Function 0: IMC 1 channel 2 -> rank 6
441 	 * Device 24, Function 1: IMC 1 channel 3 -> rank 7
442 	 */
443 	dev = 20 + chan_rank / 2 + chan_rank / 4;
444 	func = chan_rank % 2;
445 	reg = 0x120 + dimm_order * 4;
446 
447 	ret = peci_pci_local_read(priv->peci_dev, 1, dev, func, reg, data);
448 	if (ret)
449 		return ret;
450 
451 	return 0;
452 }
453 
454 static int
455 read_thresholds_bdxd(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u32 *data)
456 {
457 	u8 dev, func;
458 	u16 reg;
459 	int ret;
460 
461 	/*
462 	 * Device 10, Function 2: IMC 0 channel 0 -> rank 0
463 	 * Device 10, Function 6: IMC 0 channel 1 -> rank 1
464 	 * Device 12, Function 2: IMC 1 channel 0 -> rank 2
465 	 * Device 12, Function 6: IMC 1 channel 1 -> rank 3
466 	 */
467 	dev = 10 + chan_rank / 2 * 2;
468 	func = (chan_rank % 2) ? 6 : 2;
469 	reg = 0x120 + dimm_order * 4;
470 
471 	ret = peci_pci_local_read(priv->peci_dev, 2, dev, func, reg, data);
472 	if (ret)
473 		return ret;
474 
475 	return 0;
476 }
477 
478 static int
479 read_thresholds_skx(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u32 *data)
480 {
481 	u8 dev, func;
482 	u16 reg;
483 	int ret;
484 
485 	/*
486 	 * Device 10, Function 2: IMC 0 channel 0 -> rank 0
487 	 * Device 10, Function 6: IMC 0 channel 1 -> rank 1
488 	 * Device 11, Function 2: IMC 0 channel 2 -> rank 2
489 	 * Device 12, Function 2: IMC 1 channel 0 -> rank 3
490 	 * Device 12, Function 6: IMC 1 channel 1 -> rank 4
491 	 * Device 13, Function 2: IMC 1 channel 2 -> rank 5
492 	 */
493 	dev = 10 + chan_rank / 3 * 2 + (chan_rank % 3 == 2 ? 1 : 0);
494 	func = chan_rank % 3 == 1 ? 6 : 2;
495 	reg = 0x120 + dimm_order * 4;
496 
497 	ret = peci_pci_local_read(priv->peci_dev, 2, dev, func, reg, data);
498 	if (ret)
499 		return ret;
500 
501 	return 0;
502 }
503 
504 static int
505 read_thresholds_icx(struct peci_dimmtemp *priv, int dimm_order, int chan_rank, u32 *data)
506 {
507 	u32 reg_val;
508 	u64 offset;
509 	int ret;
510 	u8 dev;
511 
512 	ret = peci_ep_pci_local_read(priv->peci_dev, 0, 13, 0, 2, 0xd4, &reg_val);
513 	if (ret || !(reg_val & BIT(31)))
514 		return -ENODATA; /* Use default or previous value */
515 
516 	ret = peci_ep_pci_local_read(priv->peci_dev, 0, 13, 0, 2, 0xd0, &reg_val);
517 	if (ret)
518 		return -ENODATA; /* Use default or previous value */
519 
520 	/*
521 	 * Device 26, Offset 224e0: IMC 0 channel 0 -> rank 0
522 	 * Device 26, Offset 264e0: IMC 0 channel 1 -> rank 1
523 	 * Device 27, Offset 224e0: IMC 1 channel 0 -> rank 2
524 	 * Device 27, Offset 264e0: IMC 1 channel 1 -> rank 3
525 	 * Device 28, Offset 224e0: IMC 2 channel 0 -> rank 4
526 	 * Device 28, Offset 264e0: IMC 2 channel 1 -> rank 5
527 	 * Device 29, Offset 224e0: IMC 3 channel 0 -> rank 6
528 	 * Device 29, Offset 264e0: IMC 3 channel 1 -> rank 7
529 	 */
530 	dev = 26 + chan_rank / 2;
531 	offset = 0x224e0 + dimm_order * 4 + (chan_rank % 2) * 0x4000;
532 
533 	ret = peci_mmio_read(priv->peci_dev, 0, GET_CPU_SEG(reg_val), GET_CPU_BUS(reg_val),
534 			     dev, 0, offset, data);
535 	if (ret)
536 		return ret;
537 
538 	return 0;
539 }
540 
541 static const struct dimm_info dimm_hsx = {
542 	.chan_rank_max	= CHAN_RANK_MAX_ON_HSX,
543 	.dimm_idx_max	= DIMM_IDX_MAX_ON_HSX,
544 	.min_peci_revision = 0x33,
545 	.read_thresholds = &read_thresholds_hsx,
546 };
547 
548 static const struct dimm_info dimm_bdx = {
549 	.chan_rank_max	= CHAN_RANK_MAX_ON_BDX,
550 	.dimm_idx_max	= DIMM_IDX_MAX_ON_BDX,
551 	.min_peci_revision = 0x33,
552 	.read_thresholds = &read_thresholds_hsx,
553 };
554 
555 static const struct dimm_info dimm_bdxd = {
556 	.chan_rank_max	= CHAN_RANK_MAX_ON_BDXD,
557 	.dimm_idx_max	= DIMM_IDX_MAX_ON_BDXD,
558 	.min_peci_revision = 0x33,
559 	.read_thresholds = &read_thresholds_bdxd,
560 };
561 
562 static const struct dimm_info dimm_skx = {
563 	.chan_rank_max	= CHAN_RANK_MAX_ON_SKX,
564 	.dimm_idx_max	= DIMM_IDX_MAX_ON_SKX,
565 	.min_peci_revision = 0x33,
566 	.read_thresholds = &read_thresholds_skx,
567 };
568 
569 static const struct dimm_info dimm_icx = {
570 	.chan_rank_max	= CHAN_RANK_MAX_ON_ICX,
571 	.dimm_idx_max	= DIMM_IDX_MAX_ON_ICX,
572 	.min_peci_revision = 0x40,
573 	.read_thresholds = &read_thresholds_icx,
574 };
575 
576 static const struct dimm_info dimm_icxd = {
577 	.chan_rank_max	= CHAN_RANK_MAX_ON_ICXD,
578 	.dimm_idx_max	= DIMM_IDX_MAX_ON_ICXD,
579 	.min_peci_revision = 0x40,
580 	.read_thresholds = &read_thresholds_icx,
581 };
582 
583 static const struct auxiliary_device_id peci_dimmtemp_ids[] = {
584 	{
585 		.name = "peci_cpu.dimmtemp.hsx",
586 		.driver_data = (kernel_ulong_t)&dimm_hsx,
587 	},
588 	{
589 		.name = "peci_cpu.dimmtemp.bdx",
590 		.driver_data = (kernel_ulong_t)&dimm_bdx,
591 	},
592 	{
593 		.name = "peci_cpu.dimmtemp.bdxd",
594 		.driver_data = (kernel_ulong_t)&dimm_bdxd,
595 	},
596 	{
597 		.name = "peci_cpu.dimmtemp.skx",
598 		.driver_data = (kernel_ulong_t)&dimm_skx,
599 	},
600 	{
601 		.name = "peci_cpu.dimmtemp.icx",
602 		.driver_data = (kernel_ulong_t)&dimm_icx,
603 	},
604 	{
605 		.name = "peci_cpu.dimmtemp.icxd",
606 		.driver_data = (kernel_ulong_t)&dimm_icxd,
607 	},
608 	{ }
609 };
610 MODULE_DEVICE_TABLE(auxiliary, peci_dimmtemp_ids);
611 
612 static struct auxiliary_driver peci_dimmtemp_driver = {
613 	.probe		= peci_dimmtemp_probe,
614 	.id_table	= peci_dimmtemp_ids,
615 };
616 
617 module_auxiliary_driver(peci_dimmtemp_driver);
618 
619 MODULE_AUTHOR("Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>");
620 MODULE_AUTHOR("Iwona Winiarska <iwona.winiarska@intel.com>");
621 MODULE_DESCRIPTION("PECI dimmtemp driver");
622 MODULE_LICENSE("GPL");
623 MODULE_IMPORT_NS(PECI_CPU);
624