[SeaBIOS] [PATCH v8 8/8] Make the TPM menu work on a Chromebook (Acer C720)

Stefan Berger stefanb at us.ibm.com
Wed Jul 2 17:38:52 CEST 2014


Make the key for reaching the TPM menu configurable since the Chromebooks
don't have F11.

Allow the TPM to be initialized by other firmware, so disregard certain
TPM error codes.

Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
---
 src/boot.c    |  3 ++-
 src/tcgbios.c | 10 +++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/boot.c b/src/boot.c
index 5533529..c5b9d1d 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -461,6 +461,7 @@ interactive_bootmenu(void)
 
     char *bootmsg = romfile_loadfile("etc/boot-menu-message", NULL);
     int menukey = romfile_loadint("etc/boot-menu-key", 0x86);
+    int menukey_tpm = romfile_loadint("etc/boot-menu-key-tpm", 0x85);
 again:
     printf("%s", bootmsg ?: "\nPress F12 for boot menu.\n");
     if (detected_tpm())
@@ -471,7 +472,7 @@ again:
     enable_bootsplash();
     int scan_code = get_keystroke(menutime);
     disable_bootsplash();
-    if (detected_tpm() && scan_code == 0x85) {
+    if (detected_tpm() && scan_code == menukey_tpm) {
          tcpa_menu();
          goto again;
     }
diff --git a/src/tcgbios.c b/src/tcgbios.c
index bdeedb8..3c1d514 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -492,7 +492,15 @@ tcpa_startup(void)
     tcpa_state.startup_error = rc ? rc : returnCode;
 #endif
 
-    if (rc || returnCode)
+#ifdef CONFIG_COREBOOT
+    /* with other firmware on the system the TPM may already have been
+     * initialized
+     */
+    if (returnCode == TPM_INVALID_POSTINIT)
+        returnCode = 0;
+#endif
+
+     if (rc || returnCode)
         goto err_exit;
 
     rc = build_and_send_cmd(TPM_ORD_SelfTestFull, NULL, 0,
-- 
1.8.1.4




More information about the SeaBIOS mailing list