[U-Boot] [PATCH 2/2] MX31: mx31pdk: Print the cause of reset

Fabio Estevam fabio.estevam at freescale.com
Wed Mar 9 17:35:44 CET 2011


Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
 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 4a5d3ef..0462a22 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 & 0x03;
+	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