diff options
author | Namyoon Woo <namyoon@chromium.org> | 2019-12-06 13:40:18 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-22 01:46:37 +0000 |
commit | c5322ba116003017deab926f5d1e9bdd16f649b8 (patch) | |
tree | 029288582014d5a5d8be0ca87643e0e1fe707328 /include | |
parent | cfc689dcb00f3b81e857c8fbd21e4599443ceeff (diff) | |
download | chrome-ec-c5322ba116003017deab926f5d1e9bdd16f649b8.tar.gz |
read EC Firmware hash from kernel secdata during board init
Cr50 reads EC Firmware hash from kernel secdata. This data shall be
used for EC-EFS (Early Firmware Selection) procedure.
BUG=chromium:1020578, b:148489182
BRANCH=cr50
TEST=none
Change-Id: Id8942b5b49dd5b0412d198a12ee0bf87fd59d47f
Signed-off-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1956159
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 2 | ||||
-rw-r--r-- | include/tpm_nvmem.h | 3 | ||||
-rw-r--r-- | include/vboot.h | 18 |
3 files changed, 22 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h index 99e9ad91c9..62f7d438d0 100644 --- a/include/common.h +++ b/include/common.h @@ -239,6 +239,8 @@ enum ec_error_list { /* Verified boot data errors */ EC_ERROR_VBOOT_DATA = 0x1200, EC_ERROR_VBOOT_DATA_VERIFY = 0x1201, + EC_ERROR_VBOOT_DATA_INCOMPATIBLE = 0x1202, + EC_ERROR_VBOOT_DATA_UNDERSIZED = 0x1203, /* Module-internal error codes may use this range. */ EC_ERROR_INTERNAL_FIRST = 0x10000, diff --git a/include/tpm_nvmem.h b/include/tpm_nvmem.h index 2508c9ae65..3315148323 100644 --- a/include/tpm_nvmem.h +++ b/include/tpm_nvmem.h @@ -8,6 +8,7 @@ #define __CROS_EC_TPM_NVMEM_H #define FIRMWARE_NV_INDEX 0x1007 -#define FWMP_NV_INDEX 0x100a +#define KERNEL_NV_INDEX 0x1008 +#define FWMP_NV_INDEX 0x100a #endif /* __CROS_EC_TPM_NVMEM_H */ diff --git a/include/vboot.h b/include/vboot.h index 195db31a54..ba924508c7 100644 --- a/include/vboot.h +++ b/include/vboot.h @@ -72,6 +72,24 @@ enum ec_efs_boot_mode { EC_EFS_BOOT_MODE_LIMIT = 255, }; +/**************************************************************************** + * This is quoted from 2secdata_struct.h in the directory, + * src/platform/vboot_reference/firmware/2lib/include/. + ****************************************************************************/ + +/* Kernel secure storage space */ +#define VB2_SECDATA_KERNEL_STRUCT_VERSION_MIN 0x10 +#define VB2_SECDATA_KERNEL_UID 0x4752574c /* 'LWRG' */ +struct vb2_secdata_kernel { + uint8_t struct_version; /* top-half:major. bottom-half:minor. */ + uint8_t struct_size; /* Whole structure size */ + uint8_t crc8; /* CRC for everything below */ + uint8_t reserved0; + + uint32_t kernel_versions; /* Kernel versions */ + uint8_t ec_hash[SHA256_DIGEST_SIZE]; +} __packed; + /** * Validate key contents. * |