[U-Boot] [PATCH] Bug: do_reset issued via netconsole does not reset mpc83xx cpu.

The do_reset routine in the cpu/mpc83xx/cpu.c file does not reset the mpc83xx cpu when issued via netconsole.
Moving the console output "resetting the board." to the beginning of the routine before disabling interrupts solved the problem.
Signed-off-by: Michael Zaidman michael.zaidman@gmail.com --- cpu/mpc83xx/cpu.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index e38a372..51180d6 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -199,7 +199,10 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
+ puts("Resetting the board.\n"); + #ifdef MPC83xx_RESET + /* Interrupts and MMU off */ __asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
@@ -214,9 +217,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /* confirm Reset Control Reg is enabled */ while(!((immap->reset.rcer) & RCER_CRE));
- printf("Resetting the board."); - printf("\n"); - udelay(200);
/* perform reset, only one bit */ @@ -238,8 +238,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ addr = CONFIG_SYS_RESET_ADDRESS;
- printf("resetting the board."); - printf("\n"); ((void (*)(void)) addr) (); #endif /* MPC83xx_RESET */

Michael Zaidman michael.zaidman@gmail.com writes:
The do_reset routine in the cpu/mpc83xx/cpu.c file does not reset the mpc83xx cpu when issued via netconsole.
Moving the console output "resetting the board." to the beginning of the routine before disabling interrupts solved the problem.
Signed-off-by: Michael Zaidman michael.zaidman@gmail.com
Acked-by: Detlev Zundel dzu@denx.de
cpu/mpc83xx/cpu.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index e38a372..51180d6 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -199,7 +199,10 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
- puts("Resetting the board.\n");
#ifdef MPC83xx_RESET
- /* Interrupts and MMU off */ __asm__ __volatile__ ("mfmsr %0":"=r" (msr):);
@@ -214,9 +217,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /* confirm Reset Control Reg is enabled */ while(!((immap->reset.rcer) & RCER_CRE));
printf("Resetting the board.");
printf("\n");
udelay(200);
/* perform reset, only one bit */
@@ -238,8 +238,6 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ addr = CONFIG_SYS_RESET_ADDRESS;
- printf("resetting the board.");
- printf("\n"); ((void (*)(void)) addr) ();
#endif /* MPC83xx_RESET */
Cheers Detlev

On Mon, 15 Feb 2010 18:18:34 +0100 Detlev Zundel dzu@denx.de wrote:
Michael Zaidman michael.zaidman@gmail.com writes:
The do_reset routine in the cpu/mpc83xx/cpu.c file does not reset the mpc83xx cpu when issued via netconsole.
Moving the console output "resetting the board." to the beginning of the routine before disabling interrupts solved the problem.
Signed-off-by: Michael Zaidman michael.zaidman@gmail.com
Acked-by: Detlev Zundel dzu@denx.de
cpu/mpc83xx/cpu.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
applied to u-boot-mpc83xx.
Thanks everyone.
Kim
participants (3)
-
Detlev Zundel
-
Kim Phillips
-
Michael Zaidman