tcg: Use seabios setup()/prepboot() calling convention for tcg

Rename tcg externally called functions to more closely match other
subsystems.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
diff --git a/src/post.c b/src/post.c
index ff2cb6c..6157b50 100644
--- a/src/post.c
+++ b/src/post.c
@@ -174,11 +174,17 @@
     // Platform specific setup
     qemu_platform_setup();
     coreboot_platform_setup();
+
+    // Initialize TPM
+    tpm_setup();
 }
 
 void
 prepareboot(void)
 {
+    // Change TPM phys. presence state befor leaving BIOS
+    tpm_prepboot();
+
     // Run BCVs
     bcv_prepboot();
 
@@ -222,9 +228,6 @@
     if (threads_during_optionroms())
         device_hardware_setup();
 
-    // Initialize TPM
-    tpm_start();
-
     // Run vga option rom
     vgarom_setup();
 
@@ -241,9 +244,6 @@
     interactive_bootmenu();
     wait_threads();
 
-    // Change TPM phys. presence state befor leaving BIOS
-    tpm_leave_bios();
-
     // Prepare for boot.
     prepareboot();
 
diff --git a/src/tcgbios.c b/src/tcgbios.c
index bab18f2..0995482 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -502,31 +502,31 @@
 }
 
 
-u32
-tpm_start(void)
+void
+tpm_setup(void)
 {
     if (!CONFIG_TCGBIOS)
-        return 0;
+        return;
 
     tpm_acpi_init();
     if (runningOnXen())
-        return 0;
+        return;
 
-    return tpm_startup();
+    tpm_startup();
 }
 
 
-u32
-tpm_leave_bios(void)
+void
+tpm_prepboot(void)
 {
     u32 rc;
     u32 returnCode;
 
     if (!CONFIG_TCGBIOS)
-        return 0;
+        return;
 
     if (!has_working_tpm())
-        return TCG_GENERAL_ERROR;
+        return;
 
     rc = build_and_send_cmd(0, TPM_ORD_PhysicalPresence,
                             PhysicalPresence_CMD_ENABLE,
@@ -550,15 +550,12 @@
     if (rc)
         goto err_exit;
 
-    return 0;
+    return;
 
 err_exit:
     dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__);
 
     tpm_state.tpm_working = 0;
-    if (rc)
-        return rc;
-    return TCG_TCG_COMMAND_ERROR;
 }
 
 static int
@@ -1450,17 +1447,17 @@
     return tpm_ipl(IPL_EL_TORITO_2, addr, length);
 }
 
-u32
+void
 tpm_s3_resume(void)
 {
     u32 rc;
     u32 returnCode;
 
     if (!CONFIG_TCGBIOS)
-        return 0;
+        return;
 
     if (!has_working_tpm())
-        return TCG_GENERAL_ERROR;
+        return;
 
     dprintf(DEBUG_tcg, "TCGBIOS: Resuming with TPM_Startup(ST_STATE)\n");
 
@@ -1474,13 +1471,10 @@
     if (rc || returnCode)
         goto err_exit;
 
-    return 0;
+    return;
 
 err_exit:
     dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__);
 
     tpm_state.tpm_working = 0;
-    if (rc)
-        return rc;
-    return TCG_TCG_COMMAND_ERROR;
 }
diff --git a/src/tcgbios.h b/src/tcgbios.h
index a3aa870..4b7eaab 100644
--- a/src/tcgbios.h
+++ b/src/tcgbios.h
@@ -364,9 +364,9 @@
 struct bregs;
 void tpm_interrupt_handler32(struct bregs *regs);
 
-u32 tpm_start(void);
-u32 tpm_leave_bios(void);
-u32 tpm_s3_resume(void);
+void tpm_setup(void);
+void tpm_prepboot(void);
+void tpm_s3_resume(void);
 u32 tpm_add_bcv(u32 bootdrv, const u8 *addr, u32 length);
 u32 tpm_add_cdrom(u32 bootdrv, const u8 *addr, u32 length);
 u32 tpm_add_cdrom_catalog(const u8 *addr, u32 length);