Skip to contentSkip to conversation

reset mpc83xx plaform.

PATCH David Updegraff 2 participants 2 messages Mar 22, 2006

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

Hi.

I think there's some typo-errs. in arch/powerpc/platforms/83xx/misc.c. In my case, these result in board lockup at 'reboot' instead of reset.

By my reading of the PDF, it needs to be patched thusly.

-dbu.

arch/powerpc/platforms/83xx/misc.c +6 -1
index 0eb3d99..d918d45 100644
@@ -24,6 +24,7 @@ void mpc83xx_restart(char *cmd)
 #define RST_OFFSET	0x00000900
 #define RST_PROT_REG	0x00000018
 #define RST_CTRL_REG	0x0000001c
+#define RST_ENBL_REG	0x00000020
 	__be32 __iomem *reg;
 
 	/* map reset register space */
@@ -34,8 +35,12 @@ void mpc83xx_restart(char *cmd)
 	/* enable software reset "RSTE" */
 	out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
 
+	/* wait for reset to get enabled */
+	while ((in_be32 (reg + (RST_ENBL_REG >> 2)) & 1) == 0 )
+		;
+
 	/* set software hard reset */
-	out_be32(reg + (RST_CTRL_REG >> 2), 0x52535445);
+	out_be32(reg + (RST_CTRL_REG >> 2), 3);
 	for (;;) ;
 }
 
#1 lore raw
Quoted 6 lines · David Updegraff

Hi.

I think there's some typo-errs. in arch/powerpc/platforms/83xx/misc.c. In my case, these result in board lockup at 'reboot' instead of reset.

By my reading of the PDF, it needs to be patched thusly.

Yeah, this fix should be in what Paul just sent to linus for 2.6.17. I guess I could push to get it into 2.6.16.x if desired.

- kumar

Quoted 30 lines
arch/powerpc/platforms/83xx/misc.c +6 -1
index 0eb3d99..d918d45 100644
@@ -24,6 +24,7 @@ void mpc83xx_restart(char *cmd)
 #define RST_OFFSET	0x00000900
 #define RST_PROT_REG	0x00000018
 #define RST_CTRL_REG	0x0000001c
+#define RST_ENBL_REG	0x00000020
 	__be32 __iomem *reg;
 
 	/* map reset register space */
@@ -34,8 +35,12 @@ void mpc83xx_restart(char *cmd)
 	/* enable software reset "RSTE" */
 	out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
 
+	/* wait for reset to get enabled */
+	while ((in_be32 (reg + (RST_ENBL_REG >> 2)) & 1) == 0 )
+		;
+
 	/* set software hard reset */
-	out_be32(reg + (RST_CTRL_REG >> 2), 0x52535445);
+	out_be32(reg + (RST_CTRL_REG >> 2), 3);
 	for (;;) ;
 }
 

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded