1 From 255fe9c082f3a409d366517bb5e92d299fdbf2ff Mon Sep 17 00:00:00 2001
2 From: Fabio Estevam <festevam@gmail.com>
3 Date: Mon, 30 Apr 2012 08:12:03 +0000
4 Subject: [PATCH 18/56] mx53loco: Allow to print CPU information at a later
7 Print CPU information within board_late_init().
9 This is in preparation for adding 1GHz support, which requires programming a PMIC
10 via I2C. As I2C is only available after relocation, print the CPU information
11 later at board_late_init(), so that the CPU frequency can be printed correctly.
13 Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
14 Acked-by: Stefano Babic <sbabic@denx.de>
16 arch/arm/cpu/armv7/imx-common/cpu.c | 2 +-
17 arch/arm/include/asm/arch-mx5/sys_proto.h | 1 +
18 board/freescale/mx53loco/mx53loco.c | 22 ++++++++++++++++++++++
19 include/configs/mx53loco.h | 1 -
20 4 files changed, 24 insertions(+), 2 deletions(-)
22 diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/cpu/armv7/imx-common/cpu.c
23 index b96fa5b..b3195dd 100644
24 --- a/arch/arm/cpu/armv7/imx-common/cpu.c
25 +++ b/arch/arm/cpu/armv7/imx-common/cpu.c
27 #include <fsl_esdhc.h>
30 -static char *get_reset_cause(void)
31 +char *get_reset_cause(void)
34 struct src *src_regs = (struct src *)SRC_BASE_ADDR;
35 diff --git a/arch/arm/include/asm/arch-mx5/sys_proto.h b/arch/arm/include/asm/arch-mx5/sys_proto.h
36 index 3f10d29..7b5246e 100644
37 --- a/arch/arm/include/asm/arch-mx5/sys_proto.h
38 +++ b/arch/arm/include/asm/arch-mx5/sys_proto.h
39 @@ -37,5 +37,6 @@ void set_chipselect_size(int const);
40 int fecmxc_initialize(bd_t *bis);
41 u32 get_ahb_clk(void);
42 u32 get_periph_clk(void);
43 +char *get_reset_cause(void);
46 diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
47 index 7ea9f6e..46aaeb2 100644
48 --- a/board/freescale/mx53loco/mx53loco.c
49 +++ b/board/freescale/mx53loco/mx53loco.c
50 @@ -299,6 +299,28 @@ int board_early_init_f(void)
54 +int print_cpuinfo(void)
58 + cpurev = get_cpu_rev();
59 + printf("CPU: Freescale i.MX%x family rev%d.%d at %d MHz\n",
60 + (cpurev & 0xFF000) >> 12,
61 + (cpurev & 0x000F0) >> 4,
62 + (cpurev & 0x0000F) >> 0,
63 + mxc_get_clock(MXC_ARM_CLK) / 1000000);
64 + printf("Reset cause: %s\n", get_reset_cause());
68 +#ifdef CONFIG_BOARD_LATE_INIT
69 +int board_late_init(void)
78 gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
79 diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
80 index af59307..0778bde 100644
81 --- a/include/configs/mx53loco.h
82 +++ b/include/configs/mx53loco.h
85 #define CONFIG_SYS_MX5_HCLK 24000000
86 #define CONFIG_SYS_MX5_CLK32 32768
87 -#define CONFIG_DISPLAY_CPUINFO
88 #define CONFIG_DISPLAY_BOARDINFO
90 #define CONFIG_MACH_TYPE MACH_TYPE_MX53_LOCO