diff options
author | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2016-01-07 12:02:50 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-01-07 12:13:07 -0500 |
commit | 8b902b88ea239d2193e78f0c425a180b6e3a24f0 (patch) | |
tree | 75643ef6d5d541875bba0c6e39e21142f95ae676 | |
parent | 115d0084831b1e9e085d8fe49fa9e4ea21542464 (diff) | |
download | seabios-hppa-8b902b88ea239d2193e78f0c425a180b6e3a24f0.zip seabios-hppa-8b902b88ea239d2193e78f0c425a180b6e3a24f0.tar.gz seabios-hppa-8b902b88ea239d2193e78f0c425a180b6e3a24f0.tar.bz2 |
tpm: Remove usage of PP_CMD_ENABLE from all but one place
Remove the usage of PhysicalPresence_CMD_ENABLE from all but
the assert_physical_presence function.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
-rw-r--r-- | src/tcgbios.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/src/tcgbios.c b/src/tcgbios.c index ceeb5fb..31e1435 100644 --- a/src/tcgbios.c +++ b/src/tcgbios.c @@ -211,16 +211,10 @@ build_and_send_cmd(u8 locty, u32 ordinal, const u8 *append, u32 append_size, static void tpm_set_failure(void) { - /* we will try to deactivate the TPM now - ignoring all errors */ - build_and_send_cmd(0, TPM_ORD_PhysicalPresence, - PhysicalPresence_CMD_ENABLE, - sizeof(PhysicalPresence_CMD_ENABLE), - TPM_DURATION_TYPE_SHORT); - - build_and_send_cmd(0, TPM_ORD_PhysicalPresence, - PhysicalPresence_PRESENT, - sizeof(PhysicalPresence_PRESENT), - TPM_DURATION_TYPE_SHORT); + /* + * We will try to deactivate the TPM now - ignoring all errors + * Physical presence is asserted. + */ build_and_send_cmd(0, TPM_ORD_SetTempDeactivated, NULL, 0, TPM_DURATION_TYPE_SHORT); @@ -528,32 +522,17 @@ tpm_setup(void) void tpm_prepboot(void) { - if (!tpm_is_working()) + if (!CONFIG_TCGBIOS) return; - int ret = build_and_send_cmd(0, TPM_ORD_PhysicalPresence, - PhysicalPresence_CMD_ENABLE, - sizeof(PhysicalPresence_CMD_ENABLE), - TPM_DURATION_TYPE_SHORT); - if (ret) - goto err_exit; - - ret = build_and_send_cmd(0, TPM_ORD_PhysicalPresence, - PhysicalPresence_NOT_PRESENT_LOCK, - sizeof(PhysicalPresence_NOT_PRESENT_LOCK), - TPM_DURATION_TYPE_SHORT); - if (ret) - goto err_exit; + if (TPM_has_physical_presence) + build_and_send_cmd(0, TPM_ORD_PhysicalPresence, + PhysicalPresence_NOT_PRESENT_LOCK, + sizeof(PhysicalPresence_NOT_PRESENT_LOCK), + TPM_DURATION_TYPE_SHORT); tpm_add_action(4, "Calling INT 19h"); tpm_add_event_separators(); - - return; - -err_exit: - dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__); - - tpm_set_failure(); } /* |