From 5d6593a43c728a9d526a3cb0026048bf335830d4 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Fri, 10 Aug 2018 16:13:26 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/28199 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/mainboard/google/cheza/romstage.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/mainboard/google/cheza') diff --git a/src/mainboard/google/cheza/romstage.c b/src/mainboard/google/cheza/romstage.c index c930016080..ad8506193d 100644 --- a/src/mainboard/google/cheza/romstage.c +++ b/src/mainboard/google/cheza/romstage.c @@ -13,17 +13,8 @@ * GNU General Public License for more details. */ -#include -#include -#include -#include -#include -#include +#include -void main(void) +void platform_romstage_main(void) { - console_init(); - exception_init(); - cbmem_initialize_empty(); - run_ramstage(); } -- cgit v1.2.3