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 <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36939
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Aaron Durbin
2019-11-18 12:35:21 -07:00
committed by Patrick Georgi
parent aeb652a4a0
commit fe338e2319
5 changed files with 32 additions and 59 deletions

View File

@@ -14,6 +14,7 @@
*/
#include <arch/early_variables.h>
#include <boot_device.h>
#include <cbfs.h>
#include <console/console.h>
#include <ec/google/chromeec/ec.h>
@@ -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 = {