arm64: Factor out common parts of romstage execution flow

Hardware / Coreboot - Julius Werner [chromium.org] - 17 August 2018 21:29 EDT

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

5d6593a43c arm64: Factor out common parts of romstage execution flow
src/arch/arm64/Makefile.inc | 1 +
src/arch/arm64/include/arch/stages.h | 7 +++++
src/arch/arm64/romstage.c | 39 ++++++++++++++++++++++++++
src/mainboard/cavium/cn8100_sff_evb/romstage.c | 14 ++-------
src/mainboard/google/cheza/romstage.c | 13 ++-------
src/mainboard/google/gru/romstage.c | 18 ++----------
src/mainboard/google/kukui/romstage.c | 15 ++--------
src/mainboard/google/oak/romstage.c | 31 +++-----------------
src/soc/mediatek/mt8183/Makefile.inc | 2 +-
9 files changed, 60 insertions(+), 80 deletions(-)

Upstream: review.coreboot.org


  • Share