Skip to contentSkip to conversation

Fix e500 v2 core reboot bug

PATCH In review Jon Loeliger 2 participants 2 messages Mar 7, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix e500 v2 core reboot bug

From: Roy Zang <[email protected]>

For e500 v2 core, a new reset control register is added.

---
 arch/powerpc/platforms/85xx/misc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
arch/powerpc/platforms/85xx/misc.c +10 -0
index 3e62fcb..9fcbf56 100644
@@ -13,11 +13,21 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <asm/irq.h>
+#include <asm/io.h>
+#include <sysdev/fsl_soc.h>
 
 extern void abort(void);
 
 void mpc85xx_restart(char *cmd)
 {
+	unsigned int pvr;
+
+	pvr = mfspr(SPRN_PVR);
+	if ((pvr >> 16) & 0x1){
+		u32 __iomem *rstcr;
+		rstcr = ioremap(get_immrbase() + 0xE00B0, 0x100);
+		*rstcr = 0x2;           /* HRESET_REQ */
+	}
 	local_irq_disable();
 	abort();
 }
Signature · 1 line
1.5.0.1.213.g509b
#1 lore raw
Quoted 6 lines · Jon Loeliger

From: Roy Zang <[email protected]>

For e500 v2 core, a new reset control register is added.

Nack. See comments below.

- k

Quoted 13 lines
---
 arch/powerpc/platforms/85xx/misc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
arch/powerpc/platforms/85xx/misc.c +1 -0
index 3e62fcb..9fcbf56 100644
@@ -13,11 +13,21 @@
 #include <linux/irq.h>
 #include <linux/module.h>
 #include <asm/irq.h>
+#include <asm/io.h>

arch/powerpc/platforms/85xx/misc.c line 26

Quoted 10 lines
arch/powerpc/platforms/85xx/misc.c +5 -0
+#include <sysdev/fsl_soc.h>
 
 extern void abort(void);
 
 void mpc85xx_restart(char *cmd)
 {
+	unsigned int pvr;
+
+	pvr = mfspr(SPRN_PVR);
+	if ((pvr >> 16) & 0x1){

Testing the PVR isn't proper.. you are using a system feature that has nothing to do with the core revision.

Maybe add an attribute in the soc node for this?

arch/powerpc/platforms/85xx/misc.c line 28

Quoted 2 lines
arch/powerpc/platforms/85xx/misc.c +2 -0
+		u32 __iomem *rstcr;
+		rstcr = ioremap(get_immrbase() + 0xE00B0, 0x100);

You can't do the ioremap here, this my get called from interrupt context.. See 83xx/misc.c for a slightly better example. The unprotected arch_initcall is still an issue on 83xx.

arch/powerpc/platforms/85xx/misc.c line 29

Quoted 1 line
arch/powerpc/platforms/85xx/misc.c +1 -0
+		*rstcr = 0x2;           /* HRESET_REQ */

we should be using out_be32()

Quoted 4 lines
arch/powerpc/platforms/85xx/misc.c +1 -0
+	}
 	local_irq_disable();
 	abort();
 }