From f0a3d444580a8dd80c6f8260be2fbd1448118faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 18 Aug 2019 08:02:23 +0300 Subject: emulation/qemu-x86: Use common romstage code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This provides stack guards with checking and common entry into postcar. Change-Id: If0729721f0165187946107eb98e8bc754f28e517 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34973 Reviewed-by: Patrick Rudolph Tested-by: build bot (Jenkins) --- src/mainboard/emulation/qemu-i440fx/memory.c | 6 ++++++ src/mainboard/emulation/qemu-i440fx/romstage.c | 23 +---------------------- src/mainboard/emulation/qemu-q35/romstage.c | 21 +-------------------- 3 files changed, 8 insertions(+), 42 deletions(-) (limited to 'src/mainboard') diff --git a/src/mainboard/emulation/qemu-i440fx/memory.c b/src/mainboard/emulation/qemu-i440fx/memory.c index aa1ceba410..8209379bef 100644 --- a/src/mainboard/emulation/qemu-i440fx/memory.c +++ b/src/mainboard/emulation/qemu-i440fx/memory.c @@ -15,6 +15,7 @@ #include #include +#include #include "memory.h" #include "fw_cfg.h" @@ -61,3 +62,8 @@ void *cbmem_top(void) return (void *)top; } + +/* Nothing to do, MTRRs are no-op on QEMU. */ +void fill_postcar_frame(struct postcar_frame *pcf) +{ +} diff --git a/src/mainboard/emulation/qemu-i440fx/romstage.c b/src/mainboard/emulation/qemu-i440fx/romstage.c index 32eab3de3a..8e5691fc71 100644 --- a/src/mainboard/emulation/qemu-i440fx/romstage.c +++ b/src/mainboard/emulation/qemu-i440fx/romstage.c @@ -14,31 +14,10 @@ * GNU General Public License for more details. */ -#include #include -#include #include -#include -#include -#include -asmlinkage void car_stage_entry(void) +void mainboard_romstage_entry(void) { - struct postcar_frame pcf; - - console_init(); - cbmem_recovery(0); - - timestamp_add_now(TS_START_ROMSTAGE); - - if (postcar_frame_init(&pcf, 0)) - die("Unable to initialize postcar frame.\n"); - - /** - * Run postcar to tear down CAR and load relocatable ramstage. - * There's no CAR on qemu, but for educational purposes and - * testing the postcar stage is used on qemu, too. - */ - run_postcar_phase(&pcf); } diff --git a/src/mainboard/emulation/qemu-q35/romstage.c b/src/mainboard/emulation/qemu-q35/romstage.c index 6cd9ee4123..b7fdac2552 100644 --- a/src/mainboard/emulation/qemu-q35/romstage.c +++ b/src/mainboard/emulation/qemu-q35/romstage.c @@ -14,14 +14,10 @@ * GNU General Public License for more details. */ -#include #include -#include #include #include -#include #include -#include #include #define D0F0_PCIEXBAR_LO 0x60 @@ -35,26 +31,11 @@ static void mainboard_machine_check(void) die("You must run qemu for machine Q35 (-M q35)"); } -asmlinkage void car_stage_entry(void) +void mainboard_romstage_entry(void) { - struct postcar_frame pcf; i82801ix_early_init(); - console_init(); mainboard_machine_check(); cbmem_recovery(0); - - timestamp_add_now(TS_START_ROMSTAGE); - - if (postcar_frame_init(&pcf, 0)) - die("Unable to initialize postcar frame.\n"); - - /** - * Run postcar to tear down CAR and load relocatable ramstage. - * There's no CAR on qemu, but for educational purposes and - * testing the postcar stage is used on qemu, too. - */ - - run_postcar_phase(&pcf); } -- cgit v1.2.3