All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot]   tpm TIS TPMv2.0
@ 2018-06-15 13:34 Hecht, Martin
  2018-06-18  8:04 ` Miquel Raynal
  0 siblings, 1 reply; 15+ messages in thread
From: Hecht, Martin @ 2018-06-15 13:34 UTC (permalink / raw)
  To: u-boot

Hi Miquel, Simon,

Is there any specific reason why the new tpm2_tis_spi_xfer doesn't support full duplex? It seems we did some work in parallel but you sent the patches earlier. Is that codes tested against an existing TPM v2? I have a working implementation what runs on SLB9670 including full duplex.
Regards,
Martin


Dipl. Inform. Martin Hecht


Senior Embedded Specialist /
Functional Safety Engineer
TA1130871952

Avnet SILICA



[http://digital.avnet.com/signature/images/silica/Avnet_silica_logo.png]



Englische Straße 27

10587 Berlin

martin.hecht at avnet.eu<mailto:%20martin.hecht@avnet.eu>
O +49 (0) 30 214 88 227

M +49 (0) 172 890 60 19

avnet-silica.com<http://avnet-silica.eu/>


[cid:image002.png at 01D404BE.4B5BC5F0]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 24217 bytes
Desc: image001.png
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180615/fd7c9f6f/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 18256 bytes
Desc: image002.png
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180615/fd7c9f6f/attachment-0003.png>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-15 13:34 [U-Boot] tpm TIS TPMv2.0 Hecht, Martin
@ 2018-06-18  8:04 ` Miquel Raynal
  2018-06-18  8:20   ` Hecht, Martin
  0 siblings, 1 reply; 15+ messages in thread
From: Miquel Raynal @ 2018-06-18  8:04 UTC (permalink / raw)
  To: u-boot

Hi Martin,

On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
<Martin.Hecht@avnet.eu> wrote:

> Hi Miquel, Simon,
> 
> Is there any specific reason why the new tpm2_tis_spi_xfer doesn't support full duplex? It seems we did some work in parallel but you sent the patches earlier. Is that codes tested against an existing TPM v2? I have a working implementation what runs on SLB9670 including full duplex.

What do you mean exactly?

I don't think the TPM2 protocol makes real use of full-duplex unless
for the wait state between the host command and the actual xfer.

Regards,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  8:04 ` Miquel Raynal
@ 2018-06-18  8:20   ` Hecht, Martin
  2018-06-18  8:43     ` Miquel Raynal
  0 siblings, 1 reply; 15+ messages in thread
From: Hecht, Martin @ 2018-06-18  8:20 UTC (permalink / raw)
  To: u-boot

Hi Miquel,

> -----Original Message-----
> From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> Sent: Montag, 18. Juni 2018 10:05
> To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> Cc: sjg at chromium.org; u-boot at lists.denx.de
> Subject: Re: [U-Boot] tpm TIS TPMv2.0
> 
> Hi Martin,
> 
> On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
> <Martin.Hecht@avnet.eu> wrote:
> 
> > Hi Miquel, Simon,
> >
> > Is there any specific reason why the new tpm2_tis_spi_xfer doesn't
> support full duplex? It seems we did some work in parallel but you sent the
> patches earlier. Is that codes tested against an existing TPM v2? I have a
> working implementation what runs on SLB9670 including full duplex.
> 
> What do you mean exactly?
> 
> I don't think the TPM2 protocol makes real use of full-duplex unless for the
> wait state between the host command and the actual xfer.

You are right, TIS 1.3 FIFO doesn’t use full duplex in physical level. What I mean is that the driver you just wrote doesn't use the xfer function in that way that you can specify in and out parameters at same time. I did this in my implementation what gave me an easy chance to control the CS# of the TPM. Can you tell me on what TPM did you test? For the SLB9670 the code doesn't work on my hardware. For the code you wrote I'm considering to add a few lines to control the CS# in that way how my xfer is doing this for the SLB9670. On the other hand what about to use a xfer what can handle all three cases (in, out, in/out)?

> 
> Regards,
> Miquèl

Regards,
Martin

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  8:20   ` Hecht, Martin
@ 2018-06-18  8:43     ` Miquel Raynal
  2018-06-18  9:13       ` Hecht, Martin
  0 siblings, 1 reply; 15+ messages in thread
From: Miquel Raynal @ 2018-06-18  8:43 UTC (permalink / raw)
  To: u-boot

Hi Martin,

On Mon, 18 Jun 2018 08:20:20 +0000, "Hecht, Martin (Avnet Silica)"
<Martin.Hecht@avnet.eu> wrote:

> Hi Miquel,
> 
> > -----Original Message-----
> > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > Sent: Montag, 18. Juni 2018 10:05
> > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > 
> > Hi Martin,
> > 
> > On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
> > <Martin.Hecht@avnet.eu> wrote:
> >   
> > > Hi Miquel, Simon,
> > >
> > > Is there any specific reason why the new tpm2_tis_spi_xfer doesn't  
> > support full duplex? It seems we did some work in parallel but you sent the
> > patches earlier. Is that codes tested against an existing TPM v2? I have a
> > working implementation what runs on SLB9670 including full duplex.
> > 
> > What do you mean exactly?
> > 
> > I don't think the TPM2 protocol makes real use of full-duplex unless for the
> > wait state between the host command and the actual xfer.  
> 
> You are right, TIS 1.3 FIFO doesn’t use full duplex in physical level. What I mean is that the driver you just wrote doesn't use the xfer function in that way that you can specify in and out parameters at same time. I did this in my implementation what gave me an easy chance to control the CS# of the TPM.

Do you need this CS# handling for more advanced features? Same question
for the in/out xfers?

> Can you tell me on what TPM did you test? For the SLB9670 the code
> doesn't work on my hardware.

I tested with a ST33TPHF20 SPI TPM.

I'm surprised it did not work with an SLB9670, I don't see anything in
the spec explaining this CS# specificity.

> For the code you wrote I'm considering to
> add a few lines to control the CS# in that way how my xfer is doing
> this for the SLB9670.

Yes please, share the patch and add me in cc so I could test it with
mine.

> On the other hand what about to use a xfer what
> can handle all three cases (in, out, in/out)?

As I did not implement any TPM command that needed it I did not care
about it. Of course if there is a need for it: it should be implemented
too. I contributed only basic support for essential commands (measured
boot, mainly) but please feel free to enhance the code to add more
features!

Regards,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  8:43     ` Miquel Raynal
@ 2018-06-18  9:13       ` Hecht, Martin
  2018-06-18  9:21         ` Miquel Raynal
  2018-07-13 19:30         ` Miquel Raynal
  0 siblings, 2 replies; 15+ messages in thread
From: Hecht, Martin @ 2018-06-18  9:13 UTC (permalink / raw)
  To: u-boot

Hi Miquèl,

> -----Original Message-----
> From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> Sent: Montag, 18. Juni 2018 10:43
> To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> Cc: sjg at chromium.org; u-boot at lists.denx.de
> Subject: Re: [U-Boot] tpm TIS TPMv2.0
> 
> Hi Martin,
> 
> On Mon, 18 Jun 2018 08:20:20 +0000, "Hecht, Martin (Avnet Silica)"
> <Martin.Hecht@avnet.eu> wrote:
> 
> > Hi Miquel,
> >
> > > -----Original Message-----
> > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > Sent: Montag, 18. Juni 2018 10:05
> > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > >
> > > Hi Martin,
> > >
> > > On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
> > > <Martin.Hecht@avnet.eu> wrote:
> > >
> > > > Hi Miquel, Simon,
> > > >
> > > > Is there any specific reason why the new tpm2_tis_spi_xfer doesn't
> > > support full duplex? It seems we did some work in parallel but you
> > > sent the patches earlier. Is that codes tested against an existing
> > > TPM v2? I have a working implementation what runs on SLB9670 including
> full duplex.
> > >
> > > What do you mean exactly?
> > >
> > > I don't think the TPM2 protocol makes real use of full-duplex unless
> > > for the wait state between the host command and the actual xfer.
> >
> > You are right, TIS 1.3 FIFO doesn’t use full duplex in physical level. What I
> mean is that the driver you just wrote doesn't use the xfer function in that
> way that you can specify in and out parameters at same time. I did this in my
> implementation what gave me an easy chance to control the CS# of the TPM.
> 
> Do you need this CS# handling for more advanced features? Same question
> for the in/out xfers?
> 
> > Can you tell me on what TPM did you test? For the SLB9670 the code
> > doesn't work on my hardware.
> 
> I tested with a ST33TPHF20 SPI TPM.
> 
> I'm surprised it did not work with an SLB9670, I don't see anything in the spec
> explaining this CS# specificity.

The CS# may controls an internal state machine and the SLB9670 uses that signal. 
> 
> > For the code you wrote I'm considering to add a few lines to control
> > the CS# in that way how my xfer is doing this for the SLB9670.
> 
> Yes please, share the patch and add me in cc so I could test it with mine.
Fine, will do so soon.
> 
> > On the other hand what about to use a xfer what can handle all three
> > cases (in, out, in/out)?
> 
> As I did not implement any TPM command that needed it I did not care about
> it. Of course if there is a need for it: it should be implemented too. I
> contributed only basic support for essential commands (measured boot,
> mainly) but please feel free to enhance the code to add more features!
> 
Ok, seems we are working on the same stuff.
> Regards,
> Miquèl
Regards,
Martin

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  9:13       ` Hecht, Martin
@ 2018-06-18  9:21         ` Miquel Raynal
  2018-06-18  9:29           ` Hecht, Martin
  2018-07-13 19:30         ` Miquel Raynal
  1 sibling, 1 reply; 15+ messages in thread
From: Miquel Raynal @ 2018-06-18  9:21 UTC (permalink / raw)
  To: u-boot

Hi Martin,

On Mon, 18 Jun 2018 09:13:36 +0000, "Hecht, Martin (Avnet Silica)"
<Martin.Hecht@avnet.eu> wrote:

> Hi Miquèl,
> 
> > -----Original Message-----
> > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > Sent: Montag, 18. Juni 2018 10:43
> > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > 
> > Hi Martin,
> > 
> > On Mon, 18 Jun 2018 08:20:20 +0000, "Hecht, Martin (Avnet Silica)"
> > <Martin.Hecht@avnet.eu> wrote:
> >   
> > > Hi Miquel,
> > >  
> > > > -----Original Message-----
> > > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > > Sent: Montag, 18. Juni 2018 10:05
> > > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > >
> > > > Hi Martin,
> > > >
> > > > On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
> > > > <Martin.Hecht@avnet.eu> wrote:
> > > >  
> > > > > Hi Miquel, Simon,
> > > > >
> > > > > Is there any specific reason why the new tpm2_tis_spi_xfer doesn't  
> > > > support full duplex? It seems we did some work in parallel but you
> > > > sent the patches earlier. Is that codes tested against an existing
> > > > TPM v2? I have a working implementation what runs on SLB9670 including  
> > full duplex.  
> > > >
> > > > What do you mean exactly?
> > > >
> > > > I don't think the TPM2 protocol makes real use of full-duplex unless
> > > > for the wait state between the host command and the actual xfer.  
> > >
> > > You are right, TIS 1.3 FIFO doesn’t use full duplex in physical level. What I  
> > mean is that the driver you just wrote doesn't use the xfer function in that
> > way that you can specify in and out parameters at same time. I did this in my
> > implementation what gave me an easy chance to control the CS# of the TPM.
> > 
> > Do you need this CS# handling for more advanced features? Same question
> > for the in/out xfers?
> >   
> > > Can you tell me on what TPM did you test? For the SLB9670 the code
> > > doesn't work on my hardware.  
> > 
> > I tested with a ST33TPHF20 SPI TPM.
> > 
> > I'm surprised it did not work with an SLB9670, I don't see anything in the spec
> > explaining this CS# specificity.  
> 
> The CS# may controls an internal state machine and the SLB9670 uses that signal. 

Ok, can you explain what should be done (and where/when) to make it work
with the SLB9670?

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  9:21         ` Miquel Raynal
@ 2018-06-18  9:29           ` Hecht, Martin
  2018-06-18  9:34             ` Miquel Raynal
  0 siblings, 1 reply; 15+ messages in thread
From: Hecht, Martin @ 2018-06-18  9:29 UTC (permalink / raw)
  To: u-boot

Hi Miquel,
> -----Original Message-----
> From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> Sent: Montag, 18. Juni 2018 11:22
> To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> Cc: sjg at chromium.org; u-boot at lists.denx.de; Roeder, Michael (Avnet Silica)
> <Michael.Roeder@avnet.eu>
> Subject: Re: [U-Boot] tpm TIS TPMv2.0
> 
> Hi Martin,
> 
> On Mon, 18 Jun 2018 09:13:36 +0000, "Hecht, Martin (Avnet Silica)"
> <Martin.Hecht@avnet.eu> wrote:
> 
> > Hi Miquèl,
> >
> > > -----Original Message-----
> > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > Sent: Montag, 18. Juni 2018 10:43
> > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > >
> > > Hi Martin,
> > >
> > > On Mon, 18 Jun 2018 08:20:20 +0000, "Hecht, Martin (Avnet Silica)"
> > > <Martin.Hecht@avnet.eu> wrote:
> > >
> > > > Hi Miquel,
> > > >
> > > > > -----Original Message-----
> > > > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > > > Sent: Montag, 18. Juni 2018 10:05
> > > > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > >
> > > > > Hi Martin,
> > > > >
> > > > > On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
> > > > > <Martin.Hecht@avnet.eu> wrote:
> > > > >
> > > > > > Hi Miquel, Simon,
> > > > > >
> > > > > > Is there any specific reason why the new tpm2_tis_spi_xfer
> > > > > > doesn't
> > > > > support full duplex? It seems we did some work in parallel but
> > > > > you sent the patches earlier. Is that codes tested against an
> > > > > existing TPM v2? I have a working implementation what runs on
> > > > > SLB9670 including
> > > full duplex.
> > > > >
> > > > > What do you mean exactly?
> > > > >
> > > > > I don't think the TPM2 protocol makes real use of full-duplex
> > > > > unless for the wait state between the host command and the actual
> xfer.
> > > >
> > > > You are right, TIS 1.3 FIFO doesn’t use full duplex in physical
> > > > level. What I
> > > mean is that the driver you just wrote doesn't use the xfer function
> > > in that way that you can specify in and out parameters at same time.
> > > I did this in my implementation what gave me an easy chance to control
> the CS# of the TPM.
> > >
> > > Do you need this CS# handling for more advanced features? Same
> > > question for the in/out xfers?
> > >
> > > > Can you tell me on what TPM did you test? For the SLB9670 the code
> > > > doesn't work on my hardware.
> > >
> > > I tested with a ST33TPHF20 SPI TPM.
> > >
> > > I'm surprised it did not work with an SLB9670, I don't see anything
> > > in the spec explaining this CS# specificity.
> >
> > The CS# may controls an internal state machine and the SLB9670 uses that
> signal.
> 
> Ok, can you explain what should be done (and where/when) to make it work
> with the SLB9670?
Please let me come back with my proposal soon. I have already the tpm running 
with my little different driver. There is another patch required for my SoC to 
setup the SPI correctly.
Nevertheless one question: Why did you define another dts binding instead of 
using that one what is already available on the Linux kernel? There is 
"tcg,tpm_tis-spi"  already defined.

> 
> Thanks,
> Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  9:29           ` Hecht, Martin
@ 2018-06-18  9:34             ` Miquel Raynal
  2018-06-18  9:38               ` Hecht, Martin
  0 siblings, 1 reply; 15+ messages in thread
From: Miquel Raynal @ 2018-06-18  9:34 UTC (permalink / raw)
  To: u-boot

Hi Martin (Avnet Silica),

On Mon, 18 Jun 2018 09:29:33 +0000, "Hecht, Martin (Avnet Silica)"
<Martin.Hecht@avnet.eu> wrote:

> Hi Miquel,
> > -----Original Message-----
> > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > Sent: Montag, 18. Juni 2018 11:22
> > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > Cc: sjg at chromium.org; u-boot at lists.denx.de; Roeder, Michael (Avnet Silica)
> > <Michael.Roeder@avnet.eu>
> > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > 
> > Hi Martin,
> > 
> > On Mon, 18 Jun 2018 09:13:36 +0000, "Hecht, Martin (Avnet Silica)"
> > <Martin.Hecht@avnet.eu> wrote:
> >   
> > > Hi Miquèl,
> > >  
> > > > -----Original Message-----
> > > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > > Sent: Montag, 18. Juni 2018 10:43
> > > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > >
> > > > Hi Martin,
> > > >
> > > > On Mon, 18 Jun 2018 08:20:20 +0000, "Hecht, Martin (Avnet Silica)"
> > > > <Martin.Hecht@avnet.eu> wrote:
> > > >  
> > > > > Hi Miquel,
> > > > >  
> > > > > > -----Original Message-----
> > > > > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > > > > Sent: Montag, 18. Juni 2018 10:05
> > > > > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > > > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > > >
> > > > > > Hi Martin,
> > > > > >
> > > > > > On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
> > > > > > <Martin.Hecht@avnet.eu> wrote:
> > > > > >  
> > > > > > > Hi Miquel, Simon,
> > > > > > >
> > > > > > > Is there any specific reason why the new tpm2_tis_spi_xfer
> > > > > > > doesn't  
> > > > > > support full duplex? It seems we did some work in parallel but
> > > > > > you sent the patches earlier. Is that codes tested against an
> > > > > > existing TPM v2? I have a working implementation what runs on
> > > > > > SLB9670 including  
> > > > full duplex.  
> > > > > >
> > > > > > What do you mean exactly?
> > > > > >
> > > > > > I don't think the TPM2 protocol makes real use of full-duplex
> > > > > > unless for the wait state between the host command and the actual  
> > xfer.  
> > > > >
> > > > > You are right, TIS 1.3 FIFO doesn’t use full duplex in physical
> > > > > level. What I  
> > > > mean is that the driver you just wrote doesn't use the xfer function
> > > > in that way that you can specify in and out parameters at same time.
> > > > I did this in my implementation what gave me an easy chance to control  
> > the CS# of the TPM.  
> > > >
> > > > Do you need this CS# handling for more advanced features? Same
> > > > question for the in/out xfers?
> > > >  
> > > > > Can you tell me on what TPM did you test? For the SLB9670 the code
> > > > > doesn't work on my hardware.  
> > > >
> > > > I tested with a ST33TPHF20 SPI TPM.
> > > >
> > > > I'm surprised it did not work with an SLB9670, I don't see anything
> > > > in the spec explaining this CS# specificity.  
> > >
> > > The CS# may controls an internal state machine and the SLB9670 uses that  
> > signal.
> > 
> > Ok, can you explain what should be done (and where/when) to make it work
> > with the SLB9670?  
> Please let me come back with my proposal soon. I have already the tpm running 
> with my little different driver. There is another patch required for my SoC to 
> setup the SPI correctly.

ok

> Nevertheless one question: Why did you define another dts binding instead of 
> using that one what is already available on the Linux kernel? There is 
> "tcg,tpm_tis-spi"  already defined.

I did not know this one, actually I mostly worked on U-Boot.

However, this compatible is misleading as it does not make any
difference between v1.x and v2.0 specification.

Regards,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  9:34             ` Miquel Raynal
@ 2018-06-18  9:38               ` Hecht, Martin
  2018-06-18  9:47                 ` Miquel Raynal
  0 siblings, 1 reply; 15+ messages in thread
From: Hecht, Martin @ 2018-06-18  9:38 UTC (permalink / raw)
  To: u-boot

Hi Miquèl,
> Hi Martin (Avnet Silica),
> 
> On Mon, 18 Jun 2018 09:29:33 +0000, "Hecht, Martin (Avnet Silica)"
> <Martin.Hecht@avnet.eu> wrote:
> 
> > Hi Miquel,
> > > -----Original Message-----
> > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > Sent: Montag, 18. Juni 2018 11:22
> > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > Cc: sjg at chromium.org; u-boot at lists.denx.de; Roeder, Michael (Avnet
> > > Silica) <Michael.Roeder@avnet.eu>
> > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > >
> > > Hi Martin,
> > >
> > > On Mon, 18 Jun 2018 09:13:36 +0000, "Hecht, Martin (Avnet Silica)"
> > > <Martin.Hecht@avnet.eu> wrote:
> > >
> > > > Hi Miquèl,
> > > >
> > > > > -----Original Message-----
> > > > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > > > Sent: Montag, 18. Juni 2018 10:43
> > > > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > >
> > > > > Hi Martin,
> > > > >
> > > > > On Mon, 18 Jun 2018 08:20:20 +0000, "Hecht, Martin (Avnet Silica)"
> > > > > <Martin.Hecht@avnet.eu> wrote:
> > > > >
> > > > > > Hi Miquel,
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Miquel Raynal [mailto:miquel.raynal at bootlin.com]
> > > > > > > Sent: Montag, 18. Juni 2018 10:05
> > > > > > > To: Hecht, Martin (Avnet Silica) <Martin.Hecht@avnet.eu>
> > > > > > > Cc: sjg at chromium.org; u-boot at lists.denx.de
> > > > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > > > >
> > > > > > > Hi Martin,
> > > > > > >
> > > > > > > On Fri, 15 Jun 2018 13:34:07 +0000, "Hecht, Martin (Avnet Silica)"
> > > > > > > <Martin.Hecht@avnet.eu> wrote:
> > > > > > >
> > > > > > > > Hi Miquel, Simon,
> > > > > > > >
> > > > > > > > Is there any specific reason why the new tpm2_tis_spi_xfer
> > > > > > > > doesn't
> > > > > > > support full duplex? It seems we did some work in parallel
> > > > > > > but you sent the patches earlier. Is that codes tested
> > > > > > > against an existing TPM v2? I have a working implementation
> > > > > > > what runs on
> > > > > > > SLB9670 including
> > > > > full duplex.
> > > > > > >
> > > > > > > What do you mean exactly?
> > > > > > >
> > > > > > > I don't think the TPM2 protocol makes real use of
> > > > > > > full-duplex unless for the wait state between the host
> > > > > > > command and the actual
> > > xfer.
> > > > > >
> > > > > > You are right, TIS 1.3 FIFO doesn’t use full duplex in
> > > > > > physical level. What I
> > > > > mean is that the driver you just wrote doesn't use the xfer
> > > > > function in that way that you can specify in and out parameters at
> same time.
> > > > > I did this in my implementation what gave me an easy chance to
> > > > > control
> > > the CS# of the TPM.
> > > > >
> > > > > Do you need this CS# handling for more advanced features? Same
> > > > > question for the in/out xfers?
> > > > >
> > > > > > Can you tell me on what TPM did you test? For the SLB9670 the
> > > > > > code doesn't work on my hardware.
> > > > >
> > > > > I tested with a ST33TPHF20 SPI TPM.
> > > > >
> > > > > I'm surprised it did not work with an SLB9670, I don't see
> > > > > anything in the spec explaining this CS# specificity.
> > > >
> > > > The CS# may controls an internal state machine and the SLB9670
> > > > uses that
> > > signal.
> > >
> > > Ok, can you explain what should be done (and where/when) to make it
> > > work with the SLB9670?
> > Please let me come back with my proposal soon. I have already the tpm
> > running with my little different driver. There is another patch
> > required for my SoC to setup the SPI correctly.
> 
> ok
> 
> > Nevertheless one question: Why did you define another dts binding
> > instead of using that one what is already available on the Linux
> > kernel? There is "tcg,tpm_tis-spi"  already defined.
> 
> I did not know this one, actually I mostly worked on U-Boot.
> 
> However, this compatible is misleading as it does not make any difference
> between v1.x and v2.0 specification.

But on the other hand it would give us a chance to determine the version at 
runtime what could be beneficial for firmware updates. But this is a special case.

> Regards,
> Miquèl

Regards,
Martin

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  9:38               ` Hecht, Martin
@ 2018-06-18  9:47                 ` Miquel Raynal
  2018-06-19 22:03                   ` Simon Glass
  0 siblings, 1 reply; 15+ messages in thread
From: Miquel Raynal @ 2018-06-18  9:47 UTC (permalink / raw)
  To: u-boot

Hi Martin,

> > > Nevertheless one question: Why did you define another dts binding
> > > instead of using that one what is already available on the Linux
> > > kernel? There is "tcg,tpm_tis-spi"  already defined.  
> > 
> > I did not know this one, actually I mostly worked on U-Boot.
> > 
> > However, this compatible is misleading as it does not make any difference
> > between v1.x and v2.0 specification.  
> 
> But on the other hand it would give us a chance to determine the version at 
> runtime what could be beneficial for firmware updates. But this is a special case.

We already discussed that point on the ML and decided to choose the
version at compile time. I did not have the firmware update case in
mind though.

Regards,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  9:47                 ` Miquel Raynal
@ 2018-06-19 22:03                   ` Simon Glass
  2018-06-20  8:16                     ` Hecht, Martin
  0 siblings, 1 reply; 15+ messages in thread
From: Simon Glass @ 2018-06-19 22:03 UTC (permalink / raw)
  To: u-boot

Hi,

On 18 June 2018 at 03:47, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Martin,
>
> > > > Nevertheless one question: Why did you define another dts binding
> > > > instead of using that one what is already available on the Linux
> > > > kernel? There is "tcg,tpm_tis-spi"  already defined.
> > >
> > > I did not know this one, actually I mostly worked on U-Boot.
> > >
> > > However, this compatible is misleading as it does not make any difference
> > > between v1.x and v2.0 specification.
> >
> > But on the other hand it would give us a chance to determine the version at
> > runtime what could be beneficial for firmware updates. But this is a special case.
>
> We already discussed that point on the ML and decided to choose the
> version at compile time. I did not have the firmware update case in
> mind though.

I think we need to move to determining the version at run-time,
allowing people to build U-Boot with both versions if needed. This
will be helpful for testing in particular.

Regards,
Simon

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-19 22:03                   ` Simon Glass
@ 2018-06-20  8:16                     ` Hecht, Martin
  0 siblings, 0 replies; 15+ messages in thread
From: Hecht, Martin @ 2018-06-20  8:16 UTC (permalink / raw)
  To: u-boot

Hi Miquel, Simon,
 
> Hi,
> 
> On 18 June 2018 at 03:47, Miquel Raynal <miquel.raynal@bootlin.com>
> wrote:
> >
> > Hi Martin,
> >
> > > > > Nevertheless one question: Why did you define another dts binding
> > > > > instead of using that one what is already available on the Linux
> > > > > kernel? There is "tcg,tpm_tis-spi"  already defined.
> > > >
> > > > I did not know this one, actually I mostly worked on U-Boot.
> > > >
> > > > However, this compatible is misleading as it does not make any
> difference
> > > > between v1.x and v2.0 specification.
> > >
> > > But on the other hand it would give us a chance to determine the version
> at
> > > runtime what could be beneficial for firmware updates. But this is a
> special case.
> >
> > We already discussed that point on the ML and decided to choose the
> > version at compile time. I did not have the firmware update case in
> > mind though.
> 
> I think we need to move to determining the version at run-time,
> allowing people to build U-Boot with both versions if needed. This
> will be helpful for testing in particular.
> 
Also I would prefer to determine the version at runtime. I will check this with two 
different firmware versions of SLB9670 (for TPM 1.2 and 2.0). 

Regards
Martin
> Regards,
> Simon

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-06-18  9:13       ` Hecht, Martin
  2018-06-18  9:21         ` Miquel Raynal
@ 2018-07-13 19:30         ` Miquel Raynal
  2018-07-14 13:04           ` Hecht, Martin
  1 sibling, 1 reply; 15+ messages in thread
From: Miquel Raynal @ 2018-07-13 19:30 UTC (permalink / raw)
  To: u-boot

Hi Martin,

> > > > > Is there any specific reason why the new tpm2_tis_spi_xfer doesn't  
> > > > support full duplex? It seems we did some work in parallel but you
> > > > sent the patches earlier. Is that codes tested against an existing
> > > > TPM v2? I have a working implementation what runs on SLB9670 including  
> > full duplex.  
> > > >
> > > > What do you mean exactly?
> > > >
> > > > I don't think the TPM2 protocol makes real use of full-duplex unless
> > > > for the wait state between the host command and the actual xfer.  
> > >
> > > You are right, TIS 1.3 FIFO doesn’t use full duplex in physical level. What I  
> > mean is that the driver you just wrote doesn't use the xfer function in that
> > way that you can specify in and out parameters at same time. I did this in my
> > implementation what gave me an easy chance to control the CS# of the TPM.
> > 
> > Do you need this CS# handling for more advanced features? Same question
> > for the in/out xfers?
> >   
> > > Can you tell me on what TPM did you test? For the SLB9670 the code
> > > doesn't work on my hardware.  
> > 
> > I tested with a ST33TPHF20 SPI TPM.
> > 
> > I'm surprised it did not work with an SLB9670, I don't see anything in the spec
> > explaining this CS# specificity.  
> 
> The CS# may controls an internal state machine and the SLB9670 uses that signal. 
> >   
> > > For the code you wrote I'm considering to add a few lines to control
> > > the CS# in that way how my xfer is doing this for the SLB9670.  
> > 
> > Yes please, share the patch and add me in cc so I could test it with mine.  
> Fine, will do so soon.

What's the status of this? I did not spot any patches, maybe you
forgot to copy me? Otherwise do you still plan to share the changes?
That would be great!

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-07-13 19:30         ` Miquel Raynal
@ 2018-07-14 13:04           ` Hecht, Martin
  2018-07-14 13:10             ` Miquel Raynal
  0 siblings, 1 reply; 15+ messages in thread
From: Hecht, Martin @ 2018-07-14 13:04 UTC (permalink / raw)
  To: u-boot

Hi Miquel,

I'm busy on that again hopefully end of next week. I was bound in other projects too. So you didn't miss anything. I come back on you soon.
By the way allow me one question please. Would you have a chance to test on your how too? What processor do you use? I'm on Zynq7000 and ZynqMP.

Regards
Martin



Gesendet über BlackBerry Work (www.blackberry.com)
________________________________
Von: Miquel Raynal <miquel.raynal@bootlin.com>
Datum: 13.07.2018 21:30
An: "Hecht, Martin (Avnet Silica)" <Martin.Hecht@avnet.eu>
Cc: sjg at chromium.org; u-boot at lists.denx.de; "Roeder, Michael (Avnet Silica)" <Michael.Roeder@avnet.eu>
Betreff: Re: [U-Boot] tpm TIS TPMv2.0

Hi Martin,

> > > > > Is there any specific reason why the new tpm2_tis_spi_xfer doesn't
> > > > support full duplex? It seems we did some work in parallel but you
> > > > sent the patches earlier. Is that codes tested against an existing
> > > > TPM v2? I have a working implementation what runs on SLB9670 including
> > full duplex.
> > > >
> > > > What do you mean exactly?
> > > >
> > > > I don't think the TPM2 protocol makes real use of full-duplex unless
> > > > for the wait state between the host command and the actual xfer.
> > >
> > > You are right, TIS 1.3 FIFO doesn’t use full duplex in physical level. What I
> > mean is that the driver you just wrote doesn't use the xfer function in that
> > way that you can specify in and out parameters at same time. I did this in my
> > implementation what gave me an easy chance to control the CS# of the TPM.
> >
> > Do you need this CS# handling for more advanced features? Same question
> > for the in/out xfers?
> >
> > > Can you tell me on what TPM did you test? For the SLB9670 the code
> > > doesn't work on my hardware.
> >
> > I tested with a ST33TPHF20 SPI TPM.
> >
> > I'm surprised it did not work with an SLB9670, I don't see anything in the spec
> > explaining this CS# specificity.
>
> The CS# may controls an internal state machine and the SLB9670 uses that signal.
> >
> > > For the code you wrote I'm considering to add a few lines to control
> > > the CS# in that way how my xfer is doing this for the SLB9670.
> >
> > Yes please, share the patch and add me in cc so I could test it with mine.
> Fine, will do so soon.

What's the status of this? I did not spot any patches, maybe you
forgot to copy me? Otherwise do you still plan to share the changes?
That would be great!

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [U-Boot] tpm TIS TPMv2.0
  2018-07-14 13:04           ` Hecht, Martin
@ 2018-07-14 13:10             ` Miquel Raynal
  0 siblings, 0 replies; 15+ messages in thread
From: Miquel Raynal @ 2018-07-14 13:10 UTC (permalink / raw)
  To: u-boot

Hi Martin,

"Hecht, Martin (Avnet Silica)" <Martin.Hecht@avnet.eu> wrote on Sat, 14
Jul 2018 13:04:26 +0000:

> Hi Miquel,
> 
> I'm busy on that again hopefully end of next week. I was bound in other projects too. So you didn't miss anything. I come back on you soon.
> By the way allow me one question please. Would you have a chance to test on your how too? What processor do you use? I'm on Zynq7000 and ZynqMP.

If I still have the hardware I could test it on a Marvell Espressobin
with a ST TPM.

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-07-14 13:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15 13:34 [U-Boot] tpm TIS TPMv2.0 Hecht, Martin
2018-06-18  8:04 ` Miquel Raynal
2018-06-18  8:20   ` Hecht, Martin
2018-06-18  8:43     ` Miquel Raynal
2018-06-18  9:13       ` Hecht, Martin
2018-06-18  9:21         ` Miquel Raynal
2018-06-18  9:29           ` Hecht, Martin
2018-06-18  9:34             ` Miquel Raynal
2018-06-18  9:38               ` Hecht, Martin
2018-06-18  9:47                 ` Miquel Raynal
2018-06-19 22:03                   ` Simon Glass
2018-06-20  8:16                     ` Hecht, Martin
2018-07-13 19:30         ` Miquel Raynal
2018-07-14 13:04           ` Hecht, Martin
2018-07-14 13:10             ` Miquel Raynal

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.