24 #include <linux/module.h>
25 #include <linux/pci.h>
26 #include <asm/processor.h>
37 #define CPUID_PKGTYPE_MASK 0xf0000000
38 #define CPUID_PKGTYPE_F 0x00000000
39 #define CPUID_PKGTYPE_AM2R2_AM3 0x10000000
42 #define REG_DCT0_CONFIG_HIGH 0x094
43 #define DDR3_MODE 0x00000100
46 #define REG_HARDWARE_THERMAL_CONTROL 0x64
47 #define HTC_ENABLE 0x00000001
49 #define REG_REPORTED_TEMPERATURE 0xa4
51 #define REG_NORTHBRIDGE_CAPABILITIES 0xe8
52 #define NB_CAP_HTC 0x00000400
61 return sprintf(buf,
"%u\n", (regval >> 21) * 125);
67 return sprintf(buf,
"%d\n", 70 * 1000);
74 int show_hyst = attr->
index;
80 value = ((regval >> 16) & 0x7f) * 500 + 52000;
82 value -= ((regval >> 24) & 0xf) * 500;
83 return sprintf(buf,
"%d\n", value);
89 return sprintf(buf,
"k10temp\n");
100 u32 pkg_type, reg_dram_cfg;
116 pci_bus_read_config_dword(pdev->
bus,
136 u32 reg_caps, reg_htc;
137 int unreliable = has_erratum_319(pdev);
140 if (unreliable && !
force) {
142 "unreliable CPU thermal sensor; monitoring disabled\n");
158 &sensor_dev_attr_temp1_crit.dev_attr);
162 &sensor_dev_attr_temp1_crit_hyst.dev_attr);
172 if (IS_ERR(hwmon_dev)) {
173 err = PTR_ERR(hwmon_dev);
176 pci_set_drvdata(pdev, hwmon_dev);
178 if (unreliable &&
force)
180 "unreliable CPU thermal sensor; check erratum 319\n");
188 &sensor_dev_attr_temp1_crit.dev_attr);
190 &sensor_dev_attr_temp1_crit_hyst.dev_attr);
202 &sensor_dev_attr_temp1_crit.dev_attr);
204 &sensor_dev_attr_temp1_crit_hyst.dev_attr);
205 pci_set_drvdata(pdev,
NULL);
220 .id_table = k10temp_id_table,
221 .probe = k10temp_probe,