[Patch V3 0/3] Tegra TPM driver with HW flow control

From: Krishna Yarlagadda
Date: Thu Feb 23 2023 - 11:27:12 EST


TPM interface spec defines flow control where TPM device would drive
MISO at same cycle as last address bit sent by controller on MOSI. This
state of wait can be detected by software reading the MISO line or
by controller hardware. Support sending transfers to controller in
single message and handle flow control in hardware. Half duplex
controllers have to support flow control in hardware.

Tegra234 and Tegra241 chips have QSPI controller that supports TPM
Interface Specification (TIS) flow control.
Since the controller only supports half duplex, SW wait polling
(flow control using full duplex transfers) method implemented in
tpm_tis_spi_main.c will not work and have to us HW flow control.

Updates in this patchset
- 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.

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):
tpm_tis-spi: Support hardware wait polling
spi: tegra210-quad: set half duplex flag
spi: tegra210-quad: Enable TPM wait polling

drivers/char/tpm/tpm_tis_spi_main.c | 90 ++++++++++++++++++++++++++++-
drivers/spi/spi-tegra210-quad.c | 22 +++++++
include/linux/spi/spi.h | 7 ++-
3 files changed, 114 insertions(+), 5 deletions(-)

--
2.17.1