Skip to contentSkip to conversation

mpc8540 : Fix restart

PATCH In review Philippe De Muyter 2 participants 4 messages Apr 9, 2008 – Apr 14, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc8540 : Fix restart

Hi everybody,

Previously, with the arch/ppc tree, mpc8540 boards could reboot. Now with the arch/powerpc tree, they can not anymore. Fix that.

arch/powerpc/sysdev/fsl_soc.c +5 -1
@@ -1428,13 +1433,17 @@
 
 arch_initcall(setup_rstcr);
 
+extern void abort(void);
+
 void fsl_rstcr_restart(char *cmd)
 {
 	local_irq_disable();
 	if (rstcr)
 		/* set reset control register */
 		out_be32(rstcr, 0x2);	/* HRESET_REQ */
-
+	else
+		abort();
 	while (1) ;
+
 }
 #endif
#1 lore raw
Quoted 20 lines · Philippe De Muyter

Hi everybody,

Previously, with the arch/ppc tree, mpc8540 boards could reboot. Now with the arch/powerpc tree, they can not anymore. Fix that.

--- a/arch/powerpc/sysdev/fsl_soc.c 2008-03-21 14:53:41.000000000
+0000
+++ b/arch/powerpc/sysdev/fsl_soc.c 2008-03-26 12:08:25.000000000
+0000

arch/powerpc/sysdev/fsl_soc.c +2 -0
@@ -1428,13 +1433,17 @@
 
 arch_initcall(setup_rstcr);
 
+extern void abort(void);
+
 void fsl_rstcr_restart(char *cmd)
 {

arch/powerpc/sysdev/fsl_soc.c line 1448

Quoted 10 lines
arch/powerpc/sysdev/fsl_soc.c +3 -1
 	local_irq_disable();
 	if (rstcr)
 		/* set reset control register */
 		out_be32(rstcr, 0x2);	/* HRESET_REQ */
-
+	else
+		abort();
 	while (1) ;
+
 }

This was on purpose. abort() doesn't really do a restart and thus I didn't want it to be used that way.

- k

#2 lore raw
Quoted 25 lines · Kumar Gala
Quoted 23 lines · Philippe De Muyter

Hi everybody,

Previously, with the arch/ppc tree, mpc8540 boards could reboot. Now with the arch/powerpc tree, they can not anymore. Fix that.

arch/powerpc/sysdev/fsl_soc.c +2 -1
@@ -1428,13 +1433,17 @@
 
 arch_initcall(setup_rstcr);
 
+extern void abort(void);
+
 void fsl_rstcr_restart(char *cmd)
 {
 	local_irq_disable();
 	if (rstcr)
 		/* set reset control register */
 		out_be32(rstcr, 0x2);	/* HRESET_REQ */
-
Quoted 9 lines

arch/powerpc/sysdev/fsl_soc.c line 1448

Quoted 5 lines
arch/powerpc/sysdev/fsl_soc.c +3 -0
+	else
+		abort();
 	while (1) ;
+
 }

This was on purpose. abort() doesn't really do a restart and thus I didn't want it to be used that way.

What do you propose then ? The ability to reboot without power-off is really needed for embedded targets. And abort() from head_fsl.S seems really close to reboot.

Philippe

#3 lore raw
Quoted 4 lines
Quoted 1 line

What do you propose then ? The ability to reboot without power-off is really needed for embedded targets. And abort() from head_fsl.S seems really close to reboot.

Boards should provide system logic mechanism that should be used. The problem is abort() only resets the core. The rest of the SoC wlll not be properly reset.

- k