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 035A5C433F5 for ; Tue, 1 Mar 2022 00:12:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E9A3983CFE; Tue, 1 Mar 2022 01:12:04 +0100 (CET) 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="OhI2PBYf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 78CE283C99; Tue, 1 Mar 2022 01:11:49 +0100 (CET) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 909EF83CB1 for ; Tue, 1 Mar 2022 01:11:42 +0100 (CET) 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-ot1-x32a.google.com with SMTP id w3-20020a056830060300b005ad10e3becaso10877723oti.3 for ; Mon, 28 Feb 2022 16:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3UqeR4nQ2D5TYGp2c+6jMP3r1gJjt6YktmeFSSD63e8=; b=OhI2PBYfy8giXE+6DDutwM1V+rmEBKvGUIpNBDp8+6l4P0A7zPyOOdhPWLOGWNBhUY rmaxifpmdDsnAO9Zd+F+wh4RQfBj+QTBf8kaVyG/8gv0fZxxIti7qmWOF/hUpfZfoUN7 q0JE0RVIConEuC5HHsSnhnXxXMBVdmM/IoX2U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3UqeR4nQ2D5TYGp2c+6jMP3r1gJjt6YktmeFSSD63e8=; b=tEar9HadoVcKy26Rz51UfBXnxPyhUjSxDLHtecej/kEIni3eoBgbZcfFwp4kd929BP 97Lys6NrdNocBO7ZiMqQmkh1m161yFUrBKI5uhCJWxrMLIoY/K+DeP8ECWIaCAEQFSUM LIOhI4uqNR7PhOovVDYyOywiQp5j/B2AFeKDRx9AK20dnboKqZCZPxhz0/hRR2A86Z03 nOhjQgfECiAq9agscq2/Z4HrSL2/rwZ7yWnZGMgY6NMgSrdzVMhOG29iL1OXaWMlLaRi 3Z58/hNzmhMe4QeCzLR7XfhL3rO3e7SehonGyQfL6r804zASrZoc7LglSCB+GnbyjebN DWYg== X-Gm-Message-State: AOAM532K/LbTSCkpQnVL+LHnfBtLhcuXMvGg002+EsnvBbzJ++sj4u+1 q1f/Qyokn98pvNUGoQN45rdZcV15kQpkJQ== X-Google-Smtp-Source: ABdhPJwhWly38XCPzXbI2uVYz0kUhS4y0KroayYWECG0HxKsxdZIJEmXvPiTfsB5VxhY2kLX167ZSA== X-Received: by 2002:a05:6830:401b:b0:5af:157b:6408 with SMTP id h27-20020a056830401b00b005af157b6408mr10743259ots.300.1646093501105; Mon, 28 Feb 2022 16:11:41 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id be40-20020a05680821a800b002d06df28063sm7425307oib.5.2022.02.28.16.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 16:11:40 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 5/8] tpm: sandbox: Allow init of TPM in a different phase Date: Mon, 28 Feb 2022 17:11:22 -0700 Message-Id: <20220301001125.1554442-6-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog In-Reply-To: <20220301001125.1554442-1-sjg@chromium.org> References: <20220301001125.1554442-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.5 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. Signed-off-by: Simon Glass --- 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 ac6eb14353..c26f5d35ab 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.35.1.574.g5d30c73bfb-goog