summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-02-07 21:38:41 +0800
committerDavid Hendricks <dhendrix@chromium.org>2013-02-07 22:54:03 +0100
commit9029f4b63f6d0e29bf1608e666cdb025de45ca24 (patch)
tree74bb18d0fa2edd61745ee83425be2eb827f20ae8 /src
parent632d6fe3fc8b71e00438bddf972ff2936447a03c (diff)
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. Change-Id: Ic863e222871a157ba4279a673775b1e18c6eac0d Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2308 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/snow/Makefile.inc4
-rw-r--r--src/mainboard/google/snow/bootblock.c11
-rw-r--r--src/mainboard/google/snow/romstage.c9
3 files changed, 9 insertions, 15 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 bcfe440379..18306cc51c 100644
--- a/src/mainboard/google/snow/bootblock.c
+++ b/src/mainboard/google/snow/bootblock.c
@@ -23,23 +23,14 @@
#include <cbfs.h>
#include <uart.h>
#include <console/console.h>
-#include <cpu/samsung/exynos5250/clk.h>
-#include <cpu/samsung/exynos5250/dmc.h>
#include <cpu/samsung/exynos5250/periph.h>
-#include <cpu/samsung/exynos5250/clock_init.h>
+#include <cpu/samsung/exynos5250/pinmux.h>
#endif
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_SERIAL_CONSOLE
exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
uart_init();
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 <cpu/samsung/exynos5250/dmc.h>
#include <cpu/samsung/exynos5250/setup.h>
+#include <cpu/samsung/exynos5250/clock_init.h>
#include <console/console.h>
#include <arch/stages.h>
@@ -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);