SPI3 issue

Hi,

We are trying to use SPI3 to bring up TPM module

Here is the pinmux setting I’m using

spi3_sck_py0 {
nvidia,pins = “spi3_sck_py0”;
nvidia,function = “spi3”;
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

                    spi3_miso_py1 {
                            nvidia,pins = "spi3_miso_py1";
                            nvidia,function = "spi3";
                            nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                            nvidia,tristate = <TEGRA_PIN_ENABLE>;
                            nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                            nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                            nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                    };

                    spi3_mosi_py2 {
                            nvidia,pins = "spi3_mosi_py2";
                            nvidia,function = "spi3";
                            nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                            nvidia,tristate = <TEGRA_PIN_DISABLE>;
                            nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                            nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                            nvidia,lpdr = <TEGRA_PIN_DISABLE>;
                    };

                    spi3_cs0_py3 {
                            nvidia,pins = "spi3_cs0_py3";
                            nvidia,function = "spi3";
                            nvidia,pull = <TEGRA_PIN_PULL_UP>;
                            nvidia,tristate = <TEGRA_PIN_DISABLE>;
                            nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                            nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
                            nvidia,lpdr = <TEGRA_PIN_DISABLE>;

and the dtb is as follow

after modprobe the spi1 CS0 bind correctly

but TPM show timeout

after using scope, turn out the CS0 has no signal after loading module

how can I debug this

Thanks

Kevin

hello kevintseng83,

may I know which Jetpack public release verison you’re using?
could you please dump the device tree settings for quick checking.
for instance, $ sudo dtc -I fs -O dts /sys/firmware/devicetree/base > /tmp/123.dts

Hi, Jerry

We are using JetPack 6.2 36.4.3

here is the dump file

123.txt (396.1 KB)

Kevin

hello kevintseng83,

BTW, per your issue description,
TPM module works normally by switching to SPI1, this is only happened with SPI3?

Hi Jerry

Yes, spi1 can bring up TPM normally.

Kevin

Hi kevintseng83,

Have you also verified SPI loopback test for SPI3 before connecting with TPM?

Do you mean there’s no driver probe issue for SPI1 but still the TPM timeout issue?

From this device tree you captured, I don’t see any node has been configured for TPM (i.e. no any node handles for tcg,tpm_tis-spi)

Hi ,Kevin

  1. No we didn’t do the loopback test because with think the root cause could be CS pin not triggering, but we can check that too
  2. I think timeout issue is the driver probe issue, cs-gpios is configured before tpm node so I think kernel use spi driver first and gpioinfo can show it bind with PY.03 pin correctly, but after that, tpm driver come in and show timeout error

image

  1. Sorry, I forgot I flash this SOM for other testing, here is the correct dtb

    123.txt (396.5 KB)

Yes, I would suggest you verifying SPI loopback test before connecting SPI device like TPM.

For the driver probe issue, please add more debug message in the driver to find the cause.
Normally, it may be caused from the wrong configuration in device tree.

			spi@0 {
				spi-max-frequency = <0x2faf080>;
				compatible = "tcg,tpm_tis-spi";
				reg = <0x00>;
			};

You may be missing some configuration for TPM like the interrupt.

Hello! We can also consider using SecEdge SEC-TPM, which is an implementation of the NVIDIA fTPM . The document is here: SEC-TPM™ - SecEdge