diff options
author | Julius Werner <jwerner@chromium.org> | 2018-08-10 16:13:26 -0700 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2018-08-17 21:29:46 +0000 |
commit | 5d6593a43c728a9d526a3cb0026048bf335830d4 (patch) | |
tree | 973e093b9daf4edd1c6b6a13b70ba97cce6483d3 /src/mainboard/google/gru | |
parent | 2d22cda32c5b9f21ab0c7271bc88a2472fc0fda2 (diff) |
arm64: Factor out common parts of romstage execution flow
The romstage main() entry point on arm64 boards is usually in mainboard
code, but there are a handful of lines that are always needed in there
and not really mainboard specific (or chipset specific). We keep arguing
every once in a while that this isn't ideal, so rather than arguing any
longer let's just fix it. This patch moves the main() function into arch
code with callbacks that the platform can hook into. (This approach can
probably be expanded onto other architectures, so when that happens this
file should move into src/lib.)
Tested on Cheza and Kevin. I think the approach is straight-forward
enough that we can take this without testing every board. (Note that in
a few cases, this delays some platform-specific calls until after
console_init() and exception_init()... since these functions don't
really take that long, especially if there is no serial console
configured, I don't expect this to cause any issues.)
Change-Id: I7503acafebabed00dfeedb00b1354a26c536f0fe
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/28199
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/gru')
-rw-r--r-- | src/mainboard/google/gru/romstage.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/mainboard/google/gru/romstage.c b/src/mainboard/google/gru/romstage.c index 9f938f3eb2..edf440d00e 100644 --- a/src/mainboard/google/gru/romstage.c +++ b/src/mainboard/google/gru/romstage.c @@ -14,24 +14,14 @@ * */ -#include <arch/cache.h> -#include <arch/cpu.h> -#include <arch/exception.h> #include <arch/mmu.h> -#include <cbfs.h> -#include <cbmem.h> -#include <gpio.h> -#include <console/console.h> +#include <arch/stages.h> #include <delay.h> -#include <program_loading.h> -#include <romstage_handoff.h> -#include <soc/addressmap.h> #include <soc/mmu_operations.h> #include <soc/tsadc.h> #include <soc/sdram.h> #include <symbols.h> #include <soc/usb.h> -#include <stdlib.h> #include "board.h" #include "pwm_regulator.h" @@ -70,11 +60,9 @@ static void prepare_usb(void) reset_usb_otg1(); } -void main(void) +void platform_romstage_main(void) { - console_init(); tsadc_init(TSHUT_POL_HIGH); - exception_init(); /* Init DVS to conservative values. */ init_dvs_outputs(); @@ -87,6 +75,4 @@ void main(void) mmu_config_range((void *)0, (uintptr_t)sdram_size_mb() * MiB, CACHED_MEM); mmu_config_range(_dma_coherent, _dma_coherent_size, UNCACHED_MEM); - cbmem_initialize_empty(); - run_ramstage(); } |