summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2018-04-19 20:04:02 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-27 18:05:18 -0700
commit9439d0e1218e8a910608ac8b6813103699ec06d5 (patch)
treeeb2b1a003bf298b060b130eb5d4497e4b542aa26
parenta820df3fd6c996bbca93f80a02d4cb8f84cb0271 (diff)
downloadchrome-ec-9439d0e1218e8a910608ac8b6813103699ec06d5.tar.gz
cr50: use new function to verify index presence
The new TPM API function works even before TPM Startup was executed, this would allow CCD to read FWMP even if the AP does not boot up. CQ-DEPEND=CL:1020725 BRANCH=cr50, cr50-mp BUG=b:67009375 TEST=verified that FWMP can be read both before and after AP is booted, and that missing FWMP is also processed properly in both cases. Change-Id: I4e57e6211fdb8fa3166f261aa861dba9bab433a1 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1020785 Reviewed-by: Andrey Pronin <apronin@chromium.org>
-rw-r--r--board/cr50/tpm_nvmem_read.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/board/cr50/tpm_nvmem_read.c b/board/cr50/tpm_nvmem_read.c
index c71c7cce0c..c02ac2afb0 100644
--- a/board/cr50/tpm_nvmem_read.c
+++ b/board/cr50/tpm_nvmem_read.c
@@ -19,12 +19,12 @@
enum tpm_read_rv read_tpm_nvmem(uint16_t obj_index,
uint16_t obj_size, void *obj_value)
{
- TPMI_RH_NV_INDEX object_handle;
+ TPM_HANDLE object_handle;
NV_INDEX nvIndex;
object_handle = HR_NV_INDEX + obj_index;
- if (NvIndexIsAccessible(object_handle,
- TPM_CC_NV_Read) != TPM_RC_SUCCESS) {
+
+ if (!NvEarlyStageFindHandle(object_handle)) {
CPRINTF("%s: object at 0x%x not found\n", __func__, obj_index);
return tpm_read_not_found;
}