diff options
author | Joel Kitching <kitching@google.com> | 2019-05-21 12:20:38 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-28 21:10:45 -0700 |
commit | de2cae6b4d6ae864f2c90e6be73f683bad5f2f2f (patch) | |
tree | 023d1581f9054c6a54b9631be45f5277b721a23c /firmware/2lib/include/2misc.h | |
parent | 236bfb0bc3bd0aa37bd06702c25993446f9b6dba (diff) | |
download | vboot-de2cae6b4d6ae864f2c90e6be73f683bad5f2f2f.tar.gz |
vboot: save GBB header in workbuf during firmware verification
Since GBB header will be needed for subsequent GBB reads later on
(in kernel verification stage), and since GBB header is
relatively small (128 bytes), save the full GBB header onto
workbuf during firmware verification stage, and store an offset
pointer to it in vb2_shared_data. vb2_gbb_header object may be
accessed via the vb2_get_gbb function.
Additionally, update functions in firmware/lib/region-init.c to
read GBB data from flash, rather than using cparams passed in by
depthcharge, which is slated for deprecation.
BUG=b:124141368, chromium:954774
TEST=make clean && make runtests
BRANCH=none
Change-Id: I6e6218231299ce3a5b383663bc3480b20f929840
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1585500
Reviewed-on: https://chromium-review.googlesource.com/1627430
Commit-Ready: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2misc.h')
-rw-r--r-- | firmware/2lib/include/2misc.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/firmware/2lib/include/2misc.h b/firmware/2lib/include/2misc.h index 853a1b40..3e1f1000 100644 --- a/firmware/2lib/include/2misc.h +++ b/firmware/2lib/include/2misc.h @@ -9,6 +9,7 @@ #define VBOOT_REFERENCE_VBOOT_2MISC_H_ #include "2api.h" +#include "2struct.h" struct vb2_gbb_header; struct vb2_workbuf; @@ -19,11 +20,20 @@ struct vb2_workbuf; * @param ctx Vboot context * @return The shared data pointer. */ -static __inline struct vb2_shared_data *vb2_get_sd(struct vb2_context *ctx) { +static __inline struct vb2_shared_data *vb2_get_sd(struct vb2_context *ctx) +{ return (struct vb2_shared_data *)ctx->workbuf; } /** + * Get the GBB header pointer from a vboot context's shared data + * + * @param ctx Vboot context + * @return The GBB header pointer. + */ +struct vb2_gbb_header *vb2_get_gbb(struct vb2_context *ctx); + +/** * Validate gbb signature (the magic number) * * @param sig Pointer to the signature bytes to validate |