imx8mq - ecspi2 on slb9670 TPM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mq - ecspi2 on slb9670 TPM

Jump to solution
2,328 Views
mike_foo
Contributor II

Hi,

I am attempting to interface infineon optiga slb9670 tpm2.0 to the imx8mq single board computer by compulab.

I am using kernel version with the tag : rel_imx_5.4.24_2.1.0

SPI channel: ecspi2

The optiga TPM is running successfuly on raspberrypi with the waveform capture below.

rpi-tpm-100mhz_sample-1.png

However, with the imx8mq board, i got the results as shown after enabling MOSI idle low (modifying spi-imx.c)

compulab-tpm-MOSI-idle-low.png

 

The TPM module is unable to respond without having some byte to byte nanosecond delay. I've tried the following:

1) adjusting burst mode into 8 bit (ended up having multiple 8 byte packet with 20uS apart, doesn't work)

2) enabling  periodreg by writing 0x08 (no changes)

3) utilize PIO mode instead of DMA (no changes)

Anybody can advise on this?

 

0 Kudos
1 Solution
2,237 Views
mike_foo
Contributor II

Alright, turns out to be, disabling sdma for both rx and tx makes it work. The following line in device tree need to be commented out:

 

//dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
//dma-names = "rx", "tx";

View solution in original post

0 Kudos
4 Replies
2,242 Views
mike_foo
Contributor II

 

Hi,

Turns out to be, there is a common ground issue between the sbc and the tpm module, i've make a dedicated ground connection between the board and TPM, and some SPI communication can goes on now. However, a new issue seems to be shown below from the dmesg log, any advice on this?

[ 31.851392] tpm_tis_spi spi1.0: 2.0 TPM (device-id 0x1B, rev-id 22)
[ 33.888659] spi_master spi1: I/O Error in DMA RX
[ 33.893324] tpm_tis_spi spi1.0: SPI transfer failed: -110
[ 33.898916] spi_master spi1: failed to transfer one message from queue
[ 33.906624] tpm tpm0: Error left over data
[ 33.910807] tpm tpm0: tpm_transmit: tpm_recv: error -5
[ 33.916216] tpm_tis_spi: probe of spi1.0 failed with error -5

0 Kudos
2,238 Views
mike_foo
Contributor II

Alright, turns out to be, disabling sdma for both rx and tx makes it work. The following line in device tree need to be commented out:

 

//dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
//dma-names = "rx", "tx";

0 Kudos
2,311 Views
igorpadykov
NXP Employee
NXP Employee

Hi mike_foo

 

reason may be that ecspi2 operating frequency is too fast in i.MX8MQ case,

one can try to decrease it.

 

Best regards
igor

0 Kudos
2,288 Views
mike_foo
Contributor II

Hi igor,

I've lowered down the operating frequency from 32mhz to 1mhz , and the response is still not what is expected. From the working raspberry pi example, I need to introduce byte to byte delay at the MOSI side, the byte shifted out from the imx8mq is too fast for the optiga tpm module.

0 Kudos