All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 0/7] Allow both TPM stacks to be compiled at the same time
Date: Thu, 19 Jul 2018 22:35:05 +0200	[thread overview]
Message-ID: <20180719203512.346-1-miquel.raynal@bootlin.com> (raw)

It was first decided that the user would choose the TPM version (1.x
or 2.x) that he wants to use at compile time. After some time the
decision has been made to change this and allow both stacks (and
drivers) to be compiled at the same time. The primary benefit would be
to be able to compile the maximum of code with only one Sandbox
configuration.

This series removes this limitation by creating a 'tpm2' command
(instead of two commands named 'tpm'). While test suites must be
updated to use 'tpm2' instead of 'tpm' (in case both stacks are
compiled), the user will not have to change anything as U-Boot prompt
will find the closest matching command by default.

In the TPM private data a version entry is added, updated by TPMv2
drivers in the ->set_version() hook added in the uclass.

This has been tested with the tpm2.py test suite on Sandbox with
either only the V1, only the V2 and with both versions selected.

Thanks,
Miquèl

Changes since v1:
=================
* Added Simon's Reviewed-by tags.
* Added a patch to remove TPM_DRIVER_SELECTED stale symbol from
  Kconfig.
* s/int rc/int ret/
* Removed conditionals from the code.
* Moved the TPM stack version selection in the probe, removed the
  ->set_version() helper.


Miquel Raynal (7):
  tpm: fix typo in kernel doc
  tpm: compile Sandbox driver by default
  tpm: remove stale symbol in Kconfig
  tpm: allow TPM v1 and v2 to be compiled at the same time
  test/py: tpm2: switch from 'tpm' to 'tpm2' command
  tpm: make TPM_V2 be compiled by default
  sandbox: compile both TPM stack versions and drivers

 cmd/tpm-common.c               | 24 +++++++++++++++++++++++-
 cmd/tpm-v1.c                   |  2 +-
 cmd/tpm-v2.c                   |  4 ++--
 configs/sandbox_defconfig      |  3 +++
 drivers/tpm/Kconfig            | 13 +++++--------
 drivers/tpm/tpm-uclass.c       |  3 ---
 drivers/tpm/tpm2_tis_sandbox.c |  3 +++
 drivers/tpm/tpm2_tis_spi.c     |  4 ++++
 include/tpm-common.h           | 42 +++++++++++++++++++++++++++++++++++-------
 test/py/tests/test_tpm2.py     | 40 ++++++++++++++++++++--------------------
 10 files changed, 96 insertions(+), 42 deletions(-)

-- 
2.14.1

             reply	other threads:[~2018-07-19 20:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 20:35 Miquel Raynal [this message]
2018-07-19 20:35 ` [U-Boot] [PATCH v2 1/7] tpm: fix typo in kernel doc Miquel Raynal
2018-07-30 20:00   ` [U-Boot] [U-Boot,v2,1/7] " Tom Rini
2018-07-19 20:35 ` [U-Boot] [PATCH v2 2/7] tpm: compile Sandbox driver by default Miquel Raynal
2018-07-30 20:01   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-07-19 20:35 ` [U-Boot] [PATCH v2 3/7] tpm: remove stale symbol in Kconfig Miquel Raynal
2018-07-20  2:17   ` Simon Glass
2018-07-30 20:01   ` [U-Boot] [U-Boot,v2,3/7] " Tom Rini
2018-07-19 20:35 ` [U-Boot] [PATCH v2 4/7] tpm: allow TPM v1 and v2 to be compiled at the same time Miquel Raynal
2018-07-20  2:17   ` Simon Glass
2018-07-30 20:01   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-07-19 20:35 ` [U-Boot] [PATCH v2 5/7] test/py: tpm2: switch from 'tpm' to 'tpm2' command Miquel Raynal
2018-07-30 20:01   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-07-19 20:35 ` [U-Boot] [PATCH v2 6/7] tpm: make TPM_V2 be compiled by default Miquel Raynal
2018-07-30 20:01   ` [U-Boot] [U-Boot, v2, " Tom Rini
2018-07-19 20:35 ` [U-Boot] [PATCH v2 7/7] sandbox: compile both TPM stack versions and drivers Miquel Raynal
2018-07-30 20:01   ` [U-Boot] [U-Boot, v2, " Tom Rini

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=20180719203512.346-1-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --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.