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

Submitted by Fabio Estevam on April 10, 2011, 6:17 p.m.

Details

Message ID 1302459471-12308-2-git-send-email-festevam@gmail.com
State Superseded
Headers show

Commit Message

Fabio Estevam April 10, 2011, 6:17 p.m.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Use 3 bits for rcsr mask

 board/freescale/mx31pdk/mx31pdk.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

Comments

Detlev Zundel April 13, 2011, 11:08 a.m.
Hi Fabio,

> Signed-off-by: Fabio Estevam <fabio.estevam@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;
>  }

Didn't we agree to move this into CPU specific code so other i.MX31
boards will profit from it as well?  Can you remind me why this does not
happen?

Cheers
  Detlev

Patch hide | download patch | download mbox

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;
 }