k10temp.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * k10temp.c - AMD Family 10h/11h/12h/14h/15h/16h/17h
  4. * processor hardware monitoring
  5. *
  6. * Copyright (c) 2009 Clemens Ladisch <clemens@ladisch.de>
  7. * Copyright (c) 2020 Guenter Roeck <linux@roeck-us.net>
  8. *
  9. * Implementation notes:
  10. * - CCD register address information as well as the calculation to
  11. * convert raw register values is from https://github.com/ocerman/zenpower.
  12. * The information is not confirmed from chip datasheets, but experiments
  13. * suggest that it provides reasonable temperature values.
  14. */
  15. #include <linux/bitops.h>
  16. #include <linux/err.h>
  17. #include <linux/hwmon.h>
  18. #include <linux/init.h>
  19. #include <linux/module.h>
  20. #include <linux/pci.h>
  21. #include <linux/pci_ids.h>
  22. #include <asm/amd/node.h>
  23. #include <asm/processor.h>
  24. MODULE_DESCRIPTION("AMD Family 10h+ CPU core temperature monitor");
  25. MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
  26. MODULE_LICENSE("GPL");
  27. static bool force;
  28. module_param(force, bool, 0444);
  29. MODULE_PARM_DESC(force, "force loading on processors with erratum 319");
  30. #ifndef PCI_DEVICE_ID_AMD_15H_M70H_NB_F3
  31. #define PCI_DEVICE_ID_AMD_15H_M70H_NB_F3 0x15b3
  32. #endif
  33. /* CPUID function 0x80000001, ebx */
  34. #define CPUID_PKGTYPE_MASK GENMASK(31, 28)
  35. #define CPUID_PKGTYPE_F 0x00000000
  36. #define CPUID_PKGTYPE_AM2R2_AM3 0x10000000
  37. /* DRAM controller (PCI function 2) */
  38. #define REG_DCT0_CONFIG_HIGH 0x094
  39. #define DDR3_MODE BIT(8)
  40. /* miscellaneous (PCI function 3) */
  41. #define REG_HARDWARE_THERMAL_CONTROL 0x64
  42. #define HTC_ENABLE BIT(0)
  43. #define REG_REPORTED_TEMPERATURE 0xa4
  44. #define REG_NORTHBRIDGE_CAPABILITIES 0xe8
  45. #define NB_CAP_HTC BIT(10)
  46. /*
  47. * For F15h M60h and M70h, REG_HARDWARE_THERMAL_CONTROL
  48. * and REG_REPORTED_TEMPERATURE have been moved to
  49. * D0F0xBC_xD820_0C64 [Hardware Temperature Control]
  50. * D0F0xBC_xD820_0CA4 [Reported Temperature Control]
  51. */
  52. #define F15H_M60H_HARDWARE_TEMP_CTRL_OFFSET 0xd8200c64
  53. #define F15H_M60H_REPORTED_TEMP_CTRL_OFFSET 0xd8200ca4
  54. /* Common for Zen CPU families (Family 17h and 18h and 19h and 1Ah) */
  55. #define ZEN_REPORTED_TEMP_CTRL_BASE 0x00059800
  56. #define ZEN_CCD_TEMP(offset, x) (ZEN_REPORTED_TEMP_CTRL_BASE + \
  57. (offset) + ((x) * 4))
  58. #define ZEN_CCD_TEMP_VALID BIT(11)
  59. #define ZEN_CCD_TEMP_MASK GENMASK(10, 0)
  60. #define ZEN_CUR_TEMP_SHIFT 21
  61. #define ZEN_CUR_TEMP_RANGE_SEL_MASK BIT(19)
  62. #define ZEN_CUR_TEMP_TJ_SEL_MASK GENMASK(17, 16)
  63. /*
  64. * AMD's Industrial processor 3255 supports temperature from -40 deg to 105 deg Celsius.
  65. * Use the model name to identify 3255 CPUs and set a flag to display negative temperature.
  66. * Do not round off to zero for negative Tctl or Tdie values if the flag is set
  67. */
  68. #define AMD_I3255_STR "3255"
  69. /*
  70. * PCI Device IDs for AMD's Family 17h-based SOCs.
  71. * Defining locally as IDs are not shared.
  72. */
  73. #define PCI_DEVICE_ID_AMD_17H_M90H_DF_F3 0x1663
  74. /*
  75. * PCI Device IDs for AMD's Family 1Ah-based SOCs.
  76. * Defining locally as IDs are not shared.
  77. */
  78. #define PCI_DEVICE_ID_AMD_1AH_M50H_DF_F3 0x12cb
  79. #define PCI_DEVICE_ID_AMD_1AH_M90H_DF_F3 0x127b
  80. struct k10temp_data {
  81. struct pci_dev *pdev;
  82. void (*read_htcreg)(struct pci_dev *pdev, u32 *regval);
  83. void (*read_tempreg)(struct pci_dev *pdev, u32 *regval);
  84. int temp_offset;
  85. u32 temp_adjust_mask;
  86. u32 show_temp;
  87. bool is_zen;
  88. u32 ccd_offset;
  89. bool disp_negative;
  90. };
  91. #define TCTL_BIT 0
  92. #define TDIE_BIT 1
  93. #define TCCD_BIT(x) ((x) + 2)
  94. #define HAVE_TEMP(d, channel) ((d)->show_temp & BIT(channel))
  95. struct tctl_offset {
  96. u8 model;
  97. char const *id;
  98. int offset;
  99. };
  100. static const struct tctl_offset tctl_offset_table[] = {
  101. { 0x17, "AMD Ryzen 5 1600X", 20000 },
  102. { 0x17, "AMD Ryzen 7 1700X", 20000 },
  103. { 0x17, "AMD Ryzen 7 1800X", 20000 },
  104. { 0x17, "AMD Ryzen 7 2700X", 10000 },
  105. { 0x17, "AMD Ryzen Threadripper 19", 27000 }, /* 19{00,20,50}X */
  106. { 0x17, "AMD Ryzen Threadripper 29", 27000 }, /* 29{20,50,70,90}[W]X */
  107. };
  108. static void read_htcreg_pci(struct pci_dev *pdev, u32 *regval)
  109. {
  110. pci_read_config_dword(pdev, REG_HARDWARE_THERMAL_CONTROL, regval);
  111. }
  112. static void read_tempreg_pci(struct pci_dev *pdev, u32 *regval)
  113. {
  114. pci_read_config_dword(pdev, REG_REPORTED_TEMPERATURE, regval);
  115. }
  116. static void amd_nb_index_read(struct pci_dev *pdev, unsigned int devfn,
  117. unsigned int base, int offset, u32 *val)
  118. {
  119. pci_bus_write_config_dword(pdev->bus, devfn,
  120. base, offset);
  121. pci_bus_read_config_dword(pdev->bus, devfn,
  122. base + 4, val);
  123. }
  124. static void read_htcreg_nb_f15(struct pci_dev *pdev, u32 *regval)
  125. {
  126. amd_nb_index_read(pdev, PCI_DEVFN(0, 0), 0xb8,
  127. F15H_M60H_HARDWARE_TEMP_CTRL_OFFSET, regval);
  128. }
  129. static void read_tempreg_nb_f15(struct pci_dev *pdev, u32 *regval)
  130. {
  131. amd_nb_index_read(pdev, PCI_DEVFN(0, 0), 0xb8,
  132. F15H_M60H_REPORTED_TEMP_CTRL_OFFSET, regval);
  133. }
  134. static u16 amd_pci_dev_to_node_id(struct pci_dev *pdev)
  135. {
  136. return PCI_SLOT(pdev->devfn) - AMD_NODE0_PCI_SLOT;
  137. }
  138. static void read_tempreg_nb_zen(struct pci_dev *pdev, u32 *regval)
  139. {
  140. if (amd_smn_read(amd_pci_dev_to_node_id(pdev),
  141. ZEN_REPORTED_TEMP_CTRL_BASE, regval))
  142. *regval = 0;
  143. }
  144. static int read_ccd_temp_reg(struct k10temp_data *data, int ccd, u32 *regval)
  145. {
  146. u16 node_id = amd_pci_dev_to_node_id(data->pdev);
  147. return amd_smn_read(node_id, ZEN_CCD_TEMP(data->ccd_offset, ccd), regval);
  148. }
  149. static long get_raw_temp(struct k10temp_data *data)
  150. {
  151. u32 regval;
  152. long temp;
  153. data->read_tempreg(data->pdev, &regval);
  154. temp = (regval >> ZEN_CUR_TEMP_SHIFT) * 125;
  155. if ((regval & data->temp_adjust_mask) ||
  156. (regval & ZEN_CUR_TEMP_TJ_SEL_MASK) == ZEN_CUR_TEMP_TJ_SEL_MASK)
  157. temp -= 49000;
  158. return temp;
  159. }
  160. static const char *k10temp_temp_label[] = {
  161. "Tctl",
  162. "Tdie",
  163. "Tccd1",
  164. "Tccd2",
  165. "Tccd3",
  166. "Tccd4",
  167. "Tccd5",
  168. "Tccd6",
  169. "Tccd7",
  170. "Tccd8",
  171. "Tccd9",
  172. "Tccd10",
  173. "Tccd11",
  174. "Tccd12",
  175. };
  176. static int k10temp_read_labels(struct device *dev,
  177. enum hwmon_sensor_types type,
  178. u32 attr, int channel, const char **str)
  179. {
  180. switch (type) {
  181. case hwmon_temp:
  182. *str = k10temp_temp_label[channel];
  183. break;
  184. default:
  185. return -EOPNOTSUPP;
  186. }
  187. return 0;
  188. }
  189. static int k10temp_read_temp(struct device *dev, u32 attr, int channel,
  190. long *val)
  191. {
  192. struct k10temp_data *data = dev_get_drvdata(dev);
  193. int ret = -EOPNOTSUPP;
  194. u32 regval;
  195. switch (attr) {
  196. case hwmon_temp_input:
  197. switch (channel) {
  198. case 0: /* Tctl */
  199. *val = get_raw_temp(data);
  200. if (*val < 0 && !data->disp_negative)
  201. *val = 0;
  202. break;
  203. case 1: /* Tdie */
  204. *val = get_raw_temp(data) - data->temp_offset;
  205. if (*val < 0 && !data->disp_negative)
  206. *val = 0;
  207. break;
  208. case 2 ... 13: /* Tccd{1-12} */
  209. ret = read_ccd_temp_reg(data, channel - 2, &regval);
  210. if (ret)
  211. return ret;
  212. *val = (regval & ZEN_CCD_TEMP_MASK) * 125 - 49000;
  213. break;
  214. default:
  215. return ret;
  216. }
  217. break;
  218. case hwmon_temp_max:
  219. *val = 70 * 1000;
  220. break;
  221. case hwmon_temp_crit:
  222. data->read_htcreg(data->pdev, &regval);
  223. *val = ((regval >> 16) & 0x7f) * 500 + 52000;
  224. break;
  225. case hwmon_temp_crit_hyst:
  226. data->read_htcreg(data->pdev, &regval);
  227. *val = (((regval >> 16) & 0x7f)
  228. - ((regval >> 24) & 0xf)) * 500 + 52000;
  229. break;
  230. default:
  231. return ret;
  232. }
  233. return 0;
  234. }
  235. static int k10temp_read(struct device *dev, enum hwmon_sensor_types type,
  236. u32 attr, int channel, long *val)
  237. {
  238. switch (type) {
  239. case hwmon_temp:
  240. return k10temp_read_temp(dev, attr, channel, val);
  241. default:
  242. return -EOPNOTSUPP;
  243. }
  244. }
  245. static umode_t k10temp_is_visible(const void *drvdata,
  246. enum hwmon_sensor_types type,
  247. u32 attr, int channel)
  248. {
  249. const struct k10temp_data *data = drvdata;
  250. struct pci_dev *pdev = data->pdev;
  251. u32 reg;
  252. switch (type) {
  253. case hwmon_temp:
  254. switch (attr) {
  255. case hwmon_temp_input:
  256. if (!HAVE_TEMP(data, channel))
  257. return 0;
  258. break;
  259. case hwmon_temp_max:
  260. if (channel || data->is_zen)
  261. return 0;
  262. break;
  263. case hwmon_temp_crit:
  264. case hwmon_temp_crit_hyst:
  265. if (channel || !data->read_htcreg)
  266. return 0;
  267. pci_read_config_dword(pdev,
  268. REG_NORTHBRIDGE_CAPABILITIES,
  269. &reg);
  270. if (!(reg & NB_CAP_HTC))
  271. return 0;
  272. data->read_htcreg(data->pdev, &reg);
  273. if (!(reg & HTC_ENABLE))
  274. return 0;
  275. break;
  276. case hwmon_temp_label:
  277. /* Show temperature labels only on Zen CPUs */
  278. if (!data->is_zen || !HAVE_TEMP(data, channel))
  279. return 0;
  280. break;
  281. default:
  282. return 0;
  283. }
  284. break;
  285. default:
  286. return 0;
  287. }
  288. return 0444;
  289. }
  290. static bool has_erratum_319(struct pci_dev *pdev)
  291. {
  292. u32 pkg_type, reg_dram_cfg;
  293. if (boot_cpu_data.x86 != 0x10)
  294. return false;
  295. /*
  296. * Erratum 319: The thermal sensor of Socket F/AM2+ processors
  297. * may be unreliable.
  298. */
  299. pkg_type = cpuid_ebx(0x80000001) & CPUID_PKGTYPE_MASK;
  300. if (pkg_type == CPUID_PKGTYPE_F)
  301. return true;
  302. if (pkg_type != CPUID_PKGTYPE_AM2R2_AM3)
  303. return false;
  304. /* DDR3 memory implies socket AM3, which is good */
  305. pci_bus_read_config_dword(pdev->bus,
  306. PCI_DEVFN(PCI_SLOT(pdev->devfn), 2),
  307. REG_DCT0_CONFIG_HIGH, &reg_dram_cfg);
  308. if (reg_dram_cfg & DDR3_MODE)
  309. return false;
  310. /*
  311. * Unfortunately it is possible to run a socket AM3 CPU with DDR2
  312. * memory. We blacklist all the cores which do exist in socket AM2+
  313. * format. It still isn't perfect, as RB-C2 cores exist in both AM2+
  314. * and AM3 formats, but that's the best we can do.
  315. */
  316. return boot_cpu_data.x86_model < 4 ||
  317. (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_stepping <= 2);
  318. }
  319. static const struct hwmon_channel_info * const k10temp_info[] = {
  320. HWMON_CHANNEL_INFO(temp,
  321. HWMON_T_INPUT | HWMON_T_MAX |
  322. HWMON_T_CRIT | HWMON_T_CRIT_HYST |
  323. HWMON_T_LABEL,
  324. HWMON_T_INPUT | HWMON_T_LABEL,
  325. HWMON_T_INPUT | HWMON_T_LABEL,
  326. HWMON_T_INPUT | HWMON_T_LABEL,
  327. HWMON_T_INPUT | HWMON_T_LABEL,
  328. HWMON_T_INPUT | HWMON_T_LABEL,
  329. HWMON_T_INPUT | HWMON_T_LABEL,
  330. HWMON_T_INPUT | HWMON_T_LABEL,
  331. HWMON_T_INPUT | HWMON_T_LABEL,
  332. HWMON_T_INPUT | HWMON_T_LABEL,
  333. HWMON_T_INPUT | HWMON_T_LABEL,
  334. HWMON_T_INPUT | HWMON_T_LABEL,
  335. HWMON_T_INPUT | HWMON_T_LABEL,
  336. HWMON_T_INPUT | HWMON_T_LABEL),
  337. NULL
  338. };
  339. static const struct hwmon_ops k10temp_hwmon_ops = {
  340. .is_visible = k10temp_is_visible,
  341. .read = k10temp_read,
  342. .read_string = k10temp_read_labels,
  343. };
  344. static const struct hwmon_chip_info k10temp_chip_info = {
  345. .ops = &k10temp_hwmon_ops,
  346. .info = k10temp_info,
  347. };
  348. static void k10temp_get_ccd_support(struct k10temp_data *data, int limit)
  349. {
  350. u32 regval;
  351. int i;
  352. for (i = 0; i < limit; i++) {
  353. /*
  354. * Ignore inaccessible CCDs.
  355. *
  356. * Some systems will return a register value of 0, and the TEMP_VALID
  357. * bit check below will naturally fail.
  358. *
  359. * Other systems will return a PCI_ERROR_RESPONSE (0xFFFFFFFF) for
  360. * the register value. And this will incorrectly pass the TEMP_VALID
  361. * bit check.
  362. */
  363. if (read_ccd_temp_reg(data, i, &regval))
  364. continue;
  365. if (regval & ZEN_CCD_TEMP_VALID)
  366. data->show_temp |= BIT(TCCD_BIT(i));
  367. }
  368. }
  369. static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
  370. {
  371. int unreliable = has_erratum_319(pdev);
  372. struct device *dev = &pdev->dev;
  373. struct k10temp_data *data;
  374. struct device *hwmon_dev;
  375. int i;
  376. if (unreliable) {
  377. if (!force) {
  378. dev_err(dev,
  379. "unreliable CPU thermal sensor; monitoring disabled\n");
  380. return -ENODEV;
  381. }
  382. dev_warn(dev,
  383. "unreliable CPU thermal sensor; check erratum 319\n");
  384. }
  385. data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
  386. if (!data)
  387. return -ENOMEM;
  388. data->pdev = pdev;
  389. data->show_temp |= BIT(TCTL_BIT); /* Always show Tctl */
  390. if (boot_cpu_data.x86 == 0x17 &&
  391. strstr(boot_cpu_data.x86_model_id, AMD_I3255_STR)) {
  392. data->disp_negative = true;
  393. }
  394. data->is_zen = cpu_feature_enabled(X86_FEATURE_ZEN);
  395. if (data->is_zen) {
  396. data->temp_adjust_mask = ZEN_CUR_TEMP_RANGE_SEL_MASK;
  397. data->read_tempreg = read_tempreg_nb_zen;
  398. } else if (boot_cpu_data.x86 == 0x15 &&
  399. ((boot_cpu_data.x86_model & 0xf0) == 0x60 ||
  400. (boot_cpu_data.x86_model & 0xf0) == 0x70)) {
  401. data->read_htcreg = read_htcreg_nb_f15;
  402. data->read_tempreg = read_tempreg_nb_f15;
  403. } else {
  404. data->read_htcreg = read_htcreg_pci;
  405. data->read_tempreg = read_tempreg_pci;
  406. }
  407. if (boot_cpu_data.x86 == 0x17 || boot_cpu_data.x86 == 0x18) {
  408. switch (boot_cpu_data.x86_model) {
  409. case 0x1: /* Zen */
  410. case 0x8: /* Zen+ */
  411. case 0x11: /* Zen APU */
  412. case 0x18: /* Zen+ APU */
  413. data->ccd_offset = 0x154;
  414. k10temp_get_ccd_support(data, 4);
  415. break;
  416. case 0x31: /* Zen2 Threadripper */
  417. case 0x47: /* Cyan Skillfish */
  418. case 0x60: /* Renoir */
  419. case 0x68: /* Lucienne */
  420. case 0x71: /* Zen2 */
  421. data->ccd_offset = 0x154;
  422. k10temp_get_ccd_support(data, 8);
  423. break;
  424. case 0xa0 ... 0xaf:
  425. data->ccd_offset = 0x300;
  426. k10temp_get_ccd_support(data, 8);
  427. break;
  428. }
  429. } else if (boot_cpu_data.x86 == 0x19) {
  430. switch (boot_cpu_data.x86_model) {
  431. case 0x0 ... 0x1: /* Zen3 SP3/TR */
  432. case 0x8: /* Zen3 TR Chagall */
  433. case 0x21: /* Zen3 Ryzen Desktop */
  434. case 0x50 ... 0x5f: /* Green Sardine */
  435. data->ccd_offset = 0x154;
  436. k10temp_get_ccd_support(data, 8);
  437. break;
  438. case 0x40 ... 0x4f: /* Yellow Carp */
  439. data->ccd_offset = 0x300;
  440. k10temp_get_ccd_support(data, 8);
  441. break;
  442. case 0x60 ... 0x6f:
  443. case 0x70 ... 0x7f:
  444. data->ccd_offset = 0x308;
  445. k10temp_get_ccd_support(data, 8);
  446. break;
  447. case 0x10 ... 0x1f:
  448. case 0xa0 ... 0xaf:
  449. data->ccd_offset = 0x300;
  450. k10temp_get_ccd_support(data, 12);
  451. break;
  452. }
  453. } else if (boot_cpu_data.x86 == 0x1a) {
  454. switch (boot_cpu_data.x86_model) {
  455. case 0x40 ... 0x4f: /* Zen5 Ryzen Desktop */
  456. data->ccd_offset = 0x308;
  457. k10temp_get_ccd_support(data, 8);
  458. break;
  459. }
  460. }
  461. for (i = 0; i < ARRAY_SIZE(tctl_offset_table); i++) {
  462. const struct tctl_offset *entry = &tctl_offset_table[i];
  463. if (boot_cpu_data.x86 == entry->model &&
  464. strstr(boot_cpu_data.x86_model_id, entry->id)) {
  465. data->show_temp |= BIT(TDIE_BIT); /* show Tdie */
  466. data->temp_offset = entry->offset;
  467. break;
  468. }
  469. }
  470. hwmon_dev = devm_hwmon_device_register_with_info(dev, "k10temp", data,
  471. &k10temp_chip_info,
  472. NULL);
  473. return PTR_ERR_OR_ZERO(hwmon_dev);
  474. }
  475. static const struct pci_device_id k10temp_id_table[] = {
  476. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) },
  477. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) },
  478. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
  479. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) },
  480. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_F3) },
  481. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F3) },
  482. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M60H_NB_F3) },
  483. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M70H_NB_F3) },
  484. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
  485. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
  486. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) },
  487. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) },
  488. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
  489. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M40H_DF_F3) },
  490. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) },
  491. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
  492. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M90H_DF_F3) },
  493. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_MA0H_DF_F3) },
  494. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
  495. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F3) },
  496. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
  497. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
  498. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) },
  499. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) },
  500. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M78H_DF_F3) },
  501. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_1AH_M00H_DF_F3) },
  502. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_1AH_M20H_DF_F3) },
  503. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_1AH_M50H_DF_F3) },
  504. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_1AH_M60H_DF_F3) },
  505. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_1AH_M70H_DF_F3) },
  506. { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_1AH_M90H_DF_F3) },
  507. { PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
  508. {}
  509. };
  510. MODULE_DEVICE_TABLE(pci, k10temp_id_table);
  511. static struct pci_driver k10temp_driver = {
  512. .name = "k10temp",
  513. .id_table = k10temp_id_table,
  514. .probe = k10temp_probe,
  515. };
  516. module_pci_driver(k10temp_driver);