All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] Why internal sensor on atom cpu isn't yet supported?
@ 2009-04-26 16:07 Maxim Levitsky
  2009-04-28 10:39 ` [lm-sensors] Why internal sensor on atom cpu isn't yet Rudolf Marek
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Maxim Levitsky @ 2009-04-26 16:07 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

I use an old patch, and it works fine, was it forgotten?

Best regards,
	Maxim Levitky

I attach the patch I use for reference, I didn't wrote it
(I did slight modifications to apply it on latest kernels)

Best regards,
	Maxim Levitsky

[-- Attachment #2: 0001-Add-intel-atom-support-to-coretemp.patch --]
[-- Type: text/x-patch, Size: 3968 bytes --]

From 7415b9249a8fd03baea37f292da765aa77926208 Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <maximlevitsky@gmail.com>
Date: Fri, 14 Nov 2008 22:52:42 +0200
Subject: [PATCH] Add intel atom support to coretemp

---
 Documentation/hwmon/coretemp |   14 ++++++++------
 drivers/hwmon/coretemp.c     |   18 +++++++++++++-----
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/Documentation/hwmon/coretemp b/Documentation/hwmon/coretemp
index dbbe6c7..d85c8fa 100644
--- a/Documentation/hwmon/coretemp
+++ b/Documentation/hwmon/coretemp
@@ -4,7 +4,7 @@ Kernel driver coretemp
 Supported chips:
   * All Intel Core family
     Prefix: 'coretemp'
-    CPUID: family 0x6, models 0xe, 0xf, 0x16, 0x17
+    CPUID: family 0x6, models 0xe, 0xf, 0x16, 0x17, 0x1c
     Datasheet: Intel 64 and IA-32 Architectures Software Developer's Manual
                Volume 3A: System Programming Guide
                http://softwarecommunity.intel.com/Wiki/Mobility/720.htm
@@ -14,10 +14,11 @@ Author: Rudolf Marek
 Description
 -----------
 
-This driver permits reading temperature sensor embedded inside Intel Core CPU.
-Temperature is measured in degrees Celsius and measurement resolution is
-1 degree C. Valid temperatures are from 0 to TjMax degrees C, because
-the actual value of temperature register is in fact a delta from TjMax.
+This driver permits reading temperature sensor embedded inside Intel
+Core  and Intel Atom CPUs. Temperature is measured in degrees Celsius
+and measurement resolution is 1 degree C. Valid temperatures are from 0
+to TjMax degrees C, because the actual value of temperature register is
+in fact a delta from TjMax.
 
 Temperature known as TjMax is the maximum junction temperature of processor.
 Intel defines this temperature as 85C or 100C. At this temperature, protection
@@ -35,4 +36,5 @@ temp1_label	 - Contains string "Core X", where X is processor
 
 The TjMax temperature is set to 85 degrees C if undocumented model specific
 register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as
-(sometimes) documented in processor datasheet.
+(sometimes) documented in processor datasheet. The Intel Atom has TjMax 95C
+as per the specification.
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 93c1722..0f58eff 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -1,7 +1,7 @@
 /*
  * coretemp.c - Linux kernel module for hardware monitoring
  *
- * Copyright (C) 2007 Rudolf Marek <r.marek@assembler.cz>
+ * Copyright (C) 2007, 2008 Rudolf Marek <r.marek@assembler.cz>
  *
  * Inspired from many hwmon drivers
  *
@@ -244,8 +244,14 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
 		}
 	}
 
-	data->tjmax = adjust_tjmax(c, data->id, &pdev->dev);
-	platform_set_drvdata(pdev, data);
+	/* Intel Atom has only fixed TjMax at 95C */
+
+	if (c->x86_model == 0x1c) {
+		data->tjmax = 95000;
+	} else {
+		/* Adjust the TjMax for the rest of Core2 family */
+		data->tjmax = adjust_tjmax(c, data->id, &pdev->dev);
+	}
 
 	/* read the still undocumented IA32_TEMPERATURE_TARGET it exists
 	   on older CPUs but not in this register */
@@ -265,6 +271,8 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
 		}
 	}
 
+	platform_set_drvdata(pdev, data);
+
 	if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
 		goto exit_dev;
 
@@ -413,11 +421,11 @@ static int __init coretemp_init(void)
 	for_each_online_cpu(i) {
 		struct cpuinfo_x86 *c = &cpu_data(i);
 
-		/* check if family 6, models 0xe, 0xf, 0x16, 0x17, 0x1A */
+		/* check if family 6, models 0xe, 0xf, 0x16, 0x17, 0x1A, 0x1C */
 		if ((c->cpuid_level < 0) || (c->x86 != 0x6) ||
 		    !((c->x86_model == 0xe) || (c->x86_model == 0xf) ||
 			(c->x86_model == 0x16) || (c->x86_model == 0x17) ||
-			(c->x86_model == 0x1A))) {
+			(c->x86_model == 0x1A) || c->x86_model == 0x1C)) {
 
 			/* supported CPU not found, but report the unknown
 			   family 6 CPU */
-- 
1.5.6.3


[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-04-28 14:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-26 16:07 [lm-sensors] Why internal sensor on atom cpu isn't yet supported? Maxim Levitsky
2009-04-28 10:39 ` [lm-sensors] Why internal sensor on atom cpu isn't yet Rudolf Marek
2009-04-28 13:13 ` Jean Delvare
2009-04-28 13:18 ` Maxim Levitsky
2009-04-28 13:25 ` Jean Delvare
2009-04-28 13:27 ` Philip Pokorny
2009-04-28 13:31 ` Philip Pokorny
2009-04-28 13:31 ` Maxim Levitsky
2009-04-28 14:36 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.