// 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();
if (threads_during_optionroms())
device_hardware_setup();
- // Initialize TPM
- tpm_start();
-
// Run vga option rom
vgarom_setup();
interactive_bootmenu();
wait_threads();
- // Change TPM phys. presence state befor leaving BIOS
- tpm_leave_bios();
-
// Prepare for boot.
prepareboot();
}
-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,
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
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");
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;
}
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);