aboutsummaryrefslogtreecommitdiff
path: root/src/security/tpm/tss/tcg-2.0/tss.c
diff options
context:
space:
mode:
authorChristian Walter <christian.walter@9elements.com>2020-01-28 19:54:33 +0100
committerPatrick Georgi <pgeorgi@google.com>2020-02-04 16:16:20 +0000
commitc9ac0bcb9827ab2bef5fd7548eb13302cfd9c57d (patch)
tree969e2d5887a573df661edfd09a3a86b275682575 /src/security/tpm/tss/tcg-2.0/tss.c
parente65f500a0b90ccbf1a172427b7a61a047571ff02 (diff)
security/tpm/tss: Add ClearControl Function
Add ClearControl Function which is needed for a follow-up patch. Change-Id: Ia19185528fd821e420b0bdb424760c93b79523a4 Signed-off-by: Christian Walter <christian.walter@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38617 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/security/tpm/tss/tcg-2.0/tss.c')
-rw-r--r--src/security/tpm/tss/tcg-2.0/tss.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/security/tpm/tss/tcg-2.0/tss.c b/src/security/tpm/tss/tcg-2.0/tss.c
index 6bc30966ff..49a6cea083 100644
--- a/src/security/tpm/tss/tcg-2.0/tss.c
+++ b/src/security/tpm/tss/tcg-2.0/tss.c
@@ -170,6 +170,23 @@ uint32_t tlcl_force_clear(void)
return TPM_SUCCESS;
}
+uint32_t tlcl_clear_control(bool disable)
+{
+ struct tpm2_response *response;
+ struct tpm2_clear_control_cmd cc = {
+ .disable = 0,
+ };
+
+ response = tpm_process_command(TPM2_ClearControl, &cc);
+ printk(BIOS_INFO, "%s: response is %x\n",
+ __func__, response ? response->hdr.tpm_code : -1);
+
+ if (!response || response->hdr.tpm_code)
+ return TPM_E_IOERROR;
+
+ return TPM_SUCCESS;
+}
+
static uint8_t tlcl_init_done;
/* This function is called directly by vboot, uses vboot return types. */