summaryrefslogtreecommitdiff
path: root/src/include
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/include
parentaeb652a4a04226f467eb8e850b2096d772c6e31e (diff)
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/include')
-rw-r--r--src/include/cbfs.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/include/cbfs.h b/src/include/cbfs.h
index 60129d3bb2..7a984b8570 100644
--- a/src/include/cbfs.h
+++ b/src/include/cbfs.h
@@ -73,18 +73,22 @@ struct cbfs_props {
size_t size;
};
-/* Default CBFS locator .locate() callback that locates "COREBOOT" region. */
-int cbfs_default_props(struct cbfs_props *props);
+/* Default CBFS locator .locate() callback that locates "COREBOOT" region. This
+ function is exposed to reduce code duplication in other parts of the code
+ base. To obtain the correct region device the selection process is required
+ by way of cbfs_boot_region_device(). */
+int cbfs_default_region_device(struct region_device *rdev);
-/* Return < 0 on error otherwise props are filled out accordingly. */
-int cbfs_boot_region_properties(struct cbfs_props *props);
+/* Select the boot region device from the cbfs locators.
+ Return < 0 on error, 0 on success. */
+int cbfs_boot_region_device(struct region_device *rdev);
/* Object used to identify location of current cbfs to use for cbfs_boot_*
* operations. It's used by cbfs_boot_region_properties(). */
struct cbfs_locator {
const char *name;
/* Returns 0 on successful fill of cbfs properties. */
- int (*locate)(struct cbfs_props *props);
+ int (*locate)(struct region_device *rdev);
};
#endif