From: Krishna Yarlagadda <kyarlagadda@nvidia.com>
To: Mark Brown <broonie@kernel.org>
Cc: "robh+dt@kernel.org" <robh+dt@kernel.org>,
"peterhuewe@gmx.de" <peterhuewe@gmx.de>,
"jgg@ziepe.ca" <jgg@ziepe.ca>,
"jarkko@kernel.org" <jarkko@kernel.org>,
"krzysztof.kozlowski+dt@linaro.org"
<krzysztof.kozlowski+dt@linaro.org>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Sowjanya Komatineni <skomatineni@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>
Subject: RE: [Patch V3 3/3] spi: tegra210-quad: Enable TPM wait polling
Date: Thu, 23 Feb 2023 18:46:22 +0000 [thread overview]
Message-ID: <DM4PR12MB57696F6C2AB9217ADBE6FFE4C3AB9@DM4PR12MB5769.namprd12.prod.outlook.com> (raw)
In-Reply-To: <Y/eiQg56fPn17uVf@sirena.org.uk>
> -----Original Message-----
> From: Mark Brown <broonie@kernel.org>
> Sent: 23 February 2023 22:59
> To: Krishna Yarlagadda <kyarlagadda@nvidia.com>
> Cc: robh+dt@kernel.org; peterhuewe@gmx.de; jgg@ziepe.ca;
> jarkko@kernel.org; krzysztof.kozlowski+dt@linaro.org; linux-
> spi@vger.kernel.org; linux-tegra@vger.kernel.org; linux-
> integrity@vger.kernel.org; linux-kernel@vger.kernel.org;
> thierry.reding@gmail.com; Jonathan Hunter <jonathanh@nvidia.com>;
> Sowjanya Komatineni <skomatineni@nvidia.com>; Laxman Dewangan
> <ldewangan@nvidia.com>
> Subject: Re: [Patch V3 3/3] spi: tegra210-quad: Enable TPM wait polling
>
> On Thu, Feb 23, 2023 at 09:56:35PM +0530, Krishna Yarlagadda wrote:
>
> > Trusted Platform Module requires flow control. As defined in TPM
> > interface specification, client would drive MISO line at same cycle as
> > last address bit on MOSI.
> > Tegra241 QSPI controller has TPM wait state detection feature which is
> > enabled for TPM client devices reported in SPI device mode bits.
> > Set half duplex flag for TPM device to detect and send entire message
> > to controller in one shot.
>
> I don't really understand what the controller is actually doing here, or
> what the intended effect of the SPI_TPM_HW_FLOW flag is supposed to be.
>
> > /* Enable Combined sequence mode */
> > val = tegra_qspi_readl(tqspi, QSPI_GLOBAL_CONFIG);
> > + if (spi->mode & SPI_TPM_HW_FLOW) {
> > + if (tqspi->soc_data->tpm_wait_poll)
> > + val |= QSPI_TPM_WAIT_POLL_EN;
> > + else
> > + return -EIO;
> > + }
>
> This just sets a bit in a register...
>
> > val |= QSPI_CMB_SEQ_EN;
> > tegra_qspi_writel(tqspi, val, QSPI_GLOBAL_CONFIG);
> > /* Process individual transfer list */
>
> ...my guess is that setting that bit causes the individual transfers to
> be delayed in completing without further changes? Is is just some
> transfers or all of them?
TPM spec define flow control over SPI. TPM device/client inserts
wait state on MISO line when address is transferred on MOSI. This state
has to be detected by reading the MISO line which needs full duplex
transfer during address phase. Tegra QSPI controller can only support
half duplex. But in combined sequence mode, it can detect wait state
inserted by TPM device and send or receive data when device is ready.
Detection happens on all transfers with TPM.
next prev parent reply other threads:[~2023-02-23 18:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 16:26 [Patch V3 0/3] Tegra TPM driver with HW flow control Krishna Yarlagadda
2023-02-23 16:26 ` [Patch V3 1/3] tpm_tis-spi: Support hardware wait polling Krishna Yarlagadda
2023-02-23 17:18 ` Mark Brown
2023-02-23 18:41 ` Krishna Yarlagadda
2023-02-23 18:43 ` Mark Brown
2023-02-24 14:16 ` Krishna Yarlagadda
2023-02-24 15:51 ` Mark Brown
2023-02-24 16:21 ` Krishna Yarlagadda
2023-02-23 16:26 ` [Patch V3 2/3] spi: tegra210-quad: set half duplex flag Krishna Yarlagadda
2023-02-23 16:26 ` [Patch V3 3/3] spi: tegra210-quad: Enable TPM wait polling Krishna Yarlagadda
2023-02-23 17:28 ` Mark Brown
2023-02-23 18:46 ` Krishna Yarlagadda [this message]
2023-02-23 18:31 ` (subset) [Patch V3 0/3] Tegra TPM driver with HW flow control Mark Brown
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=DM4PR12MB57696F6C2AB9217ADBE6FFE4C3AB9@DM4PR12MB5769.namprd12.prod.outlook.com \
--to=kyarlagadda@nvidia.com \
--cc=broonie@kernel.org \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=jonathanh@nvidia.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=ldewangan@nvidia.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=robh+dt@kernel.org \
--cc=skomatineni@nvidia.com \
--cc=thierry.reding@gmail.com \
/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
all inboxes | Powered by JetHome®