From 87d6550c1f2a902592be6604921a7f557c264168 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Thu, 7 Feb 2013 21:38:41 +0800 Subject: [PATCH] armv7/snow: Move clock initialization from bootblock to romstage. Exynos system clock can be initialized before RAM init, not necessary to be in the very beginning (boot block). This helps reducing bootblock dependency. Verified to boot on armv7/snow. Note: this patch was originally introduced in 2308, but there were some ordering issues so it was reverted. Change-Id: Ibc91c0e26ea8881751fc088754f5c6161d011b68 Signed-off-by: Hung-Te Lin Signed-off-by: David Hendricks Reviewed-on: http://review.coreboot.org/2320 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/mainboard/google/snow/Makefile.inc | 4 ---- src/mainboard/google/snow/bootblock.c | 20 ++++++-------------- src/mainboard/google/snow/romstage.c | 9 ++++++++- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/mainboard/google/snow/Makefile.inc b/src/mainboard/google/snow/Makefile.inc index 04bf543d40..b56a1a42cf 100644 --- a/src/mainboard/google/snow/Makefile.inc +++ b/src/mainboard/google/snow/Makefile.inc @@ -17,10 +17,6 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# needed for system_clock_init() -bootblock-y += mainboard.c -bootblock-y += memory.c - romstage-y += mainboard.c romstage-y += memory.c romstage-y += romstage.c diff --git a/src/mainboard/google/snow/bootblock.c b/src/mainboard/google/snow/bootblock.c index 00e97c1674..9725af3dae 100644 --- a/src/mainboard/google/snow/bootblock.c +++ b/src/mainboard/google/snow/bootblock.c @@ -19,28 +19,20 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include +#include +#include #define I2C0_BASE 0x12c60000 void bootblock_mainboard_init(void); void bootblock_mainboard_init(void) { - struct mem_timings *mem; - struct arm_clk_ratios *arm_ratios; - - mem = get_mem_timings(); - arm_ratios = get_arm_clk_ratios(); - system_clock_init(mem, arm_ratios); +#if CONFIG_EARLY_CONSOLE exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); - console_init(); printk(BIOS_INFO, "\n\n\n%s: UART initialized\n", __func__); +#endif } diff --git a/src/mainboard/google/snow/romstage.c b/src/mainboard/google/snow/romstage.c index b8e5116b22..c0bb6f4be0 100644 --- a/src/mainboard/google/snow/romstage.c +++ b/src/mainboard/google/snow/romstage.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -48,13 +49,19 @@ static int board_wakeup_permitted(void) void main(void) { struct mem_timings *mem; + struct arm_clk_ratios *arm_ratios; int ret; void *entry; + /* Clock must be initialized before console_init, otherwise you may need + * to re-initialize serial console drivers again. */ + mem = get_mem_timings(); + arm_ratios = get_arm_clk_ratios(); + system_clock_init(mem, arm_ratios); + console_init(); printk(BIOS_INFO, "hello from romstage\n"); - mem = get_mem_timings(); if (!mem) { printk(BIOS_CRIT, "Unable to auto-detect memory timings\n"); while(1);