Hello, I am trying to integrate an Infineon TPM SLB9670 into an i.MX8MP system. The TPM is connected via ECSPI1 and is the only device on that bus. The Linux kernel is 5.4.188 through Yocto Dunfell. The TPM device driver fails to initialize. I added some printk's, and see that during tpm_tis_spi_probe(), it invokes tpm_tis_core_init(), an SPI transfer is started, and sometimes fails with error -110. This corresponds to an ETIMEOUT, and is caused by the spi transfer failing after 50 attempts. After that, the tpm_tis_core_init returns an error -19, and the TPM does not initialize:
[ 5.109788] tpm: tpm_tis_spi_probe
[ 5.109809] tpm: tpm_tis_spi_transfer start addr=0 len=1
[ 5.110840] tpm: tpm_tis_spi_transfer fin=-110
[ 5.110845] tpm: tpm_tis_spi_transfer start addr=8 len=4
[ 5.110934] tpm: tpm_tis_spi_transfer fin=0
[ 5.110936] tpm: tpm_tis_spi_transfer start addr=8 len=4
[ 5.111850] tpm: tpm_tis_spi_transfer fin=-110
[ 5.111853] tpm: tpm_tis_core_init returned -19
I added mod wire to the SS0 and clock lines and used an o-scope. It looks right (SS0 drops, there is a delay, and then the i.MX8 runs the clock, and then SS0 is released back up). Note that the SS0 is pulled-up by the NXP (see pin mux below).
I followed guidance in these forums and disabled the DMA in the .dtsi and can see that its no longer listed in the /sys/devicetree entries. I also dropped the clock - the iMX8 is using an 80MHz clock, the SLB9670 is powered by 1.8V, so it should run less than 25MHz, and the slowest possible clock is achieved with a pre-scalar of 7, so 11.4 MHz.
The Linux config (from /proc/config.gz):
root@imx8mplus:/tmp# grep TPM config
CONFIG_TCG_TPM=y
CONFIG_HW_RANDOM_TPM=y
# CONFIG_TCG_VTPM_PROXY is not set
# CONFIG_TCG_FTPM_TEE is not set
# CONFIG_MFD_STPMIC1 is not set
# CONFIG_PWM_IMX_TPM is not set
The TPM is connected via the ECSPI1 bus as shown:
There are three parts of the device tree:
imx8mp.dtsi:
imx8mp-product.dts
Have you check the signal MOSI and MISO?