From patchwork Wed Jan 25 11:39:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 646557 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp221378pvb; Wed, 25 Jan 2023 03:39:33 -0800 (PST) X-Google-Smtp-Source: AK7set+CWdoNyS4LwiOqZJlaoZIFoKBAPDvwK+YWcjquGOT0lyYysSIcnlkWLiXt4ExvWypBs+K2 X-Received: by 2002:a05:6870:a408:b0:163:1969:1ae1 with SMTP id m8-20020a056870a40800b0016319691ae1mr2830471oal.0.1674646773591; Wed, 25 Jan 2023 03:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674646773; cv=none; d=google.com; s=arc-20160816; b=APXAg98VjAQKOb1lXEpFEpOl1kdEwHRoeh9wRyRrhGuSxVJzq/r8+hfVWwuFfiyG2i XER9OncnWM/E2U2Aetn7Co0ziet8Hn0u/T8bzTuG5N5bZ6NEYq9zQmdj6Bdj8ospp3LR kEPyW9F+tM7qkCbLzDg7oZyZbp1lI+GctjARH86VeOt2XIiOPWmylRJtJ6in2TqwSV1N SBbFb8jI35oHcjMHEcaqdjYshI700Z2I4apSGqjBYywIVXPK1rmuinoW5O/D3BAMHvPX W42FTkjkvfB4NYZvbxJsAA/4DHH9fzMzpOGhrNWSz9LLsORkPYChys3MxT1p9pzlv7y8 DiDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=fqqxM+OONfQHliw+seZpRPyYSHaD+WY9Ca/T6ZwZvsc=; b=Tgw59nrEKQEysaezt94YTOwtjJ0oZ1Fmld0anJvNCxwAMFOjSAuh+uhyVb/+98nXMP OE4Gt240j9xwxLvErf2yXRnymBinTeH7i32jtHT3sxl2GIZMTqj8s+w9phApYk/hPBW8 obFUQ9YiE7/CMOhsJTNHc7O/BQLRaO2B2wC0Q9H0UH3eWiTsag2hBN8EVSi0YXviKlQr 0ai7bafPdlEKCG1LDIxh3ajg1UbvvqxGuG4HUwEvtSx71HM0hoWALVWqRvzkEwQpkqdf wvDghs0AZ8vto5nzyaY4B8VEKKdgSwoxlUZUk4xtGrFyRqD9SlVvb/8CDMloF3lJDtSl aMGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3k50qca; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ce13-20020a056830628d00b006884a8a57cdsi2078935otb.134.2023.01.25.03.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 03:39:33 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3k50qca; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 09C3B85615; Wed, 25 Jan 2023 12:39:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="W3k50qca"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5982885688; Wed, 25 Jan 2023 12:39:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09A5C84EEF for ; Wed, 25 Jan 2023 12:39:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x531.google.com with SMTP id w11so6156377edv.0 for ; Wed, 25 Jan 2023 03:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fqqxM+OONfQHliw+seZpRPyYSHaD+WY9Ca/T6ZwZvsc=; b=W3k50qcaKFMtTt6vSxV9kzuPAAhrEDEE+gy9Y5XwgfZdRny7nApHKixAPstua56xIX ebel9B0HXLTx/giMUvNGCD/F53OkjIeIhq1Cvih0yjWaqHFzcLRcfvZSrpQqlzpSKbIf g57tUA+X7VO6UKzVzF0aBL8Mdr8iElfvusoeUEj9GHzXJFXvqZtbW09aJMjMcU8mSl7+ Tvhi0a++YPnP0f0ixjNhDAY/UBlPlcpna49PVXN81Pyel9+RAMI8ZmlktxTZ63v5hDxy JzM744jjqSXcphw5ob40fe52pMssVJdfh5cTNJTv5DpzEzCphXfRD5uETtX4ipfEh4JC m6wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fqqxM+OONfQHliw+seZpRPyYSHaD+WY9Ca/T6ZwZvsc=; b=W7PbiO9JK/wBlqKkf56msW68NZBf+NXlptjuVD8PP92AMBnFR0CG6tNkKa4Vqy1l6u V7skHoUDi3P56Hs+OzR3bk5DbA7Qcr1y0Qzos6gmBE/lSuj6YsX0H3FBWEI7cWQK9Rzi kTynLs3Py5kChrAeHTzoPRvBw231LqAlahub3JuwMItgXRUNvCOMYWaRwc7A6SCWcn7x YkCK2CApZUEegQ5kWh1zrP8/+jGga/a0qho4JjMDvTRJuWtQmSvknCvgirPsZmw5PqLy lg227Bupcq567YWHu3bYao/bQg5NJxArUmWSKYtGnyHDCzpMKuykIjik52A/4Bun2ai9 lnbw== X-Gm-Message-State: AFqh2korTTneX2IIEG5/5VBaY/qZW/EAJDxP+EVHCUWj+HSBQV94Mb0p ozV/6xYLdGcAVM0dEpdZ31+nU45i4qJgCMR+ X-Received: by 2002:a05:6402:2990:b0:499:8849:5fb8 with SMTP id eq16-20020a056402299000b0049988495fb8mr35648123edb.30.1674646763593; Wed, 25 Jan 2023 03:39:23 -0800 (PST) Received: from localhost.localdomain ([2a02:85f:fc9d:e4b5:f0f6:e48b:8d50:ecb2]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b0049dfd6bdc25sm2261794edu.84.2023.01.25.03.39.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 03:39:23 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Sughosh Ganu Subject: [PATCH 1/2] tpm: add a function that performs selftest + startup Date: Wed, 25 Jan 2023 13:39:03 +0200 Message-Id: <20230125113904.517057-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean As described in [0] if a command requires use of an untested algorithm or functional module, the TPM performs the test and then completes the command actions. Since we don't check for TPM_RC_NEEDS_TEST (which is the return code of the TPM in that case) and even if we would, it would complicate our TPM code for no apparent reason, add a wrapper function that performs both the selftest and the startup sequence of the TPM. It's worth noting that this is implemented on TPMv2.0. The code for 1.2 would look similar, but I don't have a device available to test. [0] https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.07-2014-03-13.pdf ยง12.3 Self-test modes Signed-off-by: Ilias Apalodimas --- include/tpm-v2.h | 8 ++++++++ include/tpm_api.h | 8 ++++++++ lib/tpm-v2.c | 29 +++++++++++++++++++++++++++++ lib/tpm_api.c | 8 ++++++++ 4 files changed, 53 insertions(+) diff --git a/include/tpm-v2.h b/include/tpm-v2.h index 737e57551d73..3013f69a90ed 100644 --- a/include/tpm-v2.h +++ b/include/tpm-v2.h @@ -688,4 +688,12 @@ u32 tpm2_report_state(struct udevice *dev, uint vendor_cmd, uint vendor_subcmd, u32 tpm2_enable_nvcommits(struct udevice *dev, uint vendor_cmd, uint vendor_subcmd); +/** + * tpm2_auto_start() - start up the TPM and perform selftests + * + * @param dev TPM device + * Return: return code of the operation (0 = success) + */ +u32 tpm2_auto_start(struct udevice *dev); + #endif /* __TPM_V2_H */ diff --git a/include/tpm_api.h b/include/tpm_api.h index 8979d9d6df7e..022a8bbaeca6 100644 --- a/include/tpm_api.h +++ b/include/tpm_api.h @@ -331,4 +331,12 @@ static inline bool tpm_is_v2(struct udevice *dev) return IS_ENABLED(CONFIG_TPM_V2) && tpm_get_version(dev) == TPM_V2; } +/** + * tpm_auto_start() - start up the TPM and perform selftests + * + * @param dev TPM device + * Return: return code of the operation (0 = success) + */ +u32 tpm_auto_start(struct udevice *dev); + #endif /* __TPM_API_H */ diff --git a/lib/tpm-v2.c b/lib/tpm-v2.c index 697b982e079f..c34e158e2bb4 100644 --- a/lib/tpm-v2.c +++ b/lib/tpm-v2.c @@ -44,6 +44,35 @@ u32 tpm2_self_test(struct udevice *dev, enum tpm2_yes_no full_test) return tpm_sendrecv_command(dev, command_v2, NULL, NULL); } +/* + * - If a testable function has not been tested and is requested the TPM2 will return + * TPM_RC_NEEDS_TEST. + * - If TPM2 self-test has been received and the tests are not complete the + * result will be TPM_RC_TESTING. + * - If testing of all functions is complete without functional failures the result + * will be TPM_RC_SUCCESS. + * - If any test failed, the result will be TPM2_RC_FAILURE. + * - if the TPM hasn't started it will return TPM2_RC_INITIALIZE. + */ +u32 tpm2_auto_start(struct udevice *dev) +{ + u32 rc; + + rc = tpm2_self_test(dev, TPMI_YES); + if (rc && rc != TPM2_RC_INITIALIZE) + return rc; + + if (rc == TPM2_RC_INITIALIZE) { + rc = tpm2_startup(dev, TPM2_SU_CLEAR); + if (rc) + return rc; + + rc = tpm2_self_test(dev, TPMI_YES); + } + + return rc; +} + u32 tpm2_clear(struct udevice *dev, u32 handle, const char *pw, const ssize_t pw_sz) { diff --git a/lib/tpm_api.c b/lib/tpm_api.c index 7e8df8795ef3..5b2c11a277cc 100644 --- a/lib/tpm_api.c +++ b/lib/tpm_api.c @@ -35,6 +35,14 @@ u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode) } } +u32 tpm_auto_start(struct udevice *dev) +{ + if (tpm_is_v2(dev)) + return tpm2_auto_start(dev); + + return -ENOSYS; +} + u32 tpm_resume(struct udevice *dev) { if (tpm_is_v1(dev)) From patchwork Wed Jan 25 11:39:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 646558 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp221513pvb; Wed, 25 Jan 2023 03:39:50 -0800 (PST) X-Google-Smtp-Source: AK7set9L2oBwa5o4blqx6Q0Xq36tDGgT1QaEoRkhIkkpf1g3t2kN//JKsPgiPqX3fEHSZYlAUN8a X-Received: by 2002:a05:6870:c08a:b0:163:1b0a:75df with SMTP id c10-20020a056870c08a00b001631b0a75dfmr2309167oad.24.1674646790073; Wed, 25 Jan 2023 03:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674646790; cv=none; d=google.com; s=arc-20160816; b=NDoOqxHDCBXWBwXLEJ3TxhbNtJ3r06zdHNfmBDqhCiFsa1/nhYAUQD0b0FILjRyqOU EzVd3J6tg7MkgoDSeJDI8xQoX6X8n0JYSeqdj0K+0GjGO3o+Ss2JYlnK4M9oEiZe4Bgs vXwKuk3hpQA5Flg6bFEWpJ5pVoOVix0tmcoUC1LAREHrenLzcVJG/Q8IlmD7hq/pdvgM RnRcyeJmE0/Y9v0BWPU48WmB5j07U66P5RyILrxSPhj5noWFAZ71W2VwIB02coTGIZOn 4V4d0mhmvj/E38Dy5CmIv8f8SgzJqYKXRm3MLMzYq5ghX/TVe9uU7V3UcfU8wCmRpiNg Nusw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OilGK1mftFnUBqVlsIktR0LqPpPfkUMxifI8HXfvKpo=; b=lKfhKCKcy5ju2SdfV9H7FeY4mBDUqy5XMbBqbfC1Uqg6cT9AcBBIPrnQaaXY7Cr3Hn CBYNA0bn/Zg2o6QomBJaWIyJsT/vsCphDW8JoufGK4fZw5xibRAZo2Wpg0nRGFNU+jOY VxQYk1Vonmh9pTHDpOQlFy/qGF38/1pXXOvxKoMGCQrSBX6kVvgmw4unY+IBdCMbN/I8 szUtOLs3ErHM5heL/jTE11Oqtd1CWQ6Dcrxxcc3Kz6/Gssi4sjJdTPIckTf4OsDT0F8E 1HWEuaqx+yvkSEijp705VVUT8gMHzFUGe7lngiw+J7V5OyBRn8rSaBVDHiyMMGXsk+18 CyKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=unVBc2y3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id y36-20020a05687045a400b00157cf55701csi4501035oao.180.2023.01.25.03.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 03:39:50 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=unVBc2y3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 04F8385695; Wed, 25 Jan 2023 12:39:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="unVBc2y3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A130C84EEF; Wed, 25 Jan 2023 12:39:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6DD9B8563A for ; Wed, 25 Jan 2023 12:39:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x531.google.com with SMTP id w11so6156450edv.0 for ; Wed, 25 Jan 2023 03:39:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OilGK1mftFnUBqVlsIktR0LqPpPfkUMxifI8HXfvKpo=; b=unVBc2y3WfzCpVddd5k5Z6xug9MxoSZSCf1eaImg7y2JIVsQVGIUIRMRjJIJTE0PvW x25J5HEpGV/5fgO2GdE+1d+d0aqwV+QyePWgBFIUv/kELh7GCp3tLPCs4VevedCpt/xL ymS+NH2T5e7Qo1ReuUClv59c8Rktbqgj1Jur2xqrzbme8TgMfLW0gO+2TKSAxN/UmF+8 YHsiRiRMLYBd3hBsQ+jpnQGPzacn5LO0AeSa76aS8nE1u+Qk1HAdBfFAYMipr0vUX84a R/0xOiZMheUm99DYI5Ug9ZV4EXfdB3S/pPCxMnZyPqRmPyMj8aCcqa1W96Isf1FxQwJ5 16dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OilGK1mftFnUBqVlsIktR0LqPpPfkUMxifI8HXfvKpo=; b=ANzoeX3bF+bIe9JBANh74BshTWDk2odKAbfa6eyH9jtOzfhMMIvh08Kbl1gf8oe65a 7wr8SRsor8HzZ7AkYi88uDIHUbJmY5+s9bubo/Efggr0M7zSZPitgnaQD1yTt80ja3fl FtDZ9tszL9qpRVCNhFTN9YQC+AD4aIrFr2zQmRrySQBHzCXaJW1FMLgXnhoU0khadAnc UfJWja1/OvKnQ539mZEMmoiV9DTo6AGUkhOBP45ja7tl/TpjKuSuiuYxYGRkr6XKznoA 5V6E6aIb0mJ9dkU1eUtKE5rfMBBdLsoZK5vdmgvxNnUaPintzZ8+lhshj/j/1NHezxtO BkHg== X-Gm-Message-State: AFqh2kohLJkY4qFiidCVkEpjPeZBSzMAOMBVC7NaC7dq7S1aaIaFSixK NKjBseLl2Dao1YI/Ez3y9oq/j/701HD6kRd2 X-Received: by 2002:a05:6402:f20:b0:499:b672:ee3a with SMTP id i32-20020a0564020f2000b00499b672ee3amr39865916eda.12.1674646765139; Wed, 25 Jan 2023 03:39:25 -0800 (PST) Received: from localhost.localdomain ([2a02:85f:fc9d:e4b5:f0f6:e48b:8d50:ecb2]) by smtp.gmail.com with ESMTPSA id c10-20020a056402100a00b0049dfd6bdc25sm2261794edu.84.2023.01.25.03.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 03:39:24 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Sughosh Ganu Subject: [PATCH 2/2] efi_loader: use tpm_auto_start for the tpm device Date: Wed, 25 Jan 2023 13:39:04 +0200 Message-Id: <20230125113904.517057-2-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230125113904.517057-1-ilias.apalodimas@linaro.org> References: <20230125113904.517057-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean A previous commit is adding a new tpm startup functions which initializes the TPMv2 and performs all the needed selftests. Since the TPM selftests might be needed depending on the requested lgorithm or functional module use that instead. Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_tcg2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 918e9a268641..d035a00d98ac 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -2422,7 +2422,7 @@ efi_status_t efi_tcg2_register(void) } /* initialize the TPM as early as possible. */ - err = tpm_startup(dev, TPM_ST_CLEAR); + err = tpm_auto_start(dev); if (err) { log_err("TPM startup failed\n"); goto fail;