linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Export PIR data through sysfs
@ 2011-11-07  4:47 Ananth N Mavinakayanahalli
  2011-11-07 17:18 ` Scott Wood
  0 siblings, 1 reply; 11+ messages in thread
From: Ananth N Mavinakayanahalli @ 2011-11-07  4:47 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Anton Blanchard, mahesh

The Processor Identification Register (PIR) on powerpc provides
information to decode the processor identification tag. Decoding
this information platform specfic.

Export PIR data via sysfs.

(Powerpc manuals state this register is 'optional'. I am not sure
though if there are any Linux supported powerpc platforms that
don't have it. Code in the kernel referencing PIR isn't under
a platform ifdef).

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
 arch/powerpc/kernel/sysfs.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-3.1/arch/powerpc/kernel/sysfs.c
===================================================================
--- linux-3.1.orig/arch/powerpc/kernel/sysfs.c
+++ linux-3.1/arch/powerpc/kernel/sysfs.c
@@ -177,11 +177,13 @@ SYSFS_PMCSETUP(mmcra, SPRN_MMCRA);
 SYSFS_PMCSETUP(purr, SPRN_PURR);
 SYSFS_PMCSETUP(spurr, SPRN_SPURR);
 SYSFS_PMCSETUP(dscr, SPRN_DSCR);
+SYSFS_PMCSETUP(pir, SPRN_PIR);
 
 static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
 static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL);
 static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr);
 static SYSDEV_ATTR(purr, 0600, show_purr, store_purr);
+static SYSDEV_ATTR(pir, 0400, show_pir, NULL);
 
 unsigned long dscr_default = 0;
 EXPORT_SYMBOL(dscr_default);
@@ -394,6 +396,8 @@ static void __cpuinit register_cpu_onlin
 		sysdev_create_file(s, &attr_dscr);
 #endif /* CONFIG_PPC64 */
 
+	sysdev_create_file(s, &attr_pir);
+
 	cacheinfo_cpu_online(cpu);
 }
 
@@ -464,6 +468,8 @@ static void unregister_cpu_online(unsign
 		sysdev_remove_file(s, &attr_dscr);
 #endif /* CONFIG_PPC64 */
 
+	sysdev_remove_file(s, &attr_pir);
+
 	cacheinfo_cpu_offline(cpu);
 }
 

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

end of thread, other threads:[~2011-11-11  5:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07  4:47 [PATCH] powerpc: Export PIR data through sysfs Ananth N Mavinakayanahalli
2011-11-07 17:18 ` Scott Wood
2011-11-08  6:58   ` Ananth N Mavinakayanahalli
2011-11-08 16:59     ` Scott Wood
2011-11-09  4:41       ` Ananth N Mavinakayanahalli
2011-11-09 15:48         ` Scott Wood
2011-11-10  8:48           ` Ananth N Mavinakayanahalli
2011-11-11  4:18             ` Benjamin Herrenschmidt
2011-11-11  4:47               ` Ananth N Mavinakayanahalli
2011-11-11  5:58                 ` [PATCH V2] " Ananth N Mavinakayanahalli
2011-11-09  6:51       ` [PATCH] " Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).