]> xenbits.xensource.com Git - seabios.git/commitdiff
tpm: Remove usage of PP_CMD_ENABLE from all but one place
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Thu, 7 Jan 2016 17:02:50 +0000 (12:02 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 7 Jan 2016 17:13:07 +0000 (12:13 -0500)
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>
src/tcgbios.c

index ceeb5fbdcb48c58427d4762b0d7311dce3a2a0bb..31e14350ab3ff97758e340fa9d00d1f0a8e3f395 100644 (file)
@@ -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();
 }
 
 /*