mpc512x: Add display of reset status register
PATCH 1/1 mpc512x: Add display of reset status register
Content of the RSR is put into gd early so we can output it together with the CPU info. The clearing of gd in board_init_f is redundant for this architecture as it is done in cpu_init_f so we remove it.
--- cpu/mpc512x/cpu.c | 3 ++- lib_ppc/board.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)
cpu/mpc512x/cpu.c +2 -1
@@ -66,9 +66,10 @@ int checkcpu (void)default :puts ("unknown " ); } -printf ("at %s MHz, CSB at %s MHz\n" , +printf ("at %s MHz, CSB at %s MHz " ,strmhz (buf1, clock),strmhz (buf2, gd->csb_clk) ); +printf ("(RSR=0x%04lx)\n" , gd->reset_status &0xffff );return 0 ; }
lib_ppc/board.c +3 -2
@@ -1,5 +1,5 @@/* -* (C) Copyright 2000-2006 +* (C) Copyright 2000-2010 * Wolfgang Denk, DENX Software Engineering, wd at denx.de. * * See file CREDITS for list of people who contributed to this
@@ -379,7 +379,8 @@ void board_init_f (ulong bootflag) __asm__ __volatile__("" : : :"memory" );#if !defined(CONFIG_CPM2 ) && !defined(CONFIG_MPC83xx) && \ - !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx) + !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx) && \ + !defined(CONFIG_MPC512X )/* Clear initial global data */ memset ((void *) gd,0 ,sizeof (gd_t));#endif
Signature · 1 line
1.6.2.5
PATCH 1/1 mpc512x: Add display of reset status register
Dear Detlev Zundel,
Quoted 15 lines · In message <[email protected]> you wrote:
Content of the RSR is put into gd early so we can output it together with the CPU info. The clearing of gd in
board_init_fis redundant for this architecture as it is done incpu_init_fso we remove it.Signed-off-by Detlev Zundel <[email protected]>--- cpu/mpc512x/cpu.c | 3 ++- lib_ppc/board.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)cpu/mpc512x/cpu.c +0
-0
cpu/mpc512x/cpu.c int checkcpu (void) · line 72
Quoted 8 lines
cpu/mpc512x/cpu.c +2
-1@@ -66,9 +66,10 @@ int checkcpu (void)default :puts ("unknown " ); } -printf ("at %s MHz, CSB at %s MHz\n" , +printf ("at %s MHz, CSB at %s MHz " ,strmhz (buf1, clock),strmhz (buf2, gd->csb_clk) ); +printf ("(RSR=0x%04lx)\n" , gd->reset_status &0xffff );
Please add to the first printf() and avoid an additional function call.
cpu/mpc512x/cpu.c void board_init_f (ulong bootflag) · line 383
Quoted 7 lines
cpu/mpc512x/cpu.c +2
-1@@ -379,7 +379,8 @@ void board_init_f (ulong bootflag) __asm__ __volatile__("" : : :"memory" );#if !defined(CONFIG_CPM2 ) && !defined(CONFIG_MPC83xx) && \ - !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx) + !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx) && \ + !defined(CONFIG_MPC512X )
Please keep the list sorted.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de All men should freely use those seven words which have the power to make any marriage run smoothly: You know dear, you may be right.
PATCH v2 1/1 mpc512x: Add display of reset status register
Content of the RSR is put into gd early so we can output it together with the CPU info. The clearing of gd in board_init_f is redundant for this architecture as it is done in cpu_init_f so we remove it.
--- cpu/mpc512x/cpu.c | 5 +++-- lib_ppc/board.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-)
Changes from v1:
- Extend last printf instead off adding another function call.
- Keep conditional expressions sorted
cpu/mpc512x/cpu.c +3 -2
@@ -66,9 +66,10 @@ int checkcpu (void)default :puts ("unknown " ); } -printf ("at %s MHz, CSB at %s MHz\n" , +printf ("at %s MHz, CSB at %s MHz (RSR=0x%04lx)\n" ,strmhz (buf1, clock), -strmhz (buf2, gd->csb_clk) ); +strmhz (buf2, gd->csb_clk), + gd->reset_status &0xffff );return 0 ; }
lib_ppc/board.c +4 -3
@@ -1,5 +1,5 @@/* -* (C) Copyright 2000-2006 +* (C) Copyright 2000-2010 * Wolfgang Denk, DENX Software Engineering, wd at denx.de. * * See file CREDITS for list of people who contributed to this
@@ -378,8 +378,9 @@ void board_init_f (ulong bootflag)/* compiler optimization barrier needed for GCC >= 3.4 */ __asm__ __volatile__("" : : :"memory" ); -#if !defined(CONFIG_CPM2 ) && !defined(CONFIG_MPC83xx) && \ - !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx) +#if !defined(CONFIG_CPM2 ) && !defined(CONFIG_MPC512X ) && \ + !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ + !defined(CONFIG_MPC86xx)/* Clear initial global data */ memset ((void *) gd,0 ,sizeof (gd_t));#endif
Signature · 1 line
1.6.2.5