[coreboot-gerrit] New patch to review for coreboot: TPM2: Fill in empty tlcl_resume function in TPM2 tlcl

Furquan Shaikh (furquan@google.com) gerrit at coreboot.org
Fri Sep 30 22:03:06 CEST 2016


Furquan Shaikh (furquan at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16832

-gerrit

commit 8acde844df0ed3bdc613dd4e71242d4be98a656b
Author: Furquan Shaikh <furquan at chromium.org>
Date:   Fri Sep 30 12:53:19 2016 -0700

    TPM2: Fill in empty tlcl_resume function in TPM2 tlcl
    
    On resume, TPM2_Starup(STATE) command needs to be sent to the TPM. This
    ensures that TPM restores the state saved at last Shutdown(STATE).
    
    BUG=chrome-os-partner:58043
    BRANCH=None
    TEST=Verified that on resume coreboot no longer complains about index
    read for 0x1007. Return value is 0 as expected.
    
    Change-Id: Ib8640acc9cc9cdb3ba5d40e0ccee5ca7d67fa645
    Signed-off-by: Furquan Shaikh <furquan at chromium.org>
---
 src/lib/tpm2_tlcl.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/lib/tpm2_tlcl.c b/src/lib/tpm2_tlcl.c
index b6017a2..e8557c8 100644
--- a/src/lib/tpm2_tlcl.c
+++ b/src/lib/tpm2_tlcl.c
@@ -56,7 +56,20 @@ uint32_t tlcl_get_permanent_flags(TPM_PERMANENT_FLAGS *pflags)
 
 uint32_t tlcl_resume(void)
 {
+	struct tpm2_startup startup;
+	struct tpm2_response *response;
+
 	printk(BIOS_INFO, "%s:%s:%d\n", __FILE__, __func__, __LINE__);
+
+	startup.startup_type = TPM_SU_STATE;
+	response = tpm_process_command(TPM2_Startup, &startup);
+
+	if (response && response->hdr.tpm_code &&
+	    (response->hdr.tpm_code != TPM_RC_INITIALIZE)) {
+		printk(BIOS_INFO, "startup return code is %x\n",
+		       response->hdr.tpm_code);
+		return TPM_E_IOERROR;
+	}
 	return TPM_SUCCESS;
 }
 



More information about the coreboot-gerrit mailing list