Hi,
I’m having a problem while trying to enable SLB9670 TPM module on Apalis iMX8 connected to SPI0.
I’ve enabled kernel modules: tpm, tpm_tis_core, tpm_tis_spi and chaged device tree as follows, but nothing happens during system startup (from dmesg log) and there is no tpm0 device in /dev. We also changed CS pin to GPIO4.
There I can see that it is changing two parameters:
compatible.
spi-max-frequency.
I see that you made more changes to your device tree. You can set the “status” without problems, but I am not sure about the “reg” value. Can you explain what you want to accomplish by that?
Looking at the datasheet of SLB9670, I could see that the maximum frequency for the SPI is 22.5 MHz using 1.8V (which is the voltage of iMX8 modules). So you can try to lower the frequency in your device tree to see if that works.
But without reg property I’m getting error in dmesg:
spi_master spi0: /bus@5a000000/spi@5a000000/tpm_tis@0 has no valid 'reg' property (-22)
spi_master spi0: Failed to create SPI device for /bus@5a000000/spi@5a000000/tpm_tis@0
So I put back “reg = <0>;” inside tpm_tis node. I’ve also tried different spi-max-frequency values (20 MHz, 1MHz, 500 kHz) but still no output from tpm_tis_spi module.
It seems right to me, I can’t see any errors that could be causing this problem.
Unfortunately, I don’t have this hardware to try it here. Can you check the TPM signals with an oscilloscope to check if it’s correct? Also, have you posted something on Infineon forums about this issue?
I haven’t tested TPM signals with an oscilloscope yet, but it seems that I’ve managed to get the module working.
First, I enabled the spidev node again, tried it out with wolfTPM library and it seemed to work well from the very beggining. So then, after doing some research and debugging on tpm_tis_spi library I’ve noticed that, despite getting a proper response from the module, the transfer function was somehow misinterpreting it. So I made a few changes to the way it sends and receives frames, recompiled tpm_tis_spi module, and now /dev/tpm0 is visible. I’ve also run some tests with tpm2-tss and tpm2-tools and everything seems to work well.
Nevertheless, I’m still wondering why I had to make such changes in order for the module to work, but as you mentioned - I guess it’s more like the question to post on Infineon forum. Anyway, thank you for your time and reply.