public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Johannes Holland <johannes.holland@infineon.com>,
	Dhananjay Phadke <dphadke@linux.microsoft.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH 1/1] tpm2: Add a TPMv2 MMIO TIS driver
Date: Mon, 5 Jul 2021 19:56:57 +0300	[thread overview]
Message-ID: <YOM52ZG9qEUvHzu9@enceladus> (raw)
In-Reply-To: <CAPnjgZ1Ds4DuS7YEK_O26-P7XN6hpPK=wVHOjWhYQAFkVhtgZQ@mail.gmail.com>

> > >

[...]

> > > These definitions match Linux' tpm_tis_core.h.
> > >
> > > Should they be moved to an include of the same name in U-Boot?
> >
> > I got a tpm_tis.h in this series, so I might as well move those there
> >
> > >
> >
> > [...]
> >
> > > I would prefer if you would add these functions to a structure struct
> > > tpm_tis_phy_ops which you can use to pull out the core driver.
> >
> > Me too :).  In fact that matches the design I proposed over IRC.  I just
> > didn't have too much free time to fix it, so I went ahead and posted the
> > driver matching what's already in U-Boot.  That being said, what's proposed
> > here is the right was forward.  Basically if we do it like this then any
> > future TPM TIS driver will only have to define the read/write ops for the
> > underlyng bus.
> 
> I'm not sure about the irc side, but it is best to do things on the
> mailing list so people can see it.
> 
> There seems to be quite a bit of duplicated code in this new driver. I
> think it would be better to come up with the interface first, as
> Heinrich suggests. Would something like regmap be good enough?
> 

There's duplicated code in *every* TPM driver we have right now.  That..
includes the cr50 and the TPM2 spi implementation we have.  That's why I
posted it as is.
The interface you are looking for is the TIS described one from TCG.  I am
not sure if regmap is a good idea in that regard, but since I agree with
both of you that having an abstracted TIS core makes sense in general, I'll
go ahead and split my code.  Then we can take a step back and port the
remaining drivers to that.

Cheers
/Ilias
> Regards,
> Simon

      reply	other threads:[~2021-07-05 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 12:52 [PATCH 1/1] tpm2: Add a TPMv2 MMIO TIS driver Ilias Apalodimas
2021-07-02 17:54 ` Heinrich Schuchardt
2021-07-02 20:29   ` Ilias Apalodimas
2021-07-05 15:33     ` Simon Glass
2021-07-05 16:56       ` Ilias Apalodimas [this message]

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=YOM52ZG9qEUvHzu9@enceladus \
    --to=ilias.apalodimas@linaro.org \
    --cc=dphadke@linux.microsoft.com \
    --cc=johannes.holland@infineon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox