From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16F90C19F2D for ; Sat, 13 Aug 2022 19:57:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC3D284B5C; Sat, 13 Aug 2022 21:57:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="R4YTmwhX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 30FEB844E8; Sat, 13 Aug 2022 21:57:00 +0200 (CEST) Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) (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 DC5AA845C3 for ; Sat, 13 Aug 2022 21:56:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oo1-xc2d.google.com with SMTP id s10-20020a4ab54a000000b00435f410bbacso695236ooo.9 for ; Sat, 13 Aug 2022 12:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=MDYCgUyLwozM5bi0RU/VrqmjKkv1XMPhSdLRJ2kYpaA=; b=R4YTmwhXHtRPxaiFpSpQTqQlOG/C7regwS/D9CFuRfOrr1nzklWbCR8tjJ0Ddgh7YJ kNoxnjLbdr8L8DyP0hfau2avC73ronSf89hsQM4J96RGqLzR5Ni9zZZ+fCqKgetkpoD3 UoIEJx8ucCOVxkLJPo15hnI3PG5t/IEDsl6Ec= 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; bh=MDYCgUyLwozM5bi0RU/VrqmjKkv1XMPhSdLRJ2kYpaA=; b=SVX08Eh/RvA4GFK1lpGVD/w/jZ4CKSyzxtAx5wOomUnhc8hoGnBVSzXd/oye1J3VjD jZdiAlEQtXCwMRMhHKedNmz/Yn97GWDer5+sp6MYgW8ei5nYQ6bls0UGReLt7HcyrGi3 NLTc5MIo+3OUz44pO5+RbD4i/ed2mXjE3ILdx6EqHiD4QwSJNd2PWj+3cwd68/8iJVUI ik2ZxhfAiRpseIT4AXAqbL3hHm1frvxVo3BH/lQslml1IHG99v4lz2VYVABnFEQp4bNn Uzk+EZ8MxHBipJFUjiFqyATVcV0tSxK3v4tv0buELzISCV/9xDqEmyXkQ5wUOQkBq+1u 7h4Q== X-Gm-Message-State: ACgBeo3y+tdUANAscAAneWOjNucFnnUIVN6OaMhGGsRCdVR9+Uoxpvs4 dY2iKB0NXKaDX2kSPvDhxZ6Cb6vD/Px81Q== X-Google-Smtp-Source: AA6agR45/j9nBkcfcsALweq+TAnYoBkzoVSfYMSPDgY0+sP8t2spR9gqtan7GPprz63WzRF0aGy6jQ== X-Received: by 2002:a4a:dc04:0:b0:448:9728:5e15 with SMTP id p4-20020a4adc04000000b0044897285e15mr2963766oov.77.1660420612103; Sat, 13 Aug 2022 12:56:52 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id r1-20020a9d5cc1000000b00636b9ab577esm1118962oti.33.2022.08.13.12.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Aug 2022 12:56:51 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Ilias Apalodimas Subject: [PATCH v2 4/7] tpm: sandbox: Allow init of TPM in a different phase Date: Sat, 13 Aug 2022 13:56:36 -0600 Message-Id: <20220813195639.1824765-5-sjg@chromium.org> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog In-Reply-To: <20220813195639.1824765-1-sjg@chromium.org> References: <20220813195639.1824765-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 At present the emulator assumes that the TPM is inited in the same phase where it is used. But in fact SPL may init the TPM, so we don't want to complain when U-Boot proper later uses it. Remove this check. It might be best to save this information into the device state for the TPM, so that we can make sure the TPM was inited at some point. For now, this seems good enough. Reviewed-by: Ilias Apalodimas Signed-off-by: Simon Glass --- (no changes since v1) drivers/tpm/tpm2_tis_sandbox.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c index ac6eb143539..c26f5d35abf 100644 --- a/drivers/tpm/tpm2_tis_sandbox.c +++ b/drivers/tpm/tpm2_tis_sandbox.c @@ -366,8 +366,10 @@ static int sandbox_tpm2_check_readyness(struct udevice *dev, int command) break; default: - if (!tpm->tests_done) - return TPM2_RC_NEEDS_TEST; + /* Skip this, since the startup may have happened in SPL + * if (!tpm->tests_done) + * return TPM2_RC_NEEDS_TEST; + */ break; } -- 2.37.1.595.g718a3a8f04-goog