Interface TPM 2.0 SLB9670 with IMX8M processor

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

Interface TPM 2.0 SLB9670 with IMX8M processor

4,875 Views
Jeevan
Contributor IV

Hello,

We are interfacing TPM2.0 SLB9670 with the IMX8M processor using SPI communication as shown in below schematic.

Jeevan_0-1645985240157.png

We have made the following ECSPI2 configurations for SPI communication in the device tree file and its working as we are able to see spidev1.0 when we use ls -l /dev/spidev* command in linux terminal of imx8m.

&ecspi2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
fsl,spi-num-chipselects = <1>;
cs-gpios = GP_ECSPI2_CS0;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

spidev@0 {
compatible = "spidev";
spi-max-frequency = <2000000>;
reg = <0>;
};
};

Similarly we have made the following ECSPI2 configurations for TPM SLB9670 chip in the device tree file but we are not able to see TPM being detected when we use ls -l /dev/tpm* command in linux terminal of imx8m.

&ecspi2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
fsl,spi-num-chipselects = <1>;
cs-gpios = GP_ECSPI2_CS0;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

tpm0: slb9670@0 {

                compatible = "infineon,slb9670";
                reg = <0>;
                resets = <&tpm_reset>;
                spi-max-frequency = <38000000>;
                interrupt-parent = <&gpio3>;
                interrupts = IRQ_TYPE_LEVEL_LOW>;
                status = "okay";

        };

};

Please suggest us some steps to make the TPM chip SLB9670 to detect in IMX8M processor

0 Kudos
Reply
4 Replies

4,745 Views
Jeevan
Contributor IV

Yes its already present in imx8m processor

Jeevan_0-1649148249899.png

 

0 Kudos
Reply

4,796 Views
AlfTeleco
Contributor III

Hello @Jeevan , 

We faced a problem quite similar some months ago. It turns out that the SPI kernel driver doesn't work as expected. The problem is that the iMX8 SPI HW module pulls up the CS signal as soon as no data remains in the output buffer and this, puts the slave ( SLB9670 ) in a non selected mode, thus no communication is possible. 

We solved the problem changing the CS signal used by the driver


Change your dts from this:

pinctrl-0 = <&pinctrl_ecspi2>;

cs-gpios = GP_ECSPI2_CS0;

to this: 

pinctrl-0 = <&pinctrl_ecspi3 &pinctrl_ecspi3_cs>;
cs-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>,
 
 
To sum up:
- Use a spare pin of your iMX8 to control de CS of the SLB9670. Letting the SPI kernel driver to do it is a bad idea.

Hope this helps
 

 

0 Kudos
Reply

4,802 Views
jimmychan
NXP TechSupport
NXP TechSupport

Is there a driver for SLB9670 in the kernel? Do you select it in the menuconfig?

0 Kudos
Reply

4,107 Views
AlfTeleco
Contributor III

Yes there is, it is named "tpm_tis_spi". 

You have to both select it in menuconfig and also place the device in the dtb. 

 

BR

0 Kudos
Reply