From 1af89237094246216c6f60d77d74690a39907999 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 11 Nov 2018 12:50:51 +0100 Subject: mb/emulation/qemu-i440fx|q35: Switch to C_ENVIRONMENT_BOOTBLOCK Useful for testing stuff in C_ENVIRONMENT_BOOTBLOCK, like VBOOT with separate verstage. Changes: * Use symbols to set up CAR and STACK * Zero CAR area * Move BIST failure checking to cpu folder * Rename functions where necessary Tested: * qemu-2.11.2 machine pc * qemu-2.11.2 machine q35 Test result: * BIST error reporting is still working. * Console starts in bootblock * SeaBios 1.11.2 as payload is still working Change-Id: Ibf341002c36d868b9b44c8b37381fa78ae5c4381 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/29578 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/cpu/qemu-x86/bootblock.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/cpu/qemu-x86/bootblock.c (limited to 'src/cpu/qemu-x86/bootblock.c') diff --git a/src/cpu/qemu-x86/bootblock.c b/src/cpu/qemu-x86/bootblock.c new file mode 100644 index 0000000000..fd14c7e0ef --- /dev/null +++ b/src/cpu/qemu-x86/bootblock.c @@ -0,0 +1,35 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2004 Stefan Reinauer + * Copyright (C) 2018 Patrick Rudolph + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include + +asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist); + +asmlinkage void bootblock_c_entry_bist(uint64_t base_timestamp, uint32_t bist) +{ + post_code(0x05); + + /* Halt if there was a built in self test failure */ + if (bist) { + console_init(); + report_bist_failure(bist); + } + + /* Call lib/bootblock.c main */ + bootblock_main_with_timestamp(base_timestamp, NULL, 0); +} -- cgit v1.2.3