diff options
author | Krishna Yarlagadda <kyarlagadda@nvidia.com> | 2023-04-21 12:13:08 +0300 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2023-08-17 23:12:35 +0300 |
commit | a86a42ac2bd652fdc7836a9d880c306a2485c142 (patch) | |
tree | 6ca46fff277a3dbec71e47ebc210d3aa61d96e5b /drivers/char/tpm/tpm_tis_core.c | |
parent | 604b8e7558857814bf7c109bc651697129543383 (diff) | |
download | linux-a86a42ac2bd652fdc7836a9d880c306a2485c142.tar.xz |
tpm_tis_spi: Add hardware wait polling
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.
The current TPM TIS driver only supports software detection of the wait
signal. To support SPI controllers that use hardware to detect the wait
signal, add the function tpm_tis_spi_transfer_half() and move the
existing code for software based detection into a function called
tpm_tis_spi_transfer_full(). SPI controllers that only support
half-duplex transfers will always call tpm_tis_spi_transfer_half()
because they cannot support software based detection. The bit
SPI_TPM_HW_FLOW is set to indicate to the SPI controller that hardware
detection is required and it is the responsibility of the SPI controller
driver to determine if this is supported or not.
For hardware flow control, CMD-ADDR-DATA messages are combined into a
single message where as for software flow control exiting method of
CMD-ADDR in a message and DATA in another is followed.
[jarkko: Fixed the function names to match the code change, and the tag
in the short summary.]
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'drivers/char/tpm/tpm_tis_core.c')
0 files changed, 0 insertions, 0 deletions