summaryrefslogtreecommitdiff
path: root/src/cpu/qemu-x86/bootblock.c
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2018-11-11 12:50:51 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-11-12 15:57:34 +0000
commit1af89237094246216c6f60d77d74690a39907999 (patch)
tree20c369514e4a340ed33199c0eb8c95adfa577c94 /src/cpu/qemu-x86/bootblock.c
parent7665aefb0ad216ee76307193b849834eac7b1f88 (diff)
downloadcoreboot-1af89237094246216c6f60d77d74690a39907999.tar.xz
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 <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/29578 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/cpu/qemu-x86/bootblock.c')
-rw-r--r--src/cpu/qemu-x86/bootblock.c35
1 files changed, 35 insertions, 0 deletions
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 <siro@das-labor.org>
+ *
+ * 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 <bootblock_common.h>
+#include <console/console.h>
+#include <cpu/x86/bist.h>
+
+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);
+}