All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: u-boot@lists.denx.de
Cc: trini@konsulko.com,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Rick Chen <rick@andestech.com>, Sean Anderson <seanga2@gmail.com>,
	Simon Glass <sjg@chromium.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Masahisa Kojima <masahisa.kojima@linaro.org>
Subject: [PATCH 5/6 v4] doc: qemu: Add instructions for swtpm usage
Date: Wed,  3 Nov 2021 17:09:08 +0200	[thread overview]
Message-ID: <20211103150910.69732-6-ilias.apalodimas@linaro.org> (raw)
In-Reply-To: <20211103150910.69732-1-ilias.apalodimas@linaro.org>

A previous patch added support for an mmio based TPM.
Add an example in QEMU on it's usage

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 doc/board/emulation/qemu-arm.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/doc/board/emulation/qemu-arm.rst b/doc/board/emulation/qemu-arm.rst
index 8d7fda10f15e..584ef0a7e150 100644
--- a/doc/board/emulation/qemu-arm.rst
+++ b/doc/board/emulation/qemu-arm.rst
@@ -81,6 +81,31 @@ can be enabled with the following command line parameters:
 
 These have been tested in QEMU 2.9.0 but should work in at least 2.5.0 as well.
 
+Enabling TPMv2 support
+----------------------
+
+To emulate a TPM the swtpm package may be used. It can be built from the
+following repositories:
+
+     https://github.com/stefanberger/swtpm.git
+
+Swtpm provides a socket for the TPM emulation which can be consumed by QEMU.
+
+In a first console invoke swtpm with::
+
+     swtpm socket --tpmstate dir=/tmp/mytpm1   \
+     --ctrl type=unixio,path=/tmp/mytpm1/swtpm-sock --log level=20
+
+In a second console invoke qemu-system-aarch64 with::
+
+     -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \
+     -tpmdev emulator,id=tpm0,chardev=chrtpm \
+     -device tpm-tis-device,tpmdev=tpm0
+
+Enable the TPM on U-Boot's command line with::
+
+    tpm2 startup TPM2_SU_CLEAR
+
 Debug UART
 ----------
 
-- 
2.33.1


  parent reply	other threads:[~2021-11-03 15:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 15:09 [PATCH 0/6 v4] TPM cleanups and MMIO driver Ilias Apalodimas
2021-11-03 15:09 ` [PATCH 1/6 v4] tpm2: Introduce TIS tpm core Ilias Apalodimas
2021-11-05  2:02   ` Simon Glass
2021-11-05  7:01     ` Ilias Apalodimas
2021-11-05 16:12       ` Simon Glass
2021-11-03 15:09 ` [PATCH 2/6 v4] tpm2: Add a TPMv2 MMIO TIS driver Ilias Apalodimas
2021-11-05  2:02   ` Simon Glass
2021-11-05  8:17     ` Ilias Apalodimas
2021-11-05  8:23       ` Ilias Apalodimas
2021-11-05 16:12         ` Simon Glass
2021-11-03 15:09 ` [PATCH 3/6 v4] tpm: Use the new API on tpm2 spi driver Ilias Apalodimas
2021-11-05  2:02   ` Simon Glass
2021-11-03 15:09 ` [PATCH 4/6 v4] configs: Enable tpmv2 mmio on qemu for arm/arm64 Ilias Apalodimas
2021-11-05  2:02   ` Simon Glass
2021-11-03 15:09 ` Ilias Apalodimas [this message]
2021-11-05  2:02   ` [PATCH 5/6 v4] doc: qemu: Add instructions for swtpm usage Simon Glass
2021-11-03 15:09 ` [PATCH 6/6 v4] MAINTAINERS: Add entry for TPM drivers Ilias Apalodimas

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=20211103150910.69732-6-ilias.apalodimas@linaro.org \
    --to=ilias.apalodimas@linaro.org \
    --cc=masahisa.kojima@linaro.org \
    --cc=rick@andestech.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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.