summaryrefslogtreecommitdiff
path: root/src/security
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-12-05 22:29:07 -0800
committerPatrick Georgi <pgeorgi@google.com>2020-01-18 10:51:04 +0000
commit815611ef56fd1059ae79f0024cb36454a69a05fc (patch)
tree9c559cb5a04ebf60d9aa6a0e32b36a9d517bbf96 /src/security
parent029d67278bd53ef9918045712880f3cc9c61a605 (diff)
cbfs: Remove locator concept
When vboot was first integrated into CBFS it was still part of Google vendorcode. So to not directly tie custom vendorcode into the core CBFS library, the concept of cbfs_locator was introduced to decouple core code from an arbitrary amount of platform-specific implementations that want to decide where the CBFS can be found. Nowadays vboot is a core coreboot feature itself, and the locator concept isn't used by anything else anymore. This patch simplifies the code by removing it and just calling vboot from the CBFS library directly. That should make it easier to more closely integrate vboot into CBFS in the future. Change-Id: I7b9112adc7b53aa218c58b8cb5c85982dcc1dbc0 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38419 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/security')
-rw-r--r--src/security/vboot/vboot_common.h2
-rw-r--r--src/security/vboot/vboot_loader.c7
2 files changed, 3 insertions, 6 deletions
diff --git a/src/security/vboot/vboot_common.h b/src/security/vboot/vboot_common.h
index d296574eaf..976c26a70b 100644
--- a/src/security/vboot/vboot_common.h
+++ b/src/security/vboot/vboot_common.h
@@ -71,6 +71,7 @@ int vboot_recovery_mode_enabled(void);
int vboot_recovery_mode_memory_retrain(void);
int vboot_can_enable_udc(void);
void vboot_run_logic(void);
+int vboot_locate_cbfs(struct region_device *rdev);
#else /* !CONFIG_VBOOT */
static inline int vboot_developer_mode_enabled(void) { return 0; }
static inline int vboot_recovery_mode_enabled(void) { return 0; }
@@ -78,6 +79,7 @@ static inline int vboot_recovery_mode_memory_retrain(void) { return 0; }
/* If VBOOT is not enabled, we are okay enabling USB device controller (UDC). */
static inline int vboot_can_enable_udc(void) { return 1; }
static inline void vboot_run_logic(void) {}
+static inline int vboot_locate_cbfs(struct region_device *rdev) { return -1; }
#endif
void vboot_save_nvdata_only(struct vb2_context *ctx);
diff --git a/src/security/vboot/vboot_loader.c b/src/security/vboot/vboot_loader.c
index b72c82ba4a..7e637759ce 100644
--- a/src/security/vboot/vboot_loader.c
+++ b/src/security/vboot/vboot_loader.c
@@ -70,7 +70,7 @@ void vboot_run_logic(void)
}
}
-static int vboot_locate(struct region_device *rdev)
+int vboot_locate_cbfs(struct region_device *rdev)
{
struct vb2_context *ctx;
@@ -85,8 +85,3 @@ static int vboot_locate(struct region_device *rdev)
return vboot_locate_firmware(ctx, rdev);
}
-
-const struct cbfs_locator vboot_locator = {
- .name = "VBOOT",
- .locate = vboot_locate,
-};