[U-Boot] [PATCH v2 2/2] MX31: mx31pdk: Print the cause of reset
Fabio Estevam
festevam at gmail.com
Sun Apr 10 20:17:51 CEST 2011
Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
Changes since v1:
- Use 3 bits for rcsr mask
board/freescale/mx31pdk/mx31pdk.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
index 4ef548f..5fc6319 100644
--- a/board/freescale/mx31pdk/mx31pdk.c
+++ b/board/freescale/mx31pdk/mx31pdk.c
@@ -86,7 +86,30 @@ int board_late_init(void)
int checkboard(void)
{
- printf("Board: i.MX31 MAX PDK (3DS)\n");
+ u32 cause;
+ struct clock_control_regs *ccm =
+ (struct clock_control_regs *)CCM_BASE;
+ puts("Board: MX31PDK [");
+
+ cause = ccm->rcsr & 0x07;
+ switch (cause) {
+ case 0x0000:
+ puts("POR");
+ break;
+ case 0x0001:
+ puts("RST");
+ break;
+ case 0x0002:
+ puts("WDOG");
+ break;
+ case 0x0006:
+ puts("JTAG");
+ break;
+ default:
+ puts("unknown");
+ }
+
+ puts("]\n");
return 0;
}
--
1.6.0.4
More information about the U-Boot
mailing list