Patchwork [Oneiric,SRU,1/4] hwmon: (k10temp) Add support for AMD Trinity CPUs

login
register
mail settings
Submitter Tim Gardner
Date June 14, 2012, 2:42 p.m.
Message ID <1339684979-11086-1-git-send-email-tim.gardner@canonical.com>
Download mbox | patch
Permalink /patch/164946/
State New
Headers show

Comments

Tim Gardner - June 14, 2012, 2:42 p.m.
From: Andre Przywara <andre.przywara@amd.com>

BugLink: http://bugs.launchpad.net/bugs/1009086

The on-chip northbridge's temperature sensor of the upcoming
AMD Trinity CPUs works the same as for the previous CPUs.
Since it has a different PCI-ID, we just add the new one to the list
supported by k10temp.
This allows to use the k10temp driver on those CPUs.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
(cherry picked from commit fbc729a446f7d80ec8b73fe90d8c0cc3e95ad277)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 Documentation/hwmon/k10temp |    2 +-
 drivers/hwmon/Kconfig       |    3 ++-
 drivers/hwmon/k10temp.c     |    4 ++++
 3 files changed, 7 insertions(+), 2 deletions(-)
Herton Ronaldo Krzesinski - June 14, 2012, 10:12 p.m.
Ack. The last two are already commited to oneiric (came with 3.0.33)
as was the case with 3.2.y (Precise).
Brad Figg - June 15, 2012, 2:25 a.m.
On 06/14/2012 07:42 AM, Tim Gardner wrote:
> From: Andre Przywara <andre.przywara@amd.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1009086
> 
> The on-chip northbridge's temperature sensor of the upcoming
> AMD Trinity CPUs works the same as for the previous CPUs.
> Since it has a different PCI-ID, we just add the new one to the list
> supported by k10temp.
> This allows to use the k10temp driver on those CPUs.
> 
> Signed-off-by: Andre Przywara <andre.przywara@amd.com>
> Cc: stable@vger.kernel.org # 3.0+
> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
> (cherry picked from commit fbc729a446f7d80ec8b73fe90d8c0cc3e95ad277)
> 
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
> ---
>  Documentation/hwmon/k10temp |    2 +-
>  drivers/hwmon/Kconfig       |    3 ++-
>  drivers/hwmon/k10temp.c     |    4 ++++
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
> index a10f736..90956b6 100644
> --- a/Documentation/hwmon/k10temp
> +++ b/Documentation/hwmon/k10temp
> @@ -11,7 +11,7 @@ Supported chips:
>    Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
>  * AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
>  * AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
> -* AMD Family 15h processors: "Bulldozer"
> +* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity"
>  
>    Prefix: 'k10temp'
>    Addresses scanned: PCI space
> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> index 6030f20..a5b8741 100644
> --- a/drivers/hwmon/Kconfig
> +++ b/drivers/hwmon/Kconfig
> @@ -243,7 +243,8 @@ config SENSORS_K10TEMP
>  	  If you say yes here you get support for the temperature
>  	  sensor(s) inside your CPU. Supported are later revisions of
>  	  the AMD Family 10h and all revisions of the AMD Family 11h,
> -	  12h (Llano), 14h (Brazos) and 15h (Bulldozer) microarchitectures.
> +	  12h (Llano), 14h (Brazos) and 15h (Bulldozer/Trinity)
> +	  microarchitectures.
>  
>  	  This driver can also be built as a module.  If so, the module
>  	  will be called k10temp.
> diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
> index 41aa6a3..f43ffc0 100644
> --- a/drivers/hwmon/k10temp.c
> +++ b/drivers/hwmon/k10temp.c
> @@ -33,6 +33,9 @@ static bool force;
>  module_param(force, bool, 0444);
>  MODULE_PARM_DESC(force, "force loading on processors with erratum 319");
>  
> +/* PCI-IDs for Northbridge devices not used anywhere else */
> +#define PCI_DEVICE_ID_AMD_15H_M10H_NB_F3	0x1403
> +
>  /* CPUID function 0x80000001, ebx */
>  #define CPUID_PKGTYPE_MASK	0xf0000000
>  #define CPUID_PKGTYPE_F		0x00000000
> @@ -210,6 +213,7 @@ static const struct pci_device_id k10temp_id_table[] = {
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) },
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
>  	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) },
> +	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_NB_F3) },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(pci, k10temp_id_table);
Stefan Bader - June 15, 2012, 8:12 a.m.
Applied 1+2 to Oneiric master-next. As Herton pointed out 3+4 were there now.

Patch

diff --git a/Documentation/hwmon/k10temp b/Documentation/hwmon/k10temp
index a10f736..90956b6 100644
--- a/Documentation/hwmon/k10temp
+++ b/Documentation/hwmon/k10temp
@@ -11,7 +11,7 @@  Supported chips:
   Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
 * AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
 * AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
-* AMD Family 15h processors: "Bulldozer"
+* AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity"
 
   Prefix: 'k10temp'
   Addresses scanned: PCI space
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 6030f20..a5b8741 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -243,7 +243,8 @@  config SENSORS_K10TEMP
 	  If you say yes here you get support for the temperature
 	  sensor(s) inside your CPU. Supported are later revisions of
 	  the AMD Family 10h and all revisions of the AMD Family 11h,
-	  12h (Llano), 14h (Brazos) and 15h (Bulldozer) microarchitectures.
+	  12h (Llano), 14h (Brazos) and 15h (Bulldozer/Trinity)
+	  microarchitectures.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called k10temp.
diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c
index 41aa6a3..f43ffc0 100644
--- a/drivers/hwmon/k10temp.c
+++ b/drivers/hwmon/k10temp.c
@@ -33,6 +33,9 @@  static bool force;
 module_param(force, bool, 0444);
 MODULE_PARM_DESC(force, "force loading on processors with erratum 319");
 
+/* PCI-IDs for Northbridge devices not used anywhere else */
+#define PCI_DEVICE_ID_AMD_15H_M10H_NB_F3	0x1403
+
 /* CPUID function 0x80000001, ebx */
 #define CPUID_PKGTYPE_MASK	0xf0000000
 #define CPUID_PKGTYPE_F		0x00000000
@@ -210,6 +213,7 @@  static const struct pci_device_id k10temp_id_table[] = {
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
 	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) },
+	{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_NB_F3) },
 	{}
 };
 MODULE_DEVICE_TABLE(pci, k10temp_id_table);