From f1e321001d5954096f06f9a43138219a9a46536e Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 25 Nov 2014 13:22:20 -0800 Subject: arm: Add bootblock_mainboard_early_init() for pre-console initialization On most platforms, enabling the console and exception handlers are amongst the very first things you want to do, as they help you see what's going on and debug errors in other early init code. However, most ARM boards require some small amount of board-specific initialization (pinmuxing, maybe clocks) to get the UART running, which is why bootblock_mainboard_init() (and with it almost all of the actual bootblock code) always had to run before console initialization for now. This patch introduces an explicit bootblock_mainboard_early_init() hook for only that part of initialization that absolutely needs to run before console output. The other two hooks for SoC and mainboard are moved below console_init(). This model has already proven its worth before in the tegra124 and tegra132 custom bootblocks. BRANCH=None BUG=chrome-os-partner:32123 TEST=Booted on Pinky. Compiled for Daisy, Storm and Ryu. Change-Id: I510c58189faf0c08c740bcc3b5a654f81f892464 Signed-off-by: Patrick Georgi Original-Commit-Id: f58e84a2fc1c9951e9c4c65cdec1dbeb6a20d597 Original-Change-Id: I4257b5a8807595140e8c973ca04e68ea8630bf9a Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/231941 Reviewed-on: http://review.coreboot.org/9603 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/arch/arm/armv4/bootblock_simple.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/arch/arm/armv4') diff --git a/src/arch/arm/armv4/bootblock_simple.c b/src/arch/arm/armv4/bootblock_simple.c index 9e399a9b7c..26646eebf5 100644 --- a/src/arch/arm/armv4/bootblock_simple.c +++ b/src/arch/arm/armv4/bootblock_simple.c @@ -26,18 +26,21 @@ #include #include +__attribute__((weak)) void bootblock_mainboard_early_init(void) { /* no-op */ } __attribute__((weak)) void bootblock_soc_init(void) { /* do nothing */ } __attribute__((weak)) void bootblock_mainboard_init(void) { /* do nothing */ } void main(void) { - bootblock_soc_init(); - bootblock_mainboard_init(); + bootblock_mainboard_early_init(); if (CONFIG_BOOTBLOCK_CONSOLE) { console_init(); exception_init(); } + bootblock_soc_init(); + bootblock_mainboard_init(); + run_romstage(); } -- cgit v1.2.3