public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] mx53loco: Allow to print CPU information at a later stage
Date: Mon, 30 Apr 2012 15:12:03 -0300	[thread overview]
Message-ID: <1335809524-1994-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1335809524-1994-1-git-send-email-festevam@gmail.com>

Print CPU information within board_late_init().

This is in preparation for adding 1GHz support, which requires programming a PMIC
via I2C. As I2C is only available after relocation, print the CPU information
later at board_late_init(), so that the CPU frequency can be printed correctly.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Rebased against Stefano's u-boot-imx plus the v2 version of
http://marc.info/?l=u-boot&m=133572323109396&w=2

 arch/arm/cpu/armv7/imx-common/cpu.c       |    2 +-
 arch/arm/include/asm/arch-mx5/sys_proto.h |    1 +
 board/freescale/mx53loco/mx53loco.c       |   22 ++++++++++++++++++++++
 include/configs/mx53loco.h                |    1 -
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/cpu/armv7/imx-common/cpu.c
index b96fa5b..b3195dd 100644
--- a/arch/arm/cpu/armv7/imx-common/cpu.c
+++ b/arch/arm/cpu/armv7/imx-common/cpu.c
@@ -35,7 +35,7 @@
 #include <fsl_esdhc.h>
 #endif
 
-static char *get_reset_cause(void)
+char *get_reset_cause(void)
 {
 	u32 cause;
 	struct src *src_regs = (struct src *)SRC_BASE_ADDR;
diff --git a/arch/arm/include/asm/arch-mx5/sys_proto.h b/arch/arm/include/asm/arch-mx5/sys_proto.h
index 3f10d29..7b5246e 100644
--- a/arch/arm/include/asm/arch-mx5/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx5/sys_proto.h
@@ -37,5 +37,6 @@ void set_chipselect_size(int const);
 int fecmxc_initialize(bd_t *bis);
 u32 get_ahb_clk(void);
 u32 get_periph_clk(void);
+char *get_reset_cause(void);
 
 #endif
diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 7ea9f6e..46aaeb2 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -299,6 +299,28 @@ int board_early_init_f(void)
 	return 0;
 }
 
+int print_cpuinfo(void)
+{
+	u32 cpurev;
+
+	cpurev = get_cpu_rev();
+	printf("CPU:   Freescale i.MX%x family rev%d.%d at %d MHz\n",
+		(cpurev & 0xFF000) >> 12,
+		(cpurev & 0x000F0) >> 4,
+		(cpurev & 0x0000F) >> 0,
+		mxc_get_clock(MXC_ARM_CLK) / 1000000);
+	printf("Reset cause: %s\n", get_reset_cause());
+	return 0;
+}
+
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+	print_cpuinfo();
+	return 0;
+}
+#endif
+
 int board_init(void)
 {
 	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index af59307..0778bde 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -27,7 +27,6 @@
 
 #define CONFIG_SYS_MX5_HCLK	24000000
 #define CONFIG_SYS_MX5_CLK32		32768
-#define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
 #define CONFIG_MACH_TYPE	MACH_TYPE_MX53_LOCO
-- 
1.7.1

  reply	other threads:[~2012-04-30 18:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30 18:12 [U-Boot] [PATCH 1/3] mx5: Add clock config interface Fabio Estevam
2012-04-30 18:12 ` Fabio Estevam [this message]
2012-05-06 15:43   ` [U-Boot] [PATCH 2/3] mx53loco: Allow to print CPU information at a later stage Stefano Babic
2012-05-06 15:48   ` Stefano Babic
2012-04-30 18:12 ` [U-Boot] [PATCH 3/3] mx53loco: Add support for 1GHz operation for DA9053-based boards Fabio Estevam
2012-05-06 15:44   ` Stefano Babic
2012-05-06 15:47   ` Stefano Babic
2012-05-04 16:22 ` [U-Boot] [PATCH 1/3] mx5: Add clock config interface Fabio Estevam
2012-05-06 15:48 ` Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335809524-1994-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox