How To Enable SPI/SPIDev on L4T 32.2.0 ?


How to enable SPI/SPIDev on L4T 32.2.0 ? I think is not working anymore.

I can load the SPI module ($ sudo modprobe spidev) but I don’t see nothing on /dev/spi*


Hi Mauricio,

For J4.2 you don’t need to rebuild the kernel Image but must edit the dtc like the elinux tell like below.

Update The Device-Tree
Use your text editor of choice to update the DTS that we decompiled above:

 $ sudo gedit myTX2DeviceTreeSource.dts
Make the following patches:

    compatible = "nvidia,tegra186-spi";
    reg = <0x0 0x3240000 0x0 0x10000>;
    linux,phandle = <0x80>;
    spi@0 {
      compatible = "spidev";
      reg = <0x0>;
      spi-max-frequency = <0x1312D00>;
      nvidia,cs-setup-clk-count = <0x1e>;
      nvidia,cs-hold-clk-count = <0x1e>;
      nvidia,rx-clk-tap-delay = <0x1f>;
      nvidia,tx-clk-tap-delay = <0x0>;
Recompiling the Device Tree
Use DTC again to recompile the modifying DTS back into the new DTB:

 $ cd /boot/dtb/
 $ sudo dtc -I dts -O dtb -o tegra186-quill-p3310-1000-c03-00-base.dtb extracted_proc.dts
Enabling the New DTB
It's better flash the DTB by flash command instead of modify the extlinux due plugin manager will broken may cause unknow problem like break the network interface. Below is the command flash the DTB only.

 sudo ./ -r -k kernel-dtb jetson-tx2 mmcblk0p1

Also check below topics for reference.