Re: [PATCH 2/2] reset: Add Infineon SLB9670 TPM reset driver

Francesco Dolcini
2023-11-21T23:34:07Z

Hello Lino, hello Lukas,

On Tue, Sep 26, 2023 at 09:09:36PM +0200, Lukas Wunner wrote:
> From: Lino Sanfilippo <l.sanfilippo@kunbus.com>
>
> Normally the platform firmware is responsible for taking a Trusted
> Platform Module out of reset on boot and storing measurements into it.
>
> However if the platform firmware is incapable of doing that -- as is the
> case on the Raspberry Pi -- then the onus is on the kernel to take the
> TPM out of reset before trying to attach a driver to it.
>
> Provide a reset driver for such platforms.
>
> The Infineon SLB9670 TPM requires a specific reset sequence on its RST#
> pin which is documented in sections 5.4 and 5.5 of the datasheet:
>
> https://www.infineon.com/dgdl/Infineon-SLB%209670VQ2.0-DataSheet-v01_04-EN.pdf?fileId=5546d4626fc1ce0b016fc78270350cd6
>
> The sequence with minimum wait intervals is as follows:
>
> deassert RST#
> wait at least 60 ms
> assert RST#
> wait at least 2 usecs
> deassert RST#
> wait at least 60 ms
> assert RST#
> wait at least 2 usecs
> deassert RST#
> wait at least 60 ms before issuing the first TPM command

Are you really sure that this change is required?
I have seen the RST# Timing diagram in the datasheet, however I wonder
if a reset is required at all during power-up, for example.

Not to mention that I would have expected some firmware to implement
such reset timing and I was not able to find any (I looked at
arm/arm64), if this is really required I the driver can work at all?
Which platform firmware implements such reset sequence?

Not to mention that I was able to see the driver probe succeed in a
similar setup to the one you are describing in the commit message
(different board, arm64, but nothing done by the platform firmware).

What am I missing?

Thanks,
Francesco