public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label
@ 2011-04-16  2:54 Fabio Estevam
  2011-04-16  2:54 ` [U-Boot] [PATCH v4 2/3] MX31: Introduce get_reset_cause() Fabio Estevam
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Fabio Estevam @ 2011-04-16  2:54 UTC (permalink / raw)
  To: u-boot

Commit 5d2c154 (IMX: MX31: Cleanup include files and drop nasty #ifdef in drivers)
renamed mx31-imx-regs.h to imx-regs.h.

Change the file label accordingly.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
This patch series should were applied in the u-boot-arm tree.
It also needs the following patch to be applied first:
[PATCH v5] ARM: mx31: Print the silicon version

 arch/arm/include/asm/arch-mx31/imx-regs.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx31/imx-regs.h b/arch/arm/include/asm/arch-mx31/imx-regs.h
index 0eeaf39..74444f2 100644
--- a/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -21,8 +21,8 @@
  * MA 02111-1307 USA
  */
 
-#ifndef __ASM_ARCH_MX31_REGS_H
-#define __ASM_ARCH_MX31_REGS_H
+#ifndef __ASM_ARCH_MX31_IMX_REGS_H
+#define __ASM_ARCH_MX31_IMX_REGS_H
 
 #if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
 #include <asm/types.h>
@@ -774,4 +774,4 @@ enum iomux_pins {
 #define MXC_EHCI_IPPUE_DOWN		(1 << 8)
 #define MXC_EHCI_IPPUE_UP		(1 << 9)
 
-#endif /* __ASM_ARCH_MX31_REGS_H */
+#endif /* __ASM_ARCH_MX31_IMX_REGS_H */
-- 
1.6.0.4

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

* [U-Boot] [PATCH v4 2/3] MX31: Introduce get_reset_cause()
  2011-04-16  2:54 [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Fabio Estevam
@ 2011-04-16  2:54 ` Fabio Estevam
  2011-04-16  2:54   ` [U-Boot] [PATCH v4 3/3] MX31: mx31pdk: Print the cause of reset Fabio Estevam
  2011-04-16  3:28 ` [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Albert ARIBAUD
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2011-04-16  2:54 UTC (permalink / raw)
  To: u-boot

Introduce get_reset_cause() function to indicate the source of the reset.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/cpu/arm1136/mx31/generic.c        |   26 +++++++++++++++++++++++++
 arch/arm/include/asm/arch-mx31/sys_proto.h |   29 ++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-mx31/sys_proto.h

diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c
index 9b7a7a2..ea452a9 100644
--- a/arch/arm/cpu/arm1136/mx31/generic.c
+++ b/arch/arm/cpu/arm1136/mx31/generic.c
@@ -132,6 +132,32 @@ char *get_cpu_rev(void)
 		return "unknown";
 }
 
+char *get_reset_cause(void)
+{
+	/* read SRS 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)
 {
diff --git a/arch/arm/include/asm/arch-mx31/sys_proto.h b/arch/arm/include/asm/arch-mx31/sys_proto.h
new file mode 100644
index 0000000..7a0d03f
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx31/sys_proto.h
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2011
+ * Stefano Babic, DENX Software Engineering, sbabic at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _SYS_PROTO_H_
+#define _SYS_PROTO_H_
+
+extern char *get_reset_cause(void);
+
+#endif
-- 
1.6.0.4

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

* [U-Boot] [PATCH v4 3/3] MX31: mx31pdk: Print the cause of reset
  2011-04-16  2:54 ` [U-Boot] [PATCH v4 2/3] MX31: Introduce get_reset_cause() Fabio Estevam
@ 2011-04-16  2:54   ` Fabio Estevam
  2011-04-16  3:34     ` Albert ARIBAUD
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2011-04-16  2:54 UTC (permalink / raw)
  To: u-boot

Print the cause of reset and also change the board name to only 'MX31PDK'.

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

diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
index 3f291fc..b21f7e5 100644
--- a/board/freescale/mx31pdk/mx31pdk.c
+++ b/board/freescale/mx31pdk/mx31pdk.c
@@ -28,6 +28,7 @@
 #include <netdev.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/imx-regs.h>
+#include <asm/arch/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -70,7 +71,7 @@ int board_init(void)
 
 int checkboard(void)
 {
-	printf("Board: i.MX31 MAX PDK (3DS)\n");
+	printf("Board: MX31PDK [%s]\n", get_reset_cause());
 	return 0;
 }
 
-- 
1.6.0.4

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

* [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label
  2011-04-16  2:54 [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Fabio Estevam
  2011-04-16  2:54 ` [U-Boot] [PATCH v4 2/3] MX31: Introduce get_reset_cause() Fabio Estevam
@ 2011-04-16  3:28 ` Albert ARIBAUD
  2011-04-16  3:31 ` Albert ARIBAUD
  2011-04-21 17:43 ` Stefano Babic
  3 siblings, 0 replies; 7+ messages in thread
From: Albert ARIBAUD @ 2011-04-16  3:28 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

Le 16/04/2011 04:54, Fabio Estevam a ?crit :
> Commit 5d2c154 (IMX: MX31: Cleanup include files and drop nasty #ifdef in drivers)
> renamed mx31-imx-regs.h to imx-regs.h.
>
> Change the file label accordingly.
>
> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
> ---
> This patch series should were applied in the u-boot-arm tree.
> It also needs the following patch to be applied first:
> [PATCH v5] ARM: mx31: Print the silicon version
>
>   arch/arm/include/asm/arch-mx31/imx-regs.h |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)

Please provide changelog of patch versions below commit message 
separator ('---') for each patch.

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label
  2011-04-16  2:54 [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Fabio Estevam
  2011-04-16  2:54 ` [U-Boot] [PATCH v4 2/3] MX31: Introduce get_reset_cause() Fabio Estevam
  2011-04-16  3:28 ` [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Albert ARIBAUD
@ 2011-04-16  3:31 ` Albert ARIBAUD
  2011-04-21 17:43 ` Stefano Babic
  3 siblings, 0 replies; 7+ messages in thread
From: Albert ARIBAUD @ 2011-04-16  3:31 UTC (permalink / raw)
  To: u-boot

Le 16/04/2011 04:54, Fabio Estevam a ?crit :
> Commit 5d2c154 (IMX: MX31: Cleanup include files and drop nasty #ifdef in drivers)
> renamed mx31-imx-regs.h to imx-regs.h.
>
> Change the file label accordingly.
>
> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
> ---
> This patch series should were applied in the u-boot-arm tree.
> It also needs the following patch to be applied first:
> [PATCH v5] ARM: mx31: Print the silicon version

So the dependency is on the IMX tree rather than ARM tree: this patch 
series should rather be applied on top of u-boot-imx, then I'll pull it 
in with all of the IMX changes for this version.

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH v4 3/3] MX31: mx31pdk: Print the cause of reset
  2011-04-16  2:54   ` [U-Boot] [PATCH v4 3/3] MX31: mx31pdk: Print the cause of reset Fabio Estevam
@ 2011-04-16  3:34     ` Albert ARIBAUD
  0 siblings, 0 replies; 7+ messages in thread
From: Albert ARIBAUD @ 2011-04-16  3:34 UTC (permalink / raw)
  To: u-boot

Le 16/04/2011 04:54, Fabio Estevam a ?crit :
> Print the cause of reset and also change the board name to only 'MX31PDK'.
>
> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
> ---
>   board/freescale/mx31pdk/mx31pdk.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c
> index 3f291fc..b21f7e5 100644
> --- a/board/freescale/mx31pdk/mx31pdk.c
> +++ b/board/freescale/mx31pdk/mx31pdk.c
> @@ -28,6 +28,7 @@
>   #include<netdev.h>
>   #include<asm/arch/clock.h>
>   #include<asm/arch/imx-regs.h>
> +#include<asm/arch/sys_proto.h>
>
>   DECLARE_GLOBAL_DATA_PTR;
>
> @@ -70,7 +71,7 @@ int board_init(void)
>
>   int checkboard(void)
>   {
> -	printf("Board: i.MX31 MAX PDK (3DS)\n");
> +	printf("Board: MX31PDK [%s]\n", get_reset_cause());
>   	return 0;
>   }
>

Maybe a clearer message, rather than just '[%s]', something like '[reset 
cause: %s]'?

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label
  2011-04-16  2:54 [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Fabio Estevam
                   ` (2 preceding siblings ...)
  2011-04-16  3:31 ` Albert ARIBAUD
@ 2011-04-21 17:43 ` Stefano Babic
  3 siblings, 0 replies; 7+ messages in thread
From: Stefano Babic @ 2011-04-21 17:43 UTC (permalink / raw)
  To: u-boot

On 04/16/2011 04:54 AM, Fabio Estevam wrote:
> Commit 5d2c154 (IMX: MX31: Cleanup include files and drop nasty #ifdef in drivers)
> renamed mx31-imx-regs.h to imx-regs.h.
> 
> Change the file label accordingly.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Applied to u-boot-imx, thanks.

Regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

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

end of thread, other threads:[~2011-04-21 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-16  2:54 [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Fabio Estevam
2011-04-16  2:54 ` [U-Boot] [PATCH v4 2/3] MX31: Introduce get_reset_cause() Fabio Estevam
2011-04-16  2:54   ` [U-Boot] [PATCH v4 3/3] MX31: mx31pdk: Print the cause of reset Fabio Estevam
2011-04-16  3:34     ` Albert ARIBAUD
2011-04-16  3:28 ` [U-Boot] [PATCH v4 1/3] ARM: MX31: Fix file name label Albert ARIBAUD
2011-04-16  3:31 ` Albert ARIBAUD
2011-04-21 17:43 ` Stefano Babic

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