All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>
Subject: [PATCH 5/8] tpm: sandbox: Allow init of TPM in a different phase
Date: Mon, 28 Feb 2022 17:11:22 -0700	[thread overview]
Message-ID: <20220301001125.1554442-6-sjg@chromium.org> (raw)
In-Reply-To: <20220301001125.1554442-1-sjg@chromium.org>

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 <sjg@chromium.org>
---

 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


  parent reply	other threads:[~2022-03-01  0:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  0:11 [PATCH 0/8] tpm: Various minor fixes and enhancements Simon Glass
2022-03-01  0:11 ` [PATCH 1/8] tpm: Export the TPM-version functions Simon Glass
2022-06-07  8:28   ` Ilias Apalodimas
2022-03-01  0:11 ` [PATCH 2/8] tpm: Require a digest source when extending the PCR Simon Glass
2022-06-07  8:42   ` Ilias Apalodimas
2022-08-14 23:29     ` Simon Glass
2022-03-01  0:11 ` [PATCH 3/8] tpm: Correct the permissions command in TPMv1 Simon Glass
2022-06-07  8:44   ` Ilias Apalodimas
2022-08-14 23:29     ` Simon Glass
2022-03-01  0:11 ` [PATCH 4/8] tpm: Correct the define-space command in TPMv2 Simon Glass
2022-06-07  8:46   ` Ilias Apalodimas
2022-08-14 23:29     ` Simon Glass
2022-03-01  0:11 ` Simon Glass [this message]
2022-06-07  8:48   ` [PATCH 5/8] tpm: sandbox: Allow init of TPM in a different phase Ilias Apalodimas
2022-03-01  0:11 ` [PATCH 6/8] tpm: Allow reporting the internal state Simon Glass
2022-03-01  0:11 ` [PATCH 7/8] tpm: Implement state command for Cr50 Simon Glass
2022-06-07  8:54   ` Ilias Apalodimas
2022-08-14 23:29     ` Simon Glass
2022-03-01  0:11 ` [PATCH 8/8] tpm: Allow commiting non-volatile data Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220301001125.1554442-6-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.