MX31: Introduce get_reset_cause()
PATCH v5 1/1 MX31: Introduce get_reset_cause()
Signed-off-by Fabio Estevam <[email protected]>
---
Changes since v4:
- Make get_reset_cause CPU specific code and no need to add any board specific call.
arch/arm/cpu/arm1136/mx31/generic.c | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-)
arch/arm/cpu/arm1136/mx31/generic.c +28 -1
@@ -132,11 +132,38 @@ char *get_cpu_rev(void)return "unknown" ; } +char *get_reset_cause (void ) +{ +/* read RCSR register from CCM module */ +struct clock_control_regs *ccm = + (struct clock_control_regs *)CCM_BASE ; + +u32 cause =readl (&ccm->rcsr) &0x07 ; + +switch (cause) { +case 0x0000 : +return "POR" ; +break ; +case 0x0001 : +return "RST" ; +break ; +case 0x0002 : +return "WDOG" ; +break ; +case 0x0006 : +return "JTAG" ; +break ; +default : +return "unknown reset" ; + } +} +#if defined(CONFIG_DISPLAY_CPUINFO )int print_cpuinfo (void ) { -printf ("CPU: Freescale i.MX31 rev %s at %d MHz\n" , +printf ("CPU: Freescale i.MX31 rev %s at %d MHz." ,get_cpu_rev (),mx31_get_mcu_main_clk () /1000000 ); +printf ("Reset cause: %s\n" ,get_reset_cause ());return 0 ; }#endif
Signature · 1 line
1.6.0.4
PATCH 1/1 MX31: mx31pdk: Make the board name simpler.
Signed-off-by Fabio Estevam <[email protected]>
--- board/freescale/mx31pdk/mx31pdk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
board/freescale/mx31pdk/mx31pdk.c +1 -1
@@ -70,7 +70,7 @@ int board_init(void)int checkboard (void ) { -printf ("Board: i.MX31 MAX PDK (3DS)\n" ); +printf ("Board: MX31PDK\n" );return 0 ; }
Signature · 1 line
1.6.0.4
PATCH v5 1/1 MX31: Introduce get_reset_cause()
In reply to Fabio EstevamHi Fabio,
Quoted 8 lines
Signed-off-by Fabio Estevam <[email protected]>---
Changes since v4:
- Makeget_reset_causeCPU specific code and no need to add any board specific call.arch/arm/cpu/arm1136/mx31/generic.c | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-)
Thanks, this looks good. Now all i.MX31 boards profit!
Acked-by Detlev Zundel <[email protected]>
Signature · 7 lines
config LGUEST
If unsure, say N. If curious, say M. If masochistic, say Y.
-- linux/drivers/lguest/Kconfig
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.dePATCH v5 1/1 MX31: Introduce get_reset_cause()
Le 19/04/2011 17:17, Detlev Zundel a ?crit :
Quoted 8 lines
Hi Fabio,
Quoted 6 lines
Signed-off-by Fabio Estevam<[email protected]>---
Changes since v4:
- Makeget_reset_causeCPU specific code and no need to add any board specific call.
Quoted 6 lines
Quoted 2 lines
arch/arm/cpu/arm1136/mx31/generic.c | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-)Thanks, this looks good. Now all i.MX31 boards profit!
Acked-by Detlev Zundel<[email protected]>
Stefano, does this get in your tree?
Amicalement,
Signature · 1 line
Albert.