mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krishna Yarlagadda <kyarlagadda@nvidia.com>
To: <jsnitsel@redhat.com>, <robh+dt@kernel.org>, <broonie@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>
Cc: <thierry.reding@gmail.com>, <jonathanh@nvidia.com>,
	<skomatineni@nvidia.com>, <ldewangan@nvidia.com>,
	Krishna Yarlagadda <kyarlagadda@nvidia.com>
Subject: [Patch V10 0/3] Tegra TPM driver with HW flow control
Date: Fri, 21 Apr 2023 14:43:06 +0530	[thread overview]
Message-ID: <20230421091309.2672-1-kyarlagadda@nvidia.com> (raw)

TPM devices may insert wait state on last clock cycle of ADDR phase.
For SPI controllers that support full-duplex transfers, this can be
detected using software by reading the MISO line. For SPI controllers
that only support half-duplex transfers, such as the Tegra QSPI, it is
not possible to detect the wait signal from software. The QSPI
controller in Tegra234 and Tegra241 implement hardware detection of the
wait signal which can be enabled in the controller for TPM devices.

Add HW flow control in TIS driver and a flag in SPI data to indicate
wait detection is required in HW. SPI controller driver determines if
this is supported. Add HW detection in Tegra QSPI controller.

Updates in this patch set 
 - Tegra QSPI identifies itself as half duplex.
 - TPM TIS SPI driver skips flow control for half duplex and send
   transfers in single message for controller to handle it.
 - TPM device identifies as TPM device for controller to detect and
   enable HW TPM wait poll feature.

Verified with a TPM device on Tegra241 ref board using TPM2 tools.

V10
 - use spi_sync in place of spi_sync_locked
V9
 - renamed tpm spi transfer functions
V8:
 - fix compile warning.
V7:
 - updated patch description.
 - TPM flag set in probe.
 - minor comments.
V6:
 - Fix typo in chip name Tegra234.
 - Debug logs change skipped to be sent later.
 - Consistent usage of soc flag.
V5:
 - No SPI bus locking.
V4:
 - Split api change to different patch.
 - Describe TPM HW flow control.
V3:
 - Use SPI device mode flag and SPI controller flags.
 - Drop usage of device tree flags.
 - Generic TPM half duplex controller handling.
 - HW & SW flow control for TPM. Drop additional driver.
V2:
 - Fix dt schema errors.

Krishna Yarlagadda (3):
  spi: Add TPM HW flow flag
  tpm_tis-spi: Add hardware wait polling
  spi: tegra210-quad: Enable TPM wait polling

 drivers/char/tpm/tpm_tis_spi_main.c | 91 ++++++++++++++++++++++++++++-
 drivers/spi/spi-tegra210-quad.c     | 14 +++++
 include/linux/spi/spi.h             | 16 ++++-
 3 files changed, 116 insertions(+), 5 deletions(-)

-- 
2.17.1


             reply	other threads:[~2023-04-21  9:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  9:13 Krishna Yarlagadda [this message]
2023-04-21  9:13 ` [Patch V10 1/3] spi: Add TPM HW flow flag Krishna Yarlagadda
2023-04-21  9:13 ` [Patch V10 2/3] tpm_tis-spi: Add hardware wait polling Krishna Yarlagadda
2023-04-23 15:08   ` Jarkko Sakkinen
2023-04-24 11:56     ` Mark Brown
2023-04-24 13:11       ` Jarkko Sakkinen
2023-04-24 14:46       ` Thierry Reding
2023-04-24 15:18         ` Mark Brown
2023-04-24 15:31           ` Thierry Reding
2023-05-10 15:10             ` Krishna Yarlagadda
2023-05-24 12:43               ` Krishna Yarlagadda
2023-06-01  8:29                 ` Thierry Reding
2023-06-01 11:04                   ` Mark Brown
2023-06-01 12:36                     ` Thierry Reding
2023-06-01 12:40                       ` Mark Brown
2023-06-09 14:19                         ` Jarkko Sakkinen
2023-06-09 14:22                           ` Mark Brown
2023-06-09 15:12                             ` Jarkko Sakkinen
2023-04-21  9:13 ` [Patch V10 3/3] spi: tegra210-quad: Enable TPM " Krishna Yarlagadda
2023-04-21  9:39   ` Jon Hunter
2023-04-21 12:50 ` [Patch V10 0/3] Tegra TPM driver with HW flow control Jerry Snitselaar
2023-04-24 13:21 ` (subset) " 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=20230421091309.2672-1-kyarlagadda@nvidia.com \
    --to=kyarlagadda@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jonathanh@nvidia.com \
    --cc=jsnitsel@redhat.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®