aboutsummaryrefslogtreecommitdiff
path: root/src/security/vboot/vboot_loader.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-02-11 15:37:49 +0800
committerPatrick Georgi <pgeorgi@google.com>2019-03-14 11:47:28 +0000
commit0bcee882982543bcc3212ad7cdac47403d9de9c7 (patch)
tree55b9ea906a4195d0b41d3812b06931c813d40301 /src/security/vboot/vboot_loader.c
parent6b8a29e8b9d3f9458f6c960c307600c49624b7ee (diff)
vboot: copy data structures to CBMEM for downstream use
For platforms that do not employ VBOOT_STARTS_IN_ROMSTAGE, vboot verification occurs before CBMEM is brought online. In order to make vboot data structures available downstream, copy vb2_working_data from CAR/SRAM into CBMEM when CBMEM comes online. Create VBOOT_MIGRATE_WORKING_DATA config option to toggle this functionality. BUG=b:124141368, b:124192753 TEST=Built and deployed on eve with STARTS_IN_BOOTBLOCK TEST=Built and deployed on eve with STARTS_IN_ROMSTAGE TEST=util/lint/checkpatch.pl -g origin/master..HEAD TEST=util/abuild/abuild -B -e -y -c 50 -p none -x BRANCH=none Change-Id: I62c11268a83927bc00ae9bd93b1b31363b38e8cf Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31329 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/security/vboot/vboot_loader.c')
-rw-r--r--src/security/vboot/vboot_loader.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/security/vboot/vboot_loader.c b/src/security/vboot/vboot_loader.c
index b6c216d5fa..dd8c15c68f 100644
--- a/src/security/vboot/vboot_loader.c
+++ b/src/security/vboot/vboot_loader.c
@@ -27,6 +27,9 @@
_Static_assert(CONFIG(VBOOT_STARTS_IN_BOOTBLOCK) +
CONFIG(VBOOT_STARTS_IN_ROMSTAGE) == 1,
"vboot must either start in bootblock or romstage (not both!)");
+_Static_assert(CONFIG(VBOOT_STARTS_IN_BOOTBLOCK) ||
+ !CONFIG(VBOOT_MIGRATE_WORKING_DATA),
+ "no need to migrate working data after CBMEM is already up!");
_Static_assert(!CONFIG(VBOOT_SEPARATE_VERSTAGE) ||
CONFIG(VBOOT_STARTS_IN_BOOTBLOCK),
"stand-alone verstage must start in (i.e. after) bootblock");
@@ -126,10 +129,8 @@ static void vboot_prepare(void)
* other platforms the vboot cbmem objects are initialized when
* cbmem comes online.
*/
- if (ENV_ROMSTAGE && CONFIG(VBOOT_STARTS_IN_ROMSTAGE)) {
- vb2_store_selected_region();
+ if (ENV_ROMSTAGE && CONFIG(VBOOT_STARTS_IN_ROMSTAGE))
vboot_fill_handoff();
- }
}
static int vboot_locate(struct cbfs_props *props)