Enabling and using SPI2 in Jetson Orin AGX

I want to enable the SPI2 of the Jetson Orin AGX located in the CSI connector.

I need that SPI working at 1.8V and I want to test its access through the spidev tools.

After many documentation, I’ve seen that the actual SPI I want to enable is the spi@c260000.

What I did is:

dtc -I dtb -O dts -o act_dts_2.dts /boot/dtb/kernel_tegra234-p3737-0000+p3701-0005-nv.dtb

Afterwards I modified the dts the following way:
spi@c260000 {
status = “okay”;

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

        spi@1 {
                            compatible = "tegra-spidev";
                            reg = <0x01>;
                            spi-max-frequency = <0x2faf080>;
        };

};

I compiled it back to dtb:

sudo dtc -I dts -O dtb -o dtb_2_09_04_test.dtb dts_2_09_04.dts

And overwritten the actual /boot/dtb/:

sudo cp dtb_2_09_04_test.dtb /boot/dtb/kernel_tegra234-p3737-0000+p3701-0005-nv.dtb

I’m not an expert on Device Tree, so my approach may be way off. Please let me know if that’s the case.
Even after doing that, the spi was still read as “disabled” when I read it through the command:

sudo cat /sys/firmware/devicetree/base/bus@0/spi@c260000/status | xxd

I used busybox to write the GPIOs with the required SPI2 configuration, but it didn’t change anything.
Also I was trying to read if the driver itself printed any errors, but nothing was seen:

sudo dmesg | grep spi

[ 9.195061] spi-tegra114 3210000.spi: Adding to iommu group 1
[ 9.204497] spi-tegra114 3230000.spi: Adding to iommu group 1

Is it possible to enable the driver without modifying the DTB??
How should I modify the DTS so it affects the Orin configuration??

Already fixed it, it seems I needed to change the /boot/extlinux/extlinux.conf in order to choose which DTB loaded.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.