summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2019-11-18 12:35:21 -0700
committerPatrick Georgi <pgeorgi@google.com>2019-11-20 13:27:44 +0000
commitfe338e2319f40a22f1c64aef3df95e015ab8b90b (patch)
treeae58f62632c6df74719b1c6ae13607c90d0805de /src/soc
parentaeb652a4a04226f467eb8e850b2096d772c6e31e (diff)
downloadcoreboot-fe338e2319f40a22f1c64aef3df95e015ab8b90b.tar.xz
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>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/apollolake/mmap_boot.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/soc/intel/apollolake/mmap_boot.c b/src/soc/intel/apollolake/mmap_boot.c
index 631a834160..96ddc0560e 100644
--- a/src/soc/intel/apollolake/mmap_boot.c
+++ b/src/soc/intel/apollolake/mmap_boot.c
@@ -99,28 +99,23 @@ const struct region_device *boot_device_ro(void)
return &real_dev.rdev;
}
-static int iafw_boot_region_properties(struct cbfs_props *props)
+static int iafw_boot_region_device(struct region_device *rdev)
{
struct region *real_dev_reg;
- struct region regn;
- /* use fmap to locate CBFS area */
- if (fmap_locate_area("COREBOOT", &regn))
+ if (cbfs_default_region_device(rdev))
return -1;
- props->offset = region_offset(&regn);
- props->size = region_sz(&regn);
-
/* Check that we are within the memory mapped area. It's too
easy to forget the SRAM mapping when crafting an FMAP file. */
real_dev_reg = &real_dev.sub_region;
- if (region_is_subregion(real_dev_reg, &regn)) {
+ if (region_is_subregion(real_dev_reg, region_device_region(rdev))) {
printk(BIOS_DEBUG, "CBFS @ %zx size %zx\n",
- props->offset, props->size);
+ region_device_offset(rdev), region_device_sz(rdev));
} else {
printk(BIOS_CRIT,
"ERROR: CBFS @ %zx size %zx exceeds mem-mapped area @ %zx size %zx\n",
- props->offset, props->size,
+ region_device_offset(rdev), region_device_sz(rdev),
region_offset(real_dev_reg), region_sz(real_dev_reg));
}
@@ -133,5 +128,5 @@ static int iafw_boot_region_properties(struct cbfs_props *props)
*/
const struct cbfs_locator cbfs_default_locator = {
.name = "IAFW Locator",
- .locate = iafw_boot_region_properties,
+ .locate = iafw_boot_region_device,
};