| 57 | } |
| 58 | |
| 59 | void vboot_run_logic(void) |
| 60 | { |
| 61 | if (verification_should_run()) { |
| 62 | /* Note: this path is not used for VBOOT_RETURN_FROM_VERSTAGE */ |
| 63 | verstage_main(); |
| 64 | after_verstage(); |
| 65 | } else if (verstage_should_load()) { |
| 66 | struct prog verstage = |
| 67 | PROG_INIT(PROG_VERSTAGE, |
| 68 | CONFIG_CBFS_PREFIX "/verstage"); |
| 69 | |
| 70 | printk(BIOS_DEBUG, "VBOOT: Loading verstage.\n"); |
| 71 | |
| 72 | timestamp_add_now(TS_COPYVER_START); |
| 73 | if (cbfs_prog_stage_load(&verstage)) |
| 74 | die("failed to load verstage"); |
| 75 | timestamp_add_now(TS_COPYVER_END); |
| 76 | |
| 77 | /* verify and select a slot */ |
| 78 | prog_run(&verstage); |
| 79 | |
| 80 | /* This is not actually possible to hit this condition at |
| 81 | * runtime, but this provides a hint to the compiler for dead |
| 82 | * code elimination below. */ |
| 83 | if (!CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) |
| 84 | return; |
| 85 | |
| 86 | after_verstage(); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | const struct cbfs_boot_device *vboot_get_cbfs_boot_device(void) |
| 91 | { |
nothing calls this directly
no test coverage detected