Skip to contentSkip to conversation

tpm: SLM9670 does not work on T1023

DISCUSSION Alexander Wilhelm 3 participants 7 messages Sep 11, 2025 – Sep 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello devs,

I'm trying to bring up the SLM9670 TPM 2.0 device connected via SPI on a QorIQ T1023-based board. Pin control is fully configured through the RCW, so I haven't added any additional properties in the device tree. The SPI controller accesses the TPM using #CS0.

However, the driver reads an incorrect vendor ID (0x1000000) and hangs during the startup sequence. A logic analyzer shows that the chip select line goes high immediately after transmitting 4 bytes, which, according to various forum discussions, does not comply with the TPM specification. Unfortunately, I haven't found a definitive solution to this issue.

Could this be a bug in the spi-fsl-espi driver, or is it possibly a hardware limitation of the T1023? I've come across some suggestions that involve using a GPIO as an alternative chip select instead of the one provided by the SPI controller. Can anyone confirm whether this workaround is viable? I’d prefer to avoid a PCB redesign unless it's absolutely necessary.

Best regards
Alexander Wilhelm

maintainer
#1 lore raw
Quoted 5 lines · Alexander Wilhelm

However, the driver reads an incorrect vendor ID (0x1000000) and hangs during the startup sequence. A logic analyzer shows that the chip select line goes high immediately after transmitting 4 bytes, which, according to various forum discussions, does not comply with the TPM specification. Unfortunately, I haven't found a definitive solution to this issue.

That sounds like the controller is configured in word mode and is bouncing chip select after every word it sends. The Freescale controllers are fond of implementing and using that, no idea about this specific one. I see there's some non-standard DT properties it has which look like they're related to chip select modes but no idea what they do.

Quoted 5 lines

Could this be a bug in the spi-fsl-espi driver, or is it possibly a hardware limitation of the T1023? I've come across some suggestions that involve using a GPIO as an alternative chip select instead of the one provided by the SPI controller. Can anyone confirm whether this workaround is viable? I’d prefer to avoid a PCB redesign unless it's absolutely necessary.

Can you not pinmux the signal from the SoC to a GPIO instead of the SPI controller? It's fairly common to do that since controllers often have regrettably limited or unhelpful chip select features so GPIOs are often the better choice. The controller does what it likes with the chip select signal but it's not actually connected to anything and we do everything in software.

I'd recommend contacting whoever looks after the relevant controller driver, though it looks rather abandoned TBH.

#2 lore raw
Quoted 8 lines · Mark Brown
Quoted 5 lines · Alexander Wilhelm

However, the driver reads an incorrect vendor ID (0x1000000) and hangs during the startup sequence. A logic analyzer shows that the chip select line goes high immediately after transmitting 4 bytes, which, according to various forum discussions, does not comply with the TPM specification. Unfortunately, I haven't found a definitive solution to this issue.

Quoted 6 lines

That sounds like the controller is configured in word mode and is bouncing chip select after every word it sends. The Freescale controllers are fond of implementing and using that, no idea about this specific one. I see there's some non-standard DT properties it has which look like they're related to chip select modes but no idea what they do.

Which DT properties are you referring to? I’ve only used the default ones provided by the QorIQ DTS files in the kernel.

Quoted 6 lines
Quoted 5 lines

Could this be a bug in the spi-fsl-espi driver, or is it possibly a hardware limitation of the T1023? I've come across some suggestions that involve using a GPIO as an alternative chip select instead of the one provided by the SPI controller. Can anyone confirm whether this workaround is viable? I’d prefer to avoid a PCB redesign unless it's absolutely necessary.

Quoted 6 lines

Can you not pinmux the signal from the SoC to a GPIO instead of the SPI controller? It's fairly common to do that since controllers often have regrettably limited or unhelpful chip select features so GPIOs are often the better choice. The controller does what it likes with the chip select signal but it's not actually connected to anything and we do everything in software.

The problem here is that RCW allows either both enabled SPI + CS or disabled SPI and CS-pins set to GPIO. Furthermore it is unfortunatelly connected, so I cannot simple cut the path on PCB and need a more complicated re-design of it.

The issue here is that the RCW configuration either enables both SPI and CS together, or disables SPI and sets the CS pins to GPIO. Unfortunately, the PCB traces are laid out in a way that prevents me from simply cutting the connection. A more complex redesign would be required.

Quoted 2 lines

I'd recommend contacting whoever looks after the relevant controller driver, though it looks rather abandoned TBH.

Hopefully, someone with experience in this kind of setup will respond via the mailing list.

Best regards
Alexander Wilhelm

maintainer
#3 lore raw
Quoted 11 lines · Alexander Wilhelm
Quoted 6 lines · Mark Brown

That sounds like the controller is configured in word mode and is bouncing chip select after every word it sends. The Freescale controllers are fond of implementing and using that, no idea about this specific one. I see there's some non-standard DT properties it has which look like they're related to chip select modes but no idea what they do.

Which DT properties are you referring to? I’ve only used the default ones provided by the QorIQ DTS files in the kernel.

The various "fsl," ones the driver reads. Though now I grep for docs they seem timing related and irrelevant :/ . You could also look at the datasheet and see if you can fix the configuration in the driver for this case, possibly there might be some performance overhead if it's possible.

Quoted 10 lines
Quoted 6 lines

Can you not pinmux the signal from the SoC to a GPIO instead of the SPI controller? It's fairly common to do that since controllers often have regrettably limited or unhelpful chip select features so GPIOs are often the better choice. The controller does what it likes with the chip select signal but it's not actually connected to anything and we do everything in software.

The problem here is that RCW allows either both enabled SPI + CS or disabled SPI and CS-pins set to GPIO. Furthermore it is unfortunatelly connected, so I cannot simple cut the path on PCB and need a more complicated re-design of it.

Oh, well - that's unfortunate pinmuxing. Glad to see innovation!

Quoted 5 lines
Quoted 2 lines

I'd recommend contacting whoever looks after the relevant controller driver, though it looks rather abandoned TBH.

Hopefully, someone with experience in this kind of setup will respond via the mailing list.

I'd try to explicitly CC people in TBH.

maintainer
#4 lore raw
In reply to Alexander Wilhelm
Quoted 7 lines · Alexander Wilhelm

Hello devs,

I'm trying to bring up the SLM9670 TPM 2.0 device connected via SPI on a QorIQ T1023-based board. Pin control is fully configured through the RCW, so I haven't added any additional properties in the device tree. The SPI controller accesses the TPM using #CS0.

Quoted 5 lines

However, the driver reads an incorrect vendor ID (0x1000000) and hangs during the startup sequence. A logic analyzer shows that the chip select line goes high immediately after transmitting 4 bytes, which, according to various forum discussions, does not comply with the TPM specification. Unfortunately, I haven't found a definitive solution to this issue.

So, at least the vendor ID is bogus meaning that TPM driver is doing right thing.

Quoted 6 lines

Could this be a bug in the spi-fsl-espi driver, or is it possibly a hardware limitation of the T1023? I've come across some suggestions that involve using a GPIO as an alternative chip select instead of the one provided by the SPI controller. Can anyone confirm whether this workaround is viable? I’d prefer to avoid a PCB redesign unless it's absolutely necessary.

My first guess would be that the firmware inside TPM actually does throw a broken vendor ID but it is exactly a guess :-)

I'll follow this, and please cc me also to future threads but right now I'm clueless.

Quoted 4 lines

Best regards
Alexander Wilhelm

BR, Jarkko

maintainer
#5 lore raw
Quoted 18 lines · Jarkko Sakkinen
Quoted 7 lines · Alexander Wilhelm

Hello devs,

I'm trying to bring up the SLM9670 TPM 2.0 device connected via SPI on a QorIQ T1023-based board. Pin control is fully configured through the RCW, so I haven't added any additional properties in the device tree. The SPI controller accesses the TPM using #CS0.

Quoted 5 lines

However, the driver reads an incorrect vendor ID (0x1000000) and hangs during the startup sequence. A logic analyzer shows that the chip select line goes high immediately after transmitting 4 bytes, which, according to various forum discussions, does not comply with the TPM specification. Unfortunately, I haven't found a definitive solution to this issue.

So, at least the vendor ID is bogus meaning that TPM driver is doing right thing.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines

Could this be a bug in the spi-fsl-espi driver, or is it possibly a hardware limitation of the T1023? I've come across some suggestions that involve using a GPIO as an alternative chip select instead of the one provided by the SPI controller. Can anyone confirm whether this workaround is viable? I’d prefer to avoid a PCB redesign unless it's absolutely necessary.

My first guess would be that the firmware inside TPM actually does throw a broken vendor ID but it is exactly a guess :-)

Ugh, no. Probably it is device tree given false data. I recall we have some ways to override device tree, so find the data sheet for the TPM and rewrite the ids I suppose.

BR, Jarkko

#6 lore raw
In reply to Jarkko Sakkinen
Quoted 8 lines · Jarkko Sakkinen
Quoted 7 lines · Alexander Wilhelm

Hello devs,

I'm trying to bring up the SLM9670 TPM 2.0 device connected via SPI on a QorIQ T1023-based board. Pin control is fully configured through the RCW, so I haven't added any additional properties in the device tree. The SPI controller accesses the TPM using #CS0.

Quoted 8 lines
Quoted 5 lines

However, the driver reads an incorrect vendor ID (0x1000000) and hangs during the startup sequence. A logic analyzer shows that the chip select line goes high immediately after transmitting 4 bytes, which, according to various forum discussions, does not comply with the TPM specification. Unfortunately, I haven't found a definitive solution to this issue.

So, at least the vendor ID is bogus meaning that TPM driver is doing right thing.

I think so. When the first transmission occurs, the TPM sets the very last bit to 1. This seems to be some kind of acknowledgment flag. So when I output a 32-bit value, it appears as 0x01000000. After that, the chip select (#CS) line goes high. In the next read operation, nothing is written, but the TPM again returns 0x01000000. This doesn’t look like an incorrect Vendor ID, but rather another acknowledgment flag.

I’ve looked into the TPM driver code, and it uses a cs_change flag to indicate that chip select should remain active after the last transmission. Some SPI driver implementations, like spi-fsl-dspi, use this flag to configure additional registers. However, spi-fsl-espi I'm using does not use this flag at all, not in a single line of code. I believe this might be the root of the issue. By the way, the same TPM works flawlessly on an x86 platform, which uses a different SPI controller.

I was considering using an alternative GPIO for chip select. But if the code doesn’t make use of cs_change anyway, that probably wouldn’t help, right?

Quoted 11 lines
Quoted 5 lines

Could this be a bug in the spi-fsl-espi driver, or is it possibly a hardware limitation of the T1023? I've come across some suggestions that involve using a GPIO as an alternative chip select instead of the one provided by the SPI controller. Can anyone confirm whether this workaround is viable? I’d prefer to avoid a PCB redesign unless it's absolutely necessary.

My first guess would be that the firmware inside TPM actually does throw a broken vendor ID but it is exactly a guess :-)

I'll follow this, and please cc me also to future threads but right now I'm clueless.

Sure, you've been on CC since the very first message.

Best regards
Alexander Wilhelm