public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Johannes Holland <johannes.holland@infineon.com>,
	Masahisa Kojima <masahisa.kojima@linaro.org>,
	Dhananjay Phadke <dphadke@linux.microsoft.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH 1/2 v2] tpm2: Introduce TIS tpm core
Date: Mon, 12 Jul 2021 17:03:31 +0300	[thread overview]
Message-ID: <YOxLs8CpDJ6P81vc@enceladus> (raw)
In-Reply-To: <CAPnjgZ2tRA-OUPJivQD5YijFobxz3ya6ghDEv5WHTz+L=uW8gg@mail.gmail.com>

> > > >         TPM_STS_SELF_TEST_DONE          = 1 << 2,

[...]

> > > >         TPM_STS_RESPONSE_RETRY          = 1 << 1,
> > > > +       TPM_STS_READ_ZERO               = 0x23
> > >
> > > Does this below in another patch?
> > >
> >
> > It's a general tpm2 update. I can move it to the driver patch if it makes
> > more sense.
> >
> > > >  };
> > > >
> > > >  enum {
> > > > --
> > > > 2.32.0.rc0
> > > >
> > >
> > > I feel that this API could be useful in reducing code duplication, but
> > > in fact it has just created more, so far as I can see from this series
> > > :-) So I think you should convert at least one driver to show its
> > > value (and not make things any worse).
> >
> > The mmio tpm driver uses it and instead of ~700 lines (like the tpmv2 spi
> > driver) it drops down to ~100.  I don't have access to any other TPM
> > hardware to rewrite any of those.
> 
> Yes, but I hope you see my point, that you have added a new interface.
> It is definitely better than adding a new driver and duplicating all
> the code, but it is still one more copy and in fact, the code is
> duplicated.
> 

I get the point but I don't exactly agree here.  It's not duplicated code.  
We need to plug in the mmio driver.  The original code was just doing what 
every TPM does.  It carried the TIS relevant code in the new driver.  
The new approach defines an API for everyone to use and the new driver uses it. 
So I don't see the duplication here.  You need the TIS code one way or the
other.  Now it's on a common interface for everyone to use.

> Can you get access to TPM hardware? I see that you have offered to be
> the maintainer for this subsystem, so I think that would be useful.
> Can sandbox use your new API?

It depends, is the sandbox TIS compatible? If it is sure we could use it. 
I offered to maintain the drivers because I wrote the API and I have an
idea of how TPMs should work.  If that means I'll have to go and get every
hardware we support, I'll just volunteer into maintaining the TIS layer.
Moreover I dont see why I should start porting drivers to use that API.  
People decided to duplicate that code in every driver (in fact multiple times).

I am happy to work with you on the cr50 i2c driver if that would help.

Regards
/Ilias

> 
> Regards,
> Simon

  reply	other threads:[~2021-07-12 14:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 16:25 [PATCH 1/2 v2] tpm2: Introduce TIS tpm core Ilias Apalodimas
2021-07-07 16:25 ` [PATCH 2/2] tpm2: Add a TPMv2 MMIO TIS driver Ilias Apalodimas
2021-07-11  0:00   ` Simon Glass
2021-07-12 18:22     ` Ilias Apalodimas
2021-07-12 19:13       ` Heinrich Schuchardt
2021-07-12 19:43         ` Simon Glass
2021-07-12 22:46           ` Heinrich Schuchardt
2021-07-13 16:52             ` Simon Glass
2021-07-12 19:38       ` Simon Glass
2021-07-13 20:11         ` Ilias Apalodimas
2021-07-14  2:49           ` Simon Glass
2021-07-14  5:23             ` Ilias Apalodimas
2021-07-14 19:50               ` Simon Glass
2021-07-11  0:00 ` [PATCH 1/2 v2] tpm2: Introduce TIS tpm core Simon Glass
2021-07-12  6:24   ` Ilias Apalodimas
2021-07-12 11:42     ` Simon Glass
2021-07-12 14:03       ` Ilias Apalodimas [this message]
2021-07-12 19:43         ` Simon Glass
2021-07-13  5:51           ` Ilias Apalodimas
2021-07-13 20:17             ` 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=YOxLs8CpDJ6P81vc@enceladus \
    --to=ilias.apalodimas@linaro.org \
    --cc=dphadke@linux.microsoft.com \
    --cc=johannes.holland@infineon.com \
    --cc=masahisa.kojima@linaro.org \
    --cc=sjg@chromium.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox