Andrey Petrov (andrey.petrov@intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13322
-gerrit
commit 3a4436c8f1d682e7b2e3c79852feb08052a0dc0c Author: Andrey Petrov andrey.petrov@intel.com Date: Tue Oct 27 12:43:44 2015 -0700
soc/apollolake/bootblock: Add transition to romstage
This adds calling romstage. Since by default romstage is run from CAR, a workaround is added as well to keep CAR executable.
Change-Id: Ied49a5695c6499ad0cfaf27e3ba6860a884a6684 Signed-off-by: Andrey Petrov andrey.petrov@intel.com --- src/soc/intel/apollolake/bootblock/bootblock_car.c | 28 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/soc/intel/apollolake/bootblock/bootblock_car.c b/src/soc/intel/apollolake/bootblock/bootblock_car.c index e9cbb09..251d7b5 100644 --- a/src/soc/intel/apollolake/bootblock/bootblock_car.c +++ b/src/soc/intel/apollolake/bootblock/bootblock_car.c @@ -11,9 +11,11 @@ */
#include <arch/io.h> +#include <cbfs.h> #include <console/console.h> #include <device/pci.h> #include <soc/bootblock.h> +#include <soc/cpu.h> #include <soc/uart.h>
static void disable_watchdog(void) @@ -32,8 +34,18 @@ static void disable_watchdog(void) outl(reg, 0x400 + 0x68); }
+static void call_romstage(void *entry) +{ + __asm__ volatile ( + "call *%0" + :: "r" (entry) + ); +} + void bootblock_car_main(void) { + void *romstage_entry; + /* Quick post code to show we made it to C code */ outb(0x30, 0x80);
@@ -45,7 +57,17 @@ void bootblock_car_main(void) /* Wait until after we have console to disable this */ disable_watchdog();
- /* Don't return, so we see the above post code */ - while (1) - ; + romstage_entry = cbfs_boot_load_stage_by_name("fallback/romstage"); + if (!romstage_entry) { + outb(POST_DIE, 0x80); + die("romstage not found\n"); + } + + /* APLK workaround: do this magic to keep cache executable on update */ + bxt_remark_cache_exec(); + + /* Call the romstage entry point */ + call_romstage(romstage_entry); + + /* We should never reach this */ }