Alexandru Gagniuc (mr.nuke.me@gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12881
-gerrit
commit f6dd761b76b55c8b73e3267ba09b82a917a8e451 Author: Alexandru Gagniuc mr.nuke.me@gmail.com Date: Fri Jan 8 23:08:09 2016 -0800
cpu/qemu-x86: Use run_romstage instead of custom inline assembly
Now that passing the BIST result to romstage is no longer required, we no longer need to use custom assembly to call into romstage. Instead, a lot of the logic in the bootblock can now be replaced by a single call to run_romstage(). This is another step in converging the bootblock with the generic bootblock logic in lib/.
Change-Id: I66436c8fba5121a3758d02955f691ac9d273b049 Signed-off-by: Alexandru Gagniuc mr.nuke.me@gmail.com --- src/cpu/qemu-x86/bootblock.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-)
diff --git a/src/cpu/qemu-x86/bootblock.c b/src/cpu/qemu-x86/bootblock.c index b4700a7..056bde4 100644 --- a/src/cpu/qemu-x86/bootblock.c +++ b/src/cpu/qemu-x86/bootblock.c @@ -18,32 +18,8 @@ /* Called from assembly. Prototype not needed by external .c file */ asmlinkage void bootblock_main(uint32_t bist, uint32_t tsc_lo, uint32_t tsc_hi);
-/* - * TODO: Implement a generic fallback/normal mechanism - */ -static const char *get_next_stage_name(void) -{ - if (IS_ENABLED(CONFIG_BOOTBLOCK_SIMPLE)) - return CONFIG_CBFS_PREFIX "/romstage"; - - /* BOOTBLOCK_NORMAL not implemented */ - return CONFIG_CBFS_PREFIX "/romstage"; -} - -static void enter_romstage(void *romstage_entry, uint32_t bist) -{ - asm volatile ( - "jmp *%0\n\t" - : : "r" (romstage_entry), "a" (bist) - ); -} - asmlinkage void bootblock_main(uint32_t bist, uint32_t tsc_lo, uint32_t tsc_hi) { - void *entry; - struct cbfs_stage *romstage; - const char* target1 = get_next_stage_name(); - if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) console_init();
@@ -53,14 +29,8 @@ asmlinkage void bootblock_main(uint32_t bist, uint32_t tsc_lo, uint32_t tsc_hi) */ report_bist_failure(bist);
- romstage = cbfs_boot_map_with_leak(target1, CBFS_TYPE_STAGE, NULL); + run_romstage();
- /* - * TODO: Do something constructive with tsc_lo and tsc_hi - */ - if (romstage) { - entry = (void *)(uintptr_t)romstage->entry; - enter_romstage(entry, bist); - } + /* Should never be reached, but halt just in case. */ halt(); }