security/vboot: Use persistent context to read GBB flags

With the persistent vboot context coreboot no longer needs to read GBB
flags from flash itself -- it can just ask vboot for the cached result.
This patch removes the existing GBB code and provides gbb_is_flag_set()
(with a slightly better namespaced name) as a static inline instead.

Change-Id: Ibc3ed0f3fbeb53d630925d47df4dc474b0ed07ee
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37261
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Joel Kitching <kitching@google.com>
This commit is contained in:
Julius Werner
2019-11-26 17:58:11 -08:00
parent 3e8ef1028d
commit d618aaceae
5 changed files with 13 additions and 123 deletions

View File

@ -49,6 +49,17 @@ static inline int vboot_is_firmware_slot_a(const struct vb2_context *ctx)
return !(ctx->flags & VB2_CONTEXT_FW_SLOT_B);
}
/*
* Check if given flag is set in the flags field in GBB header.
* Return value:
* true: Flag is set.
* false: Flag is not set.
*/
static inline bool vboot_is_gbb_flag_set(enum vb2_gbb_flag flag)
{
return !!(vb2api_gbb_get_flags(vboot_get_context()) & flag);
}
/*
* Locates firmware as a region device. Returns 0 on success, -1 on failure.
*/