We recently upgraded Xavier AGX from Jetpack 4.6 to 5.0.2 or even 5.1
Among them, the function of SPI TPM has been able to work normally in Jetpack 4.6.
However, when we upgraded to 5.0.2, we found that the TPM, which was working normally, could not be initialized.
We have confirmed the status of the Pinmux spi register with busybox, and also confirmed that the SPI pins are not occupied by other devices in the Device Tree.
By measuring the SPI pin signal and comparing the status of Jetpack 4.6.0, we found that the problem lies in cs-gpios, and we came to the following conclusions.
In SPI Device Tree, we have two ways to set cs-gpio, and the two cannot coexist.
spidev defaults to using enable-hw-based-cs to control cs, but using enable-hw-based-cs in TPM will cause problems
The picture below is the waveform generated by the spi pin when Jetpack 4.6.0 uses two different settings alternately in the device tree.
- Use “enable-hw-based-cs” to try the SPI waveform of initial TPM:
- Use “cs-gpios” to try the SPI waveform of initial TPM:
We force return -1 to return after tpm_tis_core.ko executes the first spi action, so as to observe the different SPI waveforms when the Device Tree is set differently.
Please observe the blue CS pin waveform.
When enable-hw-based-cs is used, cs will be pulled up in the middle of two clks until the next clk is sent.
When using cs-gpios, the low potential of the cs pin will be maintained until the two clk executions are completed before being pulled up.
We have inquired about the window of the Infineon TPM, and determined that the action of cs-gpios is in line with the behavior of the TPM. Enable-hw-based-cs pulls up the cs too early, causing the TPM to not act normally.
However, now when we upgrade Xavier AGX to Jetpack 5.0.2, we found that if “cs-gpios” is set in Device Tree, the cs pin sent by spi will not have any action, and it will keep pulling High.
When we change the setting to “enable-hw-based-cs”, the cs pin has an action, and it will pull low when clk is sent, but just like the conclusion just now, the cs pin of “enable-hw-based-cs” The behavior cannot be initial TPM Chip, we have confirmed this with an oscilloscope.
We have read the documentation about cs-gpios settings in Jetpack 5.0.2, and according to my understanding, there should be no change in usage.
I even tried to upgrade Xavier AGX to Jetpack version 5.1, the situation is the same, set cs-gpios, the cs pin can’t work at all.
We also have the Orin AGX module on hand and have the same problem when using the SPI TPM, so I don’t think it’s a problem with SOM or Xavier AGX alone.
Does the function of cs-gpios change in Jetpack 5.0.2 or above, does the setting method change? Or do I need to set it up in another way?
Does anyone have any suggestion or method?