Re: [U-Boot] tpm TIS TPMv2.0

2018-07-14 Thread Miquel Raynal
Hi Martin,

"Hecht, Martin (Avnet Silica)"  wrote on Sat, 14
Jul 2018 13:04:26 +:

> 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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-07-14 Thread Hecht, Martin (Avnet Silica)
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 
Datum: 13.07.2018 21:30
An: "Hecht, Martin (Avnet Silica)" 
Cc: s...@chromium.org; u-boot@lists.denx.de; "Roeder, Michael (Avnet Silica)" 

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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-07-13 Thread Miquel Raynal
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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-20 Thread Hecht, Martin (Avnet Silica)
Hi Miquel, Simon,
 
> Hi,
> 
> On 18 June 2018 at 03:47, Miquel Raynal 
> 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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-19 Thread Simon Glass
Hi,

On 18 June 2018 at 03:47, Miquel Raynal  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Miquel Raynal
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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Hecht, Martin (Avnet Silica)
Hi Miquèl,
> Hi Martin (Avnet Silica),
> 
> On Mon, 18 Jun 2018 09:29:33 +, "Hecht, Martin (Avnet Silica)"
>  wrote:
> 
> > Hi Miquel,
> > > -Original Message-
> > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > Sent: Montag, 18. Juni 2018 11:22
> > > To: Hecht, Martin (Avnet Silica) 
> > > Cc: s...@chromium.org; u-boot@lists.denx.de; Roeder, Michael (Avnet
> > > Silica) 
> > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > >
> > > Hi Martin,
> > >
> > > On Mon, 18 Jun 2018 09:13:36 +, "Hecht, Martin (Avnet Silica)"
> > >  wrote:
> > >
> > > > Hi Miquèl,
> > > >
> > > > > -Original Message-
> > > > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > > > Sent: Montag, 18. Juni 2018 10:43
> > > > > To: Hecht, Martin (Avnet Silica) 
> > > > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > >
> > > > > Hi Martin,
> > > > >
> > > > > On Mon, 18 Jun 2018 08:20:20 +, "Hecht, Martin (Avnet Silica)"
> > > > >  wrote:
> > > > >
> > > > > > Hi Miquel,
> > > > > >
> > > > > > > -Original Message-
> > > > > > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > > > > > Sent: Montag, 18. Juni 2018 10:05
> > > > > > > To: Hecht, Martin (Avnet Silica) 
> > > > > > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > > > >
> > > > > > > Hi Martin,
> > > > > > >
> > > > > > > On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
> > > > > > >  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

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Miquel Raynal
Hi Martin (Avnet Silica),

On Mon, 18 Jun 2018 09:29:33 +, "Hecht, Martin (Avnet Silica)"
 wrote:

> Hi Miquel,
> > -Original Message-
> > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > Sent: Montag, 18. Juni 2018 11:22
> > To: Hecht, Martin (Avnet Silica) 
> > Cc: s...@chromium.org; u-boot@lists.denx.de; Roeder, Michael (Avnet Silica)
> > 
> > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > 
> > Hi Martin,
> > 
> > On Mon, 18 Jun 2018 09:13:36 +, "Hecht, Martin (Avnet Silica)"
> >  wrote:
> >   
> > > Hi Miquèl,
> > >  
> > > > -Original Message-
> > > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > > Sent: Montag, 18. Juni 2018 10:43
> > > > To: Hecht, Martin (Avnet Silica) 
> > > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > >
> > > > Hi Martin,
> > > >
> > > > On Mon, 18 Jun 2018 08:20:20 +, "Hecht, Martin (Avnet Silica)"
> > > >  wrote:
> > > >  
> > > > > Hi Miquel,
> > > > >  
> > > > > > -Original Message-
> > > > > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > > > > Sent: Montag, 18. Juni 2018 10:05
> > > > > > To: Hecht, Martin (Avnet Silica) 
> > > > > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > > >
> > > > > > Hi Martin,
> > > > > >
> > > > > > On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
> > > > > >  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Hecht, Martin (Avnet Silica)
Hi Miquel,
> -Original Message-
> From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> Sent: Montag, 18. Juni 2018 11:22
> To: Hecht, Martin (Avnet Silica) 
> Cc: s...@chromium.org; u-boot@lists.denx.de; Roeder, Michael (Avnet Silica)
> 
> Subject: Re: [U-Boot] tpm TIS TPMv2.0
> 
> Hi Martin,
> 
> On Mon, 18 Jun 2018 09:13:36 +, "Hecht, Martin (Avnet Silica)"
>  wrote:
> 
> > Hi Miquèl,
> >
> > > -Original Message-
> > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > Sent: Montag, 18. Juni 2018 10:43
> > > To: Hecht, Martin (Avnet Silica) 
> > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > >
> > > Hi Martin,
> > >
> > > On Mon, 18 Jun 2018 08:20:20 +, "Hecht, Martin (Avnet Silica)"
> > >  wrote:
> > >
> > > > Hi Miquel,
> > > >
> > > > > -Original Message-
> > > > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > > > Sent: Montag, 18. Juni 2018 10:05
> > > > > To: Hecht, Martin (Avnet Silica) 
> > > > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > > >
> > > > > Hi Martin,
> > > > >
> > > > > On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
> > > > >  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Miquel Raynal
Hi Martin,

On Mon, 18 Jun 2018 09:13:36 +, "Hecht, Martin (Avnet Silica)"
 wrote:

> Hi Miquèl,
> 
> > -Original Message-
> > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > Sent: Montag, 18. Juni 2018 10:43
> > To: Hecht, Martin (Avnet Silica) 
> > Cc: s...@chromium.org; u-boot@lists.denx.de
> > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > 
> > Hi Martin,
> > 
> > On Mon, 18 Jun 2018 08:20:20 +, "Hecht, Martin (Avnet Silica)"
> >  wrote:
> >   
> > > Hi Miquel,
> > >  
> > > > -Original Message-
> > > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > > Sent: Montag, 18. Juni 2018 10:05
> > > > To: Hecht, Martin (Avnet Silica) 
> > > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > > >
> > > > Hi Martin,
> > > >
> > > > On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
> > > >  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Hecht, Martin (Avnet Silica)
Hi Miquèl,

> -Original Message-
> From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> Sent: Montag, 18. Juni 2018 10:43
> To: Hecht, Martin (Avnet Silica) 
> Cc: s...@chromium.org; u-boot@lists.denx.de
> Subject: Re: [U-Boot] tpm TIS TPMv2.0
> 
> Hi Martin,
> 
> On Mon, 18 Jun 2018 08:20:20 +, "Hecht, Martin (Avnet Silica)"
>  wrote:
> 
> > Hi Miquel,
> >
> > > -Original Message-
> > > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > > Sent: Montag, 18. Juni 2018 10:05
> > > To: Hecht, Martin (Avnet Silica) 
> > > Cc: s...@chromium.org; u-boot@lists.denx.de
> > > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > >
> > > Hi Martin,
> > >
> > > On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
> > >  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Miquel Raynal
Hi Martin,

On Mon, 18 Jun 2018 08:20:20 +, "Hecht, Martin (Avnet Silica)"
 wrote:

> Hi Miquel,
> 
> > -Original Message-
> > From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> > Sent: Montag, 18. Juni 2018 10:05
> > To: Hecht, Martin (Avnet Silica) 
> > Cc: s...@chromium.org; u-boot@lists.denx.de
> > Subject: Re: [U-Boot] tpm TIS TPMv2.0
> > 
> > Hi Martin,
> > 
> > On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
> >  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Hecht, Martin (Avnet Silica)
Hi Miquel,

> -Original Message-
> From: Miquel Raynal [mailto:miquel.ray...@bootlin.com]
> Sent: Montag, 18. Juni 2018 10:05
> To: Hecht, Martin (Avnet Silica) 
> Cc: s...@chromium.org; u-boot@lists.denx.de
> Subject: Re: [U-Boot] tpm TIS TPMv2.0
> 
> Hi Martin,
> 
> On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
>  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] tpm TIS TPMv2.0

2018-06-18 Thread Miquel Raynal
Hi Martin,

On Fri, 15 Jun 2018 13:34:07 +, "Hecht, Martin (Avnet Silica)"
 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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] tpm TIS TPMv2.0

2018-06-15 Thread Hecht, Martin (Avnet Silica)
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.he...@avnet.eu
O +49 (0) 30 214 88 227

M +49 (0) 172 890 60 19

avnet-silica.com


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

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot