summaryrefslogtreecommitdiff
path: root/src/vendorcode
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode')
-rw-r--r--src/vendorcode/google/chromeos/chromeos.c25
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h1
2 files changed, 24 insertions, 2 deletions
diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c
index 54fe8dbb30..e917ba1f35 100644
--- a/src/vendorcode/google/chromeos/chromeos.c
+++ b/src/vendorcode/google/chromeos/chromeos.c
@@ -82,7 +82,9 @@ int recovery_mode_enabled(void)
}
#if CONFIG_VBOOT_VERIFY_FIRMWARE
-void *vboot_get_payload(size_t *len)
+#include <payload_loader.h>
+
+static void *vboot_get_payload(size_t *len)
{
struct vboot_handoff *vboot_handoff;
struct firmware_component *fwc;
@@ -109,6 +111,27 @@ void *vboot_get_payload(size_t *len)
return (void *)fwc->address;
}
+static int vboot_locate_payload(struct payload *payload)
+{
+ void *buffer;
+ size_t size;
+
+ buffer = vboot_get_payload(&size);
+
+ if (buffer == NULL)
+ return -1;
+
+ payload->backing_store.data = buffer;
+ payload->backing_store.size = size;
+
+ return 0;
+}
+
+const struct payload_loader_ops vboot_payload_loader = {
+ .name = "VBOOT",
+ .locate = vboot_locate_payload,
+};
+
int vboot_get_handoff_info(void **addr, uint32_t *size)
{
struct vboot_handoff *vboot_handoff;
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h
index 0359c91409..7fe8f06c08 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -47,7 +47,6 @@ int recovery_mode_enabled(void);
void init_chromeos(int bootmode);
#if CONFIG_VBOOT_VERIFY_FIRMWARE
-void *vboot_get_payload(size_t *len);
/* Returns 0 on success < 0 on error. */
int vboot_get_handoff_info(void **addr, uint32_t *size);
#endif