[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM4PR12MB57696F6C2AB9217ADBE6FFE4C3AB9@DM4PR12MB5769.namprd12.prod.outlook.com>
Date: Thu, 23 Feb 2023 18:46:22 +0000
From: Krishna Yarlagadda <kyarlagadda@...dia.com>
To: Mark Brown <broonie@...nel.org>
CC: "robh+dt@...nel.org" <robh+dt@...nel.org>,
"peterhuewe@....de" <peterhuewe@....de>,
"jgg@...pe.ca" <jgg@...pe.ca>,
"jarkko@...nel.org" <jarkko@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Sowjanya Komatineni <skomatineni@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>
Subject: RE: [Patch V3 3/3] spi: tegra210-quad: Enable TPM wait polling
> -----Original Message-----
> From: Mark Brown <broonie@...nel.org>
> Sent: 23 February 2023 22:59
> To: Krishna Yarlagadda <kyarlagadda@...dia.com>
> Cc: robh+dt@...nel.org; peterhuewe@....de; jgg@...pe.ca;
> jarkko@...nel.org; krzysztof.kozlowski+dt@...aro.org; linux-
> spi@...r.kernel.org; linux-tegra@...r.kernel.org; linux-
> integrity@...r.kernel.org; linux-kernel@...r.kernel.org;
> thierry.reding@...il.com; Jonathan Hunter <jonathanh@...dia.com>;
> Sowjanya Komatineni <skomatineni@...dia.com>; Laxman Dewangan
> <ldewangan@...dia.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.
Powered by blists - more mailing lists