Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38486 )
Change subject: util/cbfstool/fit.c: add support for BtG entries ......................................................................
util/cbfstool/fit.c: add support for BtG entries
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: Iebe7d71da213c074b4cecbb275823b9e9065621a --- M util/cbfstool/fit.c 1 file changed, 52 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/38486/1
diff --git a/util/cbfstool/fit.c b/util/cbfstool/fit.c index ee12c96..36a3159 100644 --- a/util/cbfstool/fit.c +++ b/util/cbfstool/fit.c @@ -448,6 +448,50 @@ fit_entry_add_size(&fit->header, sizeof(struct fit_entry)); }
+/* + * There can be zero or one FIT_TYPE_BOOT_POLICY entries + * + * The caller has to provide valid arguments as those aren't verfied. + */ +static void update_fit_boot_policy_entry(struct fit_table *fit, + struct fit_entry *entry, + uint64_t boot_policy_addr, + uint32_t boot_policy_size) +{ + entry->address = boot_policy_addr; + /* + * Points to the flag indicating if TXT is enabled on this platform. + * If not present, TXT is not disabled by FIT. + */ + fit_entry_update_size(entry, boot_policy_size); + entry->type_checksum_valid = FIT_TYPE_BOOT_POLICY; + entry->version = FIT_TXT_VERSION; + entry->checksum = 0; + fit_entry_add_size(&fit->header, sizeof(struct fit_entry)); +} + +/* + * There can be zero or one FIT_TYPE_KEY_MANIFEST entries + * + * The caller has to provide valid arguments as those aren't verfied. + */ +static void update_fit_key_manifest_entry(struct fit_table *fit, + struct fit_entry *entry, + uint64_t key_manifest_addr, + uint32_t key_manifest_size) +{ + entry->address = key_manifest_addr; + /* + * Points to the flag indicating if TXT is enabled on this platform. + * If not present, TXT is not disabled by FIT. + */ + fit_entry_update_size(entry, key_manifest_size); + entry->type_checksum_valid = FIT_TYPE_KEY_MANIFEST; + entry->version = FIT_TXT_VERSION; + entry->checksum = 0; + fit_entry_add_size(&fit->header, sizeof(struct fit_entry)); +} + /* Special case for ucode CBFS file, as it might contain more than one ucode */ int fit_add_microcode_file(struct fit_table *fit, struct cbfs_image *image, @@ -640,10 +684,10 @@ case FIT_TYPE_BIOS_STARTUP: case FIT_TYPE_BIOS_POLICY: case FIT_TYPE_TXT_POLICY: - return 1; - case FIT_TYPE_TPM_POLICY: case FIT_TYPE_KEY_MANIFEST: case FIT_TYPE_BOOT_POLICY: + return 1; + case FIT_TYPE_TPM_POLICY: default: return 0; } @@ -698,6 +742,12 @@ case FIT_TYPE_TXT_POLICY: update_fit_txt_policy_entry(fit, entry, offset); break; + case FIT_TYPE_KEY_MANIFEST: + update_fit_key_manifest_entry(fit, entry, offset, len); + break; + case FIT_TYPE_BOOT_POLICY: + update_fit_boot_policy_entry(fit, entry, offset, len); + break; default: return 1; }