devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-integrity@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] reset: Add Infineon SLB9670 TPM reset driver
Date: Wed, 22 Nov 2023 12:29:49 +0100	[thread overview]
Message-ID: <20231122112949.GA18812@wunner.de> (raw)
In-Reply-To: <ZV0+Zk590YSsvhFo@francesco-nb.int.toradex.com>

On Wed, Nov 22, 2023 at 12:33:58AM +0100, Francesco Dolcini wrote:
> On Tue, Sep 26, 2023 at 09:09:36PM +0200, Lukas Wunner wrote:
> > 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:
> 
> 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.

If the RST# pin is not toggled at all upon a warm reset (reboot),
the TPM will remain in whatever state it was during the previous boot.

Also, the pin controller connected to RST# might be reset upon a reboot
(think of a SoC internal pin controller setting all its registers to 0)
and RST# might be asserted as a result.  It is then necessary to take
the TPM out of reset.


> 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?

I can't answer how a TPM is reset by firmware on arm/arm64, you'd have
to ask an FAE at ARM.  Normally I'd expect firmware in ROM do that so
all subsequently executed code which is mutable (EFI, bootloader, kernel)
can be measured.  Again, on simple platforms such as the Raspberry Pi
there's no support to reset a TPM in ROM.


> 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).

Hm, is the RST# pin even connected on that board?

Thanks,

Lukas

  parent reply	other threads:[~2023-11-22 11:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 19:09 [PATCH 1/2] dt-bindings: reset: Add Infineon SLB9670 TPM reset driver Lukas Wunner
2023-09-26 19:09 ` [PATCH 2/2] " Lukas Wunner
2023-11-21 23:33   ` Francesco Dolcini
2023-11-22  7:36     ` Francesco Dolcini
2023-11-22 11:29     ` Lukas Wunner [this message]
2023-11-22 15:15       ` Francesco Dolcini
2023-11-23  8:59         ` Lukas Wunner
2023-12-18 17:34           ` Francesco Dolcini
2023-12-18 17:51             ` Lukas Wunner
2023-12-21 10:09               ` Alexander Steffen
2023-09-26 20:37 ` [PATCH 1/2] dt-bindings: " Rob Herring
2023-09-27  6:31   ` Lukas Wunner
2023-09-27 11:53     ` Rob Herring
2023-09-27  7:48 ` Krzysztof Kozlowski

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=20231122112949.GA18812@wunner.de \
    --to=lukas@wunner.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=francesco@dolcini.it \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=l.sanfilippo@kunbus.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).