Jetson TX1 - SPI Slave Mode

Hello,

the SPI slave mode is not working on my TX1.

I already activated the master mode with the guide http://elinux.org/Jetson/TX1_SPI and verifed it with a loopback test on the pin header J21.

The is my current device entry spi@7000d400:

spi@7000d400 {
                compatible = "nvidia,tegra210-spi";
                reg = <0x0 0x7000d400 0x0 0x200>;
                interrupts = <0x0 0x3b 0x4>;
                nvidia,dma-request-selector = <0x5d 0xf>;
                iommus = <0x46 0xe>;
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                dmas = <0x5d 0xf 0x5d 0xf>;
                dma-names = "rx", "tx";
                nvidia,clk-parents = "pll_p", "clk_m";
                status = "okay";

                prod-settings {

                        prod {
                                prod = <0x4 0xfffff000 0x0>;
                        };

                        prod_c_flash {
                                status = "disabled";
                                prod = <0x4 0xffffffc0 0x7>;
                        };

                        prod_c_loop {
                                status = "disabled";
                                prod = <0x4 0xfffff000 0x44b>;
                        };
                };

                spi0_0 {
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        compatible = "spidev";
                        reg = <0x0>;
                        spi-max-frequency = <20000000>;
                        nvidia,enable-hw-based-cs;
                        nvidia,cs-setup-clk-count = <0x1e>;
                        nvidia,cs-hold-clk-count = <0x1e>;
                        nvidia,rx-clk-tap-delay = <0x1f>;
                        nvidia,tx-clk-tap-delay = <0x0>;
                };
        };

Also, I activated SPI master mode on the J23 with the following device entry spi@7000d600. (Loopback worked, too)

spi@7000d600 {
                compatible = "nvidia,tegra210-spi";
                reg = <0x0 0x7000d600 0x0 0x200>;
                interrupts = <0x0 0x52 0x4>;
                nvidia,dma-request-selector = <0x5d 0x10>;
                iommus = <0x46 0xe>;
                #address-cells = <0x1>;
                #size-cells = <0x0>;
                dmas = <0x5d 0x10 0x5d 0x10>;
                dma-names = "rx", "tx";
                nvidia,clk-parents = "pll_p", "clk_m";
                status = "okay";

                prod-settings {
                        #prod-cells = <0x3>;

                        prod {
                                prod = <0x4 0x0 0x16>;
                        };

                        prod_c_flash {
                                status = "disabled";
                                prod = <0x4 0xffffffc0 0x6>;
                        };

                        prod_c_loop {
                                status = "disabled";
                                prod = <0x4 0xfffff000 0x44b>;
                        };
                };

                spi1_0 {
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        compatible = "spidev";
                        reg = <0x0>;
                        spi-max-frequency = <20000000>;
                        nvidia,enable-hw-based-cs;
                        nvidia,cs-setup-clk-count = <0x1e>;
                        nvidia,cs-hold-clk-count = <0x1e>;
                        nvidia,rx-clk-tap-delay = <0x1f>;
                        nvidia,tx-clk-tap-delay = <0x0>;
                };

“ls /dev” shows, that there are two nodes: spi0.0 and spi1.0.

Now i want to change the SPI mode on the J21 pin header (device tree entry spi@7000d400) to slave mode, but when i make the changes as stated in https://devtalk.nvidia.com/default/topic/982253/jetson-tx1/tx1-in-spi-slave-mode-to-an-adc-/post/5061002/#5061002, the node spi0.0 disappears. (Something that might be intereseting is that i can’t use references like &apbdma. When I want the recompile the dts, it says, that this reference is unknown.) I made several other changes in the device tree (as mentioned in this thread) but i doesn’t work.

Currently the TX1 runs L4T R24 REVISION 2.1.

Thanks in advance!

Do you try the change from below comment?

https://devtalk.nvidia.com/default/topic/982253/jetson-tx1/tx1-in-spi-slave-mode-to-an-adc-/post/5065928/#5065928

Yes, I tried, but no node appears… Maybe I made a mistake, I will double check it on monday, but I have little hope.

My thoughts were, that Post #8 would work (like it is written), but maybe there were changes in the meantime in L4T or something else and because of these it wouldn’t work for me.

I will update my post on monday. Thanks for your quick answer.

Hey ShaneCCC,

I double checked the modifications and made no progress. The nodes are still not showing. I’m wondering why the changes don’t work for me. In the meantime I changed my device tree back to the old state, where spidev0.0 and spidev 1.0 are both masters, which shows no problem. But as soon as I made the changes from post #8 from the thread, the “slave”-node disappears.

That’s weird, could you check the boot log if there’s any clue?

I used “dmesg | grep spi” and it shows me this:

[    0.000000] Lowering qspi maximum rate from 163200000 to 116600000
[    0.346084] PMC: IO pad spi voltage is 1800000
[    0.364206] PMC: IO pad spi-hv voltage is 1800000
[    1.557837] tegra210-pmc-iopower pmc-iopower.29: Rail iopower-spi is having fixed voltage 1800000
[    1.566677] tegra210-pmc-iopower pmc-iopower.29: Rail iopower-spi-hv is having fixed voltage 1800000
[    2.960066] spi-tegra114 7000da00.spi: /spi@7000da00/prod-settings has no reg property
[    2.970881] spi-tegra114 7000da00.spi: Static pin configuration used
[    2.978918] spi_master spi3: cannot find modalias for /spi@7000da00/prod-settings

I can’t find any clue there…

@Emme92
Could you try to enable the CONFIG_SPI_TEGRA114_SLAVE=y

Hey ShaneCCC,

unfortunately this is already enabled.

In the meantime I changed my setup and currently I went back using the TX1 as Master.

Maybe if I would reflash the TX1, the slave-mode would work, but I am now happy with the master-mode.