hardware-init-review/listings/src_lib_prog_loaders.c

29 lines
477 B
C

void run_romstage(void)
{
struct prog romstage =
PROG_INIT(PROG_ROMSTAGE, CONFIG_CBFS_PREFIX "/romstage");
vboot_run_logic();
if (prog_locate(&romstage))
goto fail;
timestamp_add_now(TS_START_COPYROM);
if (cbfs_prog_stage_load(&romstage))
goto fail;
timestamp_add_now(TS_END_COPYROM);
console_time_report();
prog_run(&romstage);
fail:
if (CONFIG(BOOTBLOCK_CONSOLE))
die_with_post_code(POST_INVALID_ROM,
"Couldn't load romstage.\n");
halt();
}