public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause()
@ 2011-04-18 17:38 Fabio Estevam
  2011-04-18 17:38 ` [U-Boot] [PATCH] MX31: mx31pdk: Make the board name simpler Fabio Estevam
  2011-04-19 15:17 ` [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause() Detlev Zundel
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2011-04-18 17:38 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
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(-)

diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c
index 9b7a7a2..a92731e 100644
--- a/arch/arm/cpu/arm1136/mx31/generic.c
+++ b/arch/arm/cpu/arm1136/mx31/generic.c
@@ -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
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] MX31: mx31pdk: Make the board name simpler.
  2011-04-18 17:38 [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause() Fabio Estevam
@ 2011-04-18 17:38 ` Fabio Estevam
  2011-04-19 15:17 ` [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause() Detlev Zundel
  1 sibling, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2011-04-18 17:38 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/freescale/mx31pdk/mx31pdk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
index 3f291fc..826fb4a 100644
--- a/board/freescale/mx31pdk/mx31pdk.c
+++ b/board/freescale/mx31pdk/mx31pdk.c
@@ -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;
 }
 
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause()
  2011-04-18 17:38 [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause() Fabio Estevam
  2011-04-18 17:38 ` [U-Boot] [PATCH] MX31: mx31pdk: Make the board name simpler Fabio Estevam
@ 2011-04-19 15:17 ` Detlev Zundel
  2011-04-20 19:10   ` Albert ARIBAUD
  1 sibling, 1 reply; 4+ messages in thread
From: Detlev Zundel @ 2011-04-19 15:17 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> 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(-)

Thanks, this looks good.  Now all i.MX31 boards profit!

Acked-by: Detlev Zundel <dzu@denx.de>

-- 
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.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause()
  2011-04-19 15:17 ` [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause() Detlev Zundel
@ 2011-04-20 19:10   ` Albert ARIBAUD
  0 siblings, 0 replies; 4+ messages in thread
From: Albert ARIBAUD @ 2011-04-20 19:10 UTC (permalink / raw)
  To: u-boot

Le 19/04/2011 17:17, Detlev Zundel a ?crit :
> Hi Fabio,
>
>> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
>> ---
>> 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(-)
>
> Thanks, this looks good.  Now all i.MX31 boards profit!
>
> Acked-by: Detlev Zundel<dzu@denx.de>

Stefano, does this get in your tree?

Amicalement,
-- 
Albert.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-20 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-18 17:38 [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause() Fabio Estevam
2011-04-18 17:38 ` [U-Boot] [PATCH] MX31: mx31pdk: Make the board name simpler Fabio Estevam
2011-04-19 15:17 ` [U-Boot] [PATCH v5] MX31: Introduce get_reset_cause() Detlev Zundel
2011-04-20 19:10   ` Albert ARIBAUD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox