public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tpm_tis_spi: Add compatible string atmel,attpm20p
@ 2023-12-23  9:34 Lukas Wunner
  2024-01-03 13:53 ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Wunner @ 2023-12-23  9:34 UTC (permalink / raw)
  To: Jarkko Sakkinen, Peter Huewe, Jason Gunthorpe, Tim Harvey; +Cc: linux-integrity

Commit 4f2a348aa365 ("arm64: dts: imx8mm-venice-gw73xx: add TPM device")
added a devicetree node for the Trusted Platform Module on certain
Gateworks boards.

The commit only used the generic "tcg,tpm_tis-spi" compatible string,
but public documentation shows that the chip is an ATTPM20P from Atmel
(nowadays Microchip):
https://trac.gateworks.com/wiki/tpm

Add the chip to the supported compatible strings of the TPM TIS SPI
driver.

For reference, a datasheet is available at:
https://ww1.microchip.com/downloads/en/DeviceDoc/ATTPM20P-Trusted-Platform-Module-TPM-2.0-SPI-Interface-Summary-Data-Sheet-DS40002082A.pdf

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Tim Harvey <tharvey@gateworks.com>
---
 drivers/char/tpm/tpm_tis_spi_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
index c5c3197ee29f..7d376a642807 100644
--- a/drivers/char/tpm/tpm_tis_spi_main.c
+++ b/drivers/char/tpm/tpm_tis_spi_main.c
@@ -327,6 +327,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
 MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
 
 static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
+	{ .compatible = "atmel,attpm20p", .data = tpm_tis_spi_probe },
 	{ .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe },
 	{ .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe },
 	{ .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe },
-- 
2.40.1


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

* Re: [PATCH] tpm_tis_spi: Add compatible string atmel,attpm20p
  2023-12-23  9:34 [PATCH] tpm_tis_spi: Add compatible string atmel,attpm20p Lukas Wunner
@ 2024-01-03 13:53 ` Jarkko Sakkinen
  2024-01-03 13:57   ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2024-01-03 13:53 UTC (permalink / raw)
  To: Lukas Wunner, Peter Huewe, Jason Gunthorpe, Tim Harvey; +Cc: linux-integrity

On Sat Dec 23, 2023 at 11:34 AM EET, Lukas Wunner wrote:
> Commit 4f2a348aa365 ("arm64: dts: imx8mm-venice-gw73xx: add TPM device")
> added a devicetree node for the Trusted Platform Module on certain
> Gateworks boards.
>
> The commit only used the generic "tcg,tpm_tis-spi" compatible string,
> but public documentation shows that the chip is an ATTPM20P from Atmel
> (nowadays Microchip):
> https://trac.gateworks.com/wiki/tpm
>
> Add the chip to the supported compatible strings of the TPM TIS SPI
> driver.
>
> For reference, a datasheet is available at:
> https://ww1.microchip.com/downloads/en/DeviceDoc/ATTPM20P-Trusted-Platform-Module-TPM-2.0-SPI-Interface-Summary-Data-Sheet-DS40002082A.pdf
>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> Cc: Tim Harvey <tharvey@gateworks.com>
> ---
>  drivers/char/tpm/tpm_tis_spi_main.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
> index c5c3197ee29f..7d376a642807 100644
> --- a/drivers/char/tpm/tpm_tis_spi_main.c
> +++ b/drivers/char/tpm/tpm_tis_spi_main.c
> @@ -327,6 +327,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
>  MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
>  
>  static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
> +	{ .compatible = "atmel,attpm20p", .data = tpm_tis_spi_probe },
>  	{ .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe },
>  	{ .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe },
>  	{ .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe },

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@kernel.org>

BR, Jarkko

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

* Re: [PATCH] tpm_tis_spi: Add compatible string atmel,attpm20p
  2024-01-03 13:53 ` Jarkko Sakkinen
@ 2024-01-03 13:57   ` Jarkko Sakkinen
  2024-01-03 16:10     ` Lukas Wunner
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2024-01-03 13:57 UTC (permalink / raw)
  To: Jarkko Sakkinen, Lukas Wunner, Peter Huewe, Jason Gunthorpe,
	Tim Harvey
  Cc: linux-integrity

On Wed Jan 3, 2024 at 3:53 PM EET, Jarkko Sakkinen wrote:
> On Sat Dec 23, 2023 at 11:34 AM EET, Lukas Wunner wrote:
> > Commit 4f2a348aa365 ("arm64: dts: imx8mm-venice-gw73xx: add TPM device")
> > added a devicetree node for the Trusted Platform Module on certain
> > Gateworks boards.
> >
> > The commit only used the generic "tcg,tpm_tis-spi" compatible string,
> > but public documentation shows that the chip is an ATTPM20P from Atmel
> > (nowadays Microchip):
> > https://trac.gateworks.com/wiki/tpm
> >
> > Add the chip to the supported compatible strings of the TPM TIS SPI
> > driver.
> >
> > For reference, a datasheet is available at:
> > https://ww1.microchip.com/downloads/en/DeviceDoc/ATTPM20P-Trusted-Platform-Module-TPM-2.0-SPI-Interface-Summary-Data-Sheet-DS40002082A.pdf
> >
> > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> > Cc: Tim Harvey <tharvey@gateworks.com>
> > ---
> >  drivers/char/tpm/tpm_tis_spi_main.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
> > index c5c3197ee29f..7d376a642807 100644
> > --- a/drivers/char/tpm/tpm_tis_spi_main.c
> > +++ b/drivers/char/tpm/tpm_tis_spi_main.c
> > @@ -327,6 +327,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
> >  MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
> >  
> >  static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
> > +	{ .compatible = "atmel,attpm20p", .data = tpm_tis_spi_probe },
> >  	{ .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe },
> >  	{ .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe },
> >  	{ .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe },
>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@kernel.org>

Taking this back as checkpatch gives warning:

WARNING: DT compatible string "atmel,attpm20p" appears un-documented -- check ./Documentation/devicetree/bindings/
#36: FILE: drivers/char/tpm/tpm_tis_spi_main.c:330:
+	{ .compatible = "atmel,attpm20p", .data = tpm_tis_spi_probe },

BR, Jarkko

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

* Re: [PATCH] tpm_tis_spi: Add compatible string atmel,attpm20p
  2024-01-03 13:57   ` Jarkko Sakkinen
@ 2024-01-03 16:10     ` Lukas Wunner
  0 siblings, 0 replies; 4+ messages in thread
From: Lukas Wunner @ 2024-01-03 16:10 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: Peter Huewe, Jason Gunthorpe, Tim Harvey, linux-integrity

On Wed, Jan 03, 2024 at 03:57:00PM +0200, Jarkko Sakkinen wrote:
> On Wed Jan 3, 2024 at 3:53 PM EET, Jarkko Sakkinen wrote:
> > On Sat Dec 23, 2023 at 11:34 AM EET, Lukas Wunner wrote:
> > > Commit 4f2a348aa365 ("arm64: dts: imx8mm-venice-gw73xx: add TPM device")
> > > added a devicetree node for the Trusted Platform Module on certain
> > > Gateworks boards.
> > >
> > > The commit only used the generic "tcg,tpm_tis-spi" compatible string,
> > > but public documentation shows that the chip is an ATTPM20P from Atmel
> > > (nowadays Microchip):
> > > https://trac.gateworks.com/wiki/tpm
> > >
> > > Add the chip to the supported compatible strings of the TPM TIS SPI
> > > driver.
[...]
> > > --- a/drivers/char/tpm/tpm_tis_spi_main.c
> > > +++ b/drivers/char/tpm/tpm_tis_spi_main.c
> > > @@ -327,6 +327,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
> > >  MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
> > >  
> > >  static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
> > > +	{ .compatible = "atmel,attpm20p", .data = tpm_tis_spi_probe },
> > >  	{ .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe },
> > >  	{ .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe },
> > >  	{ .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe },
> >
> > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@kernel.org>
> 
> Taking this back as checkpatch gives warning:
> 
> WARNING: DT compatible string "atmel,attpm20p" appears un-documented -- check ./Documentation/devicetree/bindings/
> #36: FILE: drivers/char/tpm/tpm_tis_spi_main.c:330:
> +	{ .compatible = "atmel,attpm20p", .data = tpm_tis_spi_probe },

Yes, sorry for the confusion.

Before applying this patch, you'd first have to pick up this series
to clean up TPM dt-bindings (it has a Reviewed-by from Rob):

https://lore.kernel.org/all/cover.1702806810.git.lukas@wunner.de/

Plus the following patch I just submitted which adds "atmel,attpm20p"
to the dt-bindings (feel free to squash with the patch "dt-bindings:
tpm: Consolidate TCG TIS bindings" in the above-linked series):

https://lore.kernel.org/all/20240103155414.93-qGU4jYFy5x6c0EXMdyw2SO2Vyz5tChxsDLbWzSFE@z/

Note that there are two other patches pending to add missing compatible
strings to the driver, but they likewise depend on the above-linked
series to clean up TPM dt-bindings:

https://lore.kernel.org/all/096e5d9d22eaed0a256d2d9b315a77245bd423c6.1701095446.git.lukas@wunner.de/
https://lore.kernel.org/all/5c92620082189dc4e6be277952d0b46df26a6478.1702811113.git.lukas@wunner.de/

Thanks,

Lukas

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

end of thread, other threads:[~2024-01-03 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-23  9:34 [PATCH] tpm_tis_spi: Add compatible string atmel,attpm20p Lukas Wunner
2024-01-03 13:53 ` Jarkko Sakkinen
2024-01-03 13:57   ` Jarkko Sakkinen
2024-01-03 16:10     ` Lukas Wunner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox