SPI1 on Xavier

I want to use SPI1 on header J30 to control a sensor. For that I want to enable spidev and use spidev_test.c to test it out.

I follow the steps listed across many forums (particularly this one: https://devtalk.nvidia.com/default/topic/1061177/jetson-agx-xavier/flashing-xavier-with-modified-device-tree/post/5375515/#5375515)
yet I when I try lsmod I don’t see spidev being used.

Here are the steps I followed:

  1. Download kernel sources using ./source_sync.sh and the tag tegra-l4t-r32.2.0
  2. I follow the steps from kernel customization chapter to build the kernel and flash the xavier.

I think the dtsi file I am modifying is incorrect, so which dtsi file do I modify to enable spidev? Every forum has different answers and so I am not sure which one to modify and where to put it?


Please modify below dtsi and you can use dtc to check if it been added.


Hi Shane,

I was able to get spidev1.0 to show up on the xavier. I modified the pinmux configuration using devmem2 on the xavier itself.
When I use spidev_test.c in order to test the Rx and Tx, I notice that the RX line does not receive anything despite connecting Rx and Tx. My oscilloscope supports this as well.

I have a couple of questions:

  1. Is SPI1 on header J30 supposed to be spidev0.0 instead of 1.0? if so, how do I enable that?
  2. Is there anything else I need to add to the dtsi in order for this to work?


SPI1 aka spi@c260000 add the necessary like SPI4.

J30 connector pins for SPI are:
SPI_CLK - Pin 23 connected to ball/pin J57
SPI_MISO - Pin 21 connected to ball/pin A56
SPI_MOSI- Pin 19 connected to ball/pin D55
SPI_CS0 - Pin 24 connected to ball/pin E55
SPI_CS1 - Pin 26 connected to ball/pin B56
This is according to pinmux excel sheet, so I assume that this is the SPI1 controller on Xavier SoC which actually is the SPI@3210000 not the c260000, am I right?

Right, the pinmux is the SPI1_xx and map to software spi0 aka SPI@3210000

Thanks Shane. I was able to run spidev0.0 effectively by adding the following to the dtsi file you mentioned:

spi@3210000 {
        status = "okay";
        spidev@0 {
            compatible = "spidev";
            reg = <0>;