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>
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index 241d8e1..7245a63 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -261,12 +261,12 @@
static void lb_boot_media_params(struct lb_header *header)
{
struct lb_boot_media_params *bmp;
- struct cbfs_props props;
const struct region_device *boot_dev;
+ struct region_device cbfs_dev;
boot_device_init();
- if (cbfs_boot_region_properties(&props))
+ if (cbfs_boot_region_device(&cbfs_dev))
return;
boot_dev = boot_device_ro();
@@ -277,8 +277,8 @@
bmp->tag = LB_TAG_BOOT_MEDIA_PARAMS;
bmp->size = sizeof(*bmp);
- bmp->cbfs_offset = props.offset;
- bmp->cbfs_size = props.size;
+ bmp->cbfs_offset = region_device_offset(&cbfs_dev);
+ bmp->cbfs_size = region_device_sz(&cbfs_dev);
bmp->boot_media_size = region_device_sz(boot_dev);
bmp->fmap_offset = get_fmap_flash_offset();