From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 04/25] tpm: prepare support for TPMv2.x commands
Date: Thu, 3 May 2018 14:27:28 +0200 [thread overview]
Message-ID: <20180503142728.3570fe93@xps13> (raw)
In-Reply-To: <CAPnjgZ3yjJ5i+O1p+iq2Nz_x7AycwYG5e1zsTKnE9zuyCj9fjQ@mail.gmail.com>
Hi Simon,
Thanks for reviewing all of this.
On Wed, 2 May 2018 20:31:50 -0600, Simon Glass <sjg@chromium.org> wrote:
> Hi Miquel,
>
> On 2 May 2018 at 02:59, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > Choice between v1 and v2 compliant functions is done with the
> > configuration.
> >
> > Create the various files that will receive TPMv2-only code on the same
> > scheme as for the TPMv1 code.
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > ---
> > cmd/Makefile | 1 +
> > cmd/tpm-v2.c | 33 ++++++++++++
> > drivers/tpm/tpm-uclass.c | 2 +
> > include/tpm-v2.h | 128 +++++++++++++++++++++++++++++++++++++++++++++++
> > lib/Makefile | 1 +
> > lib/tpm-v2.c | 11 ++++
> > 6 files changed, 176 insertions(+)
> > create mode 100644 cmd/tpm-v2.c
> > create mode 100644 include/tpm-v2.h
> > create mode 100644 lib/tpm-v2.c
> >
> > diff --git a/cmd/Makefile b/cmd/Makefile
> > index 66732085e8..bdb5475e07 100644
> > --- a/cmd/Makefile
> > +++ b/cmd/Makefile
> > @@ -120,6 +120,7 @@ obj-$(CONFIG_HUSH_PARSER) += test.o
> > obj-$(CONFIG_CMD_TPM) += tpm-common.o
> > obj-$(CONFIG_CMD_TPM_V1) += tpm-v1.o
> > obj-$(CONFIG_CMD_TPM_TEST) += tpm_test.o
> > +obj-$(CONFIG_CMD_TPM_V2) += tpm-v2.o
> > obj-$(CONFIG_CMD_CROS_EC) += cros_ec.o
> > obj-$(CONFIG_CMD_TSI148) += tsi148.o
> > obj-$(CONFIG_CMD_UBI) += ubi.o
> > diff --git a/cmd/tpm-v2.c b/cmd/tpm-v2.c
> > new file mode 100644
> > index 0000000000..606aa92409
> > --- /dev/null
> > +++ b/cmd/tpm-v2.c
> > @@ -0,0 +1,33 @@
> > +// SPDX-License-Identifier: GPL-2.0+
> > +/*
> > + * Copyright (c) 2018 Bootlin
> > + * Authoredr: Miquel Raynal <miquel.raynal@bootlin.com>
> > + */
> > +
> > +#include <common.h>
> > +#include <dm.h>
> > +#include <log.h>
> > +#include <tpm-common.h>
> > +#include <tpm-v2.h>
> > +#include "tpm-user-utils.h"
> > +
> > +static cmd_tbl_t tpm2_commands[] = {
> > + U_BOOT_CMD_MKENT(info, 0, 1, do_tpm_info, "", ""),
> > + U_BOOT_CMD_MKENT(init, 0, 1, do_tpm_init, "", ""),
> > +};
> > +
> > +cmd_tbl_t *get_tpm_commands(unsigned int *size)
>
> Why is this exported? Is it used somewhere else?
Indeed, this function is exported in both tpm-v1.c and tpm-v2.c (only
one is compiled at a time) and shared code (tpm-common.c) call this
function to retrieve the commands array.
>
> > +{
> > + *size = ARRAY_SIZE(tpm2_commands);
> > +
> > + return tpm2_commands;
> > +}
> > +
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Thanks,
Miquèl
--
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-05-03 12:27 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 8:59 [U-Boot] [PATCH v3 00/25] Introduce TPMv2.0 support Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 01/25] tpm: add Revision ID field in the chip structure Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 02/25] tpm: prepare introduction of TPMv2.x support in Kconfig Miquel Raynal
2018-05-02 19:33 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 03/25] tpm: disociate TPMv1.x specific and generic code Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-14 18:01 ` Miquel Raynal
2018-05-14 19:43 ` Tom Rini
2018-05-15 8:56 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 04/25] tpm: prepare support for TPMv2.x commands Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-03 12:27 ` Miquel Raynal [this message]
2018-05-02 8:59 ` [U-Boot] [PATCH v3 05/25] tpm: add macros to enhance TPM commands readability Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 06/25] tpm: add possible traces to analyze buffers returned by the TPM Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 07/25] tpm: report driver error code to upper layer Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 08/25] tpm: add TPM2_Startup command support Miquel Raynal
2018-05-03 2:31 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 09/25] tpm: add TPM2_SelfTest " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 10/25] tpm: add TPM2_Clear " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 11/25] tpm: add TPM2_PCR_Extend " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 12/25] tpm: add TPM2_PCR_Read " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-15 7:52 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 13/25] tpm: add TPM2_GetCapability " Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-15 8:19 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 14/25] tpm: add dictionary attack mitigation commands support Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 15/25] tpm: add TPM2_HierarchyChangeAuth command support Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 16/25] tpm: add PCR authentication commands support Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 17/25] tpm: add support for TPMv2.x SPI modules Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-15 8:48 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 18/25] tpm: add the possibility to reset the chip with a gpio Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 19/25] doc: device-tree-bindings: add ST33TPHF20 TPMv2.0 module info Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 20/25] test/py: add TPMv2.x test suite Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 21/25] tpm: add a Sandbox TPMv2.x driver Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 22/25] doc: device-tree-bindings: add Sandbox TPMv2.0 module info Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-03 12:45 ` Miquel Raynal
2018-05-02 8:59 ` [U-Boot] [PATCH v3 23/25] sandbox: dts: add Sandbox TPMv2.x node Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 24/25] configs: add TPMv2.x support in Sandbox Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-02 8:59 ` [U-Boot] [PATCH v3 25/25] tpm: allow Sandbox to run TPMv2.x commands Miquel Raynal
2018-05-03 2:32 ` Simon Glass
2018-05-03 12:56 ` Miquel Raynal
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=20180503142728.3570fe93@xps13 \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox