From fe338e2319f40a22f1c64aef3df95e015ab8b90b Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Mon, 18 Nov 2019 12:35:21 -0700 Subject: cbfs: switch to region_device for location APIs Drop struct cbfs_props and replace with struct region_device object. The goal of the cbfs locator APIs are to determine the correct region device to find the cbfs files. Therefore, start directly using struct region_device in the cbfs location paths. Update the users of the API and leverage the default boot region device implementation for apollolake. Change-Id: I0158a095cc64c9900d8738f8ffd45ae4040575ea Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/c/coreboot/+/36939 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/security/vboot/vboot_loader.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/security') diff --git a/src/security/vboot/vboot_loader.c b/src/security/vboot/vboot_loader.c index 3903f18f6b..3e491a7200 100644 --- a/src/security/vboot/vboot_loader.c +++ b/src/security/vboot/vboot_loader.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -71,10 +72,9 @@ void vboot_run_logic(void) } } -static int vboot_locate(struct cbfs_props *props) +static int vboot_locate(struct region_device *rdev) { const struct vb2_context *ctx; - struct region_device fw_main; /* Don't honor vboot results until the vboot logic has run. */ if (!vboot_logic_executed()) @@ -85,13 +85,7 @@ static int vboot_locate(struct cbfs_props *props) if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) return -1; - if (vboot_locate_firmware(ctx, &fw_main)) - return -1; - - props->offset = region_device_offset(&fw_main); - props->size = region_device_sz(&fw_main); - - return 0; + return vboot_locate_firmware(ctx, rdev); } const struct cbfs_locator vboot_locator = { -- cgit v1.2.3