From 4ee03170e058313477b8f0bbfc81d093a6197d98 Mon Sep 17 00:00:00 2001 From: Sergii Dmytruk Date: Thu, 22 Dec 2022 19:35:25 +0200 Subject: Revert "security/tpm/: turn tis_{init,open} into tis_probe" This reverts commit d43154486d27323f64334203e9bc8baf08af6845. From CB:68991: This causes CraterLake boot up process to die. Investigation in progress. Change-Id: I4a6c11b0e638a891108fe230bdaea92d5fbca020 Signed-off-by: Sergii Dmytruk Reviewed-on: https://review.coreboot.org/c/coreboot/+/71205 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh Tested-by: siemens-bot Reviewed-by: Felix Held --- src/security/tpm/tss/tcg-1.2/tss.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/security/tpm/tss/tcg-1.2') diff --git a/src/security/tpm/tss/tcg-1.2/tss.c b/src/security/tpm/tss/tcg-1.2/tss.c index 7f0607ba82..39c44eca9f 100644 --- a/src/security/tpm/tss/tcg-1.2/tss.c +++ b/src/security/tpm/tss/tcg-1.2/tss.c @@ -24,18 +24,12 @@ #include #define VBDEBUG(format, args...) printk(BIOS_DEBUG, format, ## args) -static tis_sendrecv_fn tis_sendrecv; - static int tpm_send_receive(const uint8_t *request, uint32_t request_length, uint8_t *response, uint32_t *response_length) { size_t len = *response_length; - - if (tis_sendrecv == NULL) - die("TSS 1.2 wasn't initialized\n"); - if (tis_sendrecv(request, request_length, response, &len)) return VB2_ERROR_UNKNOWN; /* check 64->32bit overflow and (re)check response buffer overflow */ @@ -146,15 +140,20 @@ static uint32_t send(const uint8_t *command) /* Exported functions. */ +static uint8_t tlcl_init_done; + uint32_t tlcl_lib_init(void) { - if (tis_sendrecv != NULL) + if (tlcl_init_done) return VB2_SUCCESS; - tis_sendrecv = tis_probe(); - if (tis_sendrecv == NULL) + if (tis_init()) + return VB2_ERROR_UNKNOWN; + if (tis_open()) return VB2_ERROR_UNKNOWN; + tlcl_init_done = 1; + return VB2_SUCCESS; } -- cgit v1.2.3