Thread (40 messages) 40 messages, 5 authors, 2011-07-25

[PATCH 09/14] 85xx/sbc8548: read hardware revision when it's required for first time

From: Dmitry Eremin-Solenikov <hidden>
Date: 2011-07-19 08:55:03
Subsystem: linux for powerpc (32-bit and 64-bit), linux for powerpc embedded ppc85xx, the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Scott Wood, Linus Torvalds

Currently sbc8548 reads hardware revision during bootup. To simplify
things read it when it's first required when the kernel is up and
running.

Signed-off-by: Dmitry Eremin-Solenikov <redacted>
---
 arch/powerpc/platforms/85xx/sbc8548.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index ecdd8c0..2eeb376 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -49,7 +49,7 @@
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
-static int sbc_rev;
+static int sbc_rev = -EINVAL;
 
 static void __init sbc8548_pic_init(void)
 {
@@ -82,7 +82,7 @@ static void __init sbc8548_pic_init(void)
 }
 
 /* Extract the HW Rev from the EPLD on the board */
-static int __init sbc8548_hw_rev(void)
+static int sbc8548_hw_rev(void)
 {
 	struct device_node *np;
 	struct resource res;
@@ -130,7 +130,6 @@ static void __init sbc8548_setup_arch(void)
 		}
 	}
 #endif
-	sbc_rev = sbc8548_hw_rev();
 }
 
 static void sbc8548_show_cpuinfo(struct seq_file *m)
@@ -140,6 +139,9 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
 	pvid = mfspr(SPRN_PVR);
 	svid = mfspr(SPRN_SVR);
 
+	if (sbc_rev == -EINVAL)
+		sbc_rev = sbc8548_hw_rev();
+
 	seq_printf(m, "Vendor\t\t: Wind River\n");
 	seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
 	seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
-- 
1.7.2.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help