Added kernel patch to support temp readings for some atom processors.
authorChristian Schmidt <maniacikarus@ipfire.org>
Sun, 7 Feb 2010 17:28:08 +0000 (18:28 +0100)
committerChristian Schmidt <maniacikarus@ipfire.org>
Sun, 7 Feb 2010 17:28:08 +0000 (18:28 +0100)
This modifies the coretemp kernel modul and adds support for newer
intel atom processors temp modules.

lfs/linux
src/patches/linux-2.6.27-atom-coretemp.patch [new file with mode: 0644]

index d5dcf2e..c2106d4 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -147,6 +147,9 @@ endif
        # ipp2p 0.8.2-pomng
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.19-ipp2p-0.8.2-pomng.patch
 
        # ipp2p 0.8.2-pomng
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27.19-ipp2p-0.8.2-pomng.patch
 
+       # Intel Atom Coretemp Patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.27-atom-coretemp.patch
+       
        # Layer7-patch
        cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.21
        cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.21.tar.gz
        # Layer7-patch
        cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.21
        cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.21.tar.gz
diff --git a/src/patches/linux-2.6.27-atom-coretemp.patch b/src/patches/linux-2.6.27-atom-coretemp.patch
new file mode 100644 (file)
index 0000000..0084311
--- /dev/null
@@ -0,0 +1,58 @@
+diff -Naur linux-2.6.27.42.org/drivers/hwmon/coretemp.c linux-2.6.27.42/drivers/hwmon/coretemp.c
+--- linux-2.6.27.42.org/drivers/hwmon/coretemp.c       2009-12-18 22:31:34.000000000 +0100
++++ linux-2.6.27.42/drivers/hwmon/coretemp.c   2010-02-07 12:36:39.000000000 +0100
+@@ -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 @@
+               }
+       }
+-      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 @@
+               }
+       }
++      platform_set_drvdata(pdev, data);
++
+       if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
+               goto exit_dev;
+@@ -409,15 +417,15 @@
+       err = platform_driver_register(&coretemp_driver);
+       if (err)
+               goto exit;
+-
++              
+       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 == 0x16) || (c->x86_model == 0x17)  ||
++                      (c->x86_model == 0x1c) || (c->x86_model == 0x1A))) {
+                       /* supported CPU not found, but report the unknown
+                          family 6 CPU */