SPI Bus Device Numbers

Hello,

I am trying to determine what SPI bus is what on the TX2. The reason I ask is because the hardware schematic naming and the device alias in the device tree does not match.

For example, via a tutorial (https://devtalk.nvidia.com/default/topic/1024806/jetson-tx2/how-to-enable-spi-spidev-on-28-1-on-target-/) I was able to confirm that the device tree alias spi3 is labeled SPI1 in the hardware schematic.

Also, looking at the device tree, it appears that spi1 is the touchscreen SPI connection, which is SPI0 in the hardware schematic.

So that leaves me wondering whether the device tree alias spi0 (aka.spi@3210000) or spi2 (aka. spi@3230000) is SPI2 on the hardware schematic. Which one of these buses is running to the Display (CS0) and Camera (CS1)?

Thanks in advance for the help.

@dwd_pete
You can check the pinmux table to figure it out. like you say the SPI1_xxx is HW pin map to SPI4_xxx, and SPI4_xxx is bus spi(4-1)

Sorry, I’m looking through the pinmux and I’m even more lost. Looking through it, it does not appear to follow the mapping I already know about (also, I’m probably not reading it correctly).

Let me restate my question. Note that I am referencing Section 12.2 (namely Figure 31) of the OEM Design Guide. I know that SPI0 (the touch screen) is aliased as spi1 in the device tree and shows up in Linux as this device name. I also know (from testing) that SPI1 (J21) is spi3 in Linux (because why would it be sane and follow the same numbering?).

Via a trick I call “the process of elimination”, this leaves two possible device names from the device tree that could be the SPI2 bus (spi0 and spi2). By default, in the device tree, spi0 (aka.spi@3210000) is enabled, but spi2 (aka.spi@3230000) is not.

As a result, my question/confusion remains… in the device tree, what is hardware schematic “SPI2”? Is it spi@3210000 (spi0) or spi@3230000 (spi2)?

Here;s what I have on my TX2:

spi0 = "/spi@3210000";
spi1 = "/spi@c260000";
spi2 = "/spi@3230000";
spi3 = "/spi@3240000";
spi4 = "/aon_spi@c260000";
qspi6 = "/spi@3270000";

-albertr

You misunderstood my question… my point is that “spi3” in the device tree is labeled “SPI1” in the hardware schematics (the hardware documentation does NOT match the device tree!). I am trying to interface with whatever bus is labeled “SPI2” in the hardware schematics, which based on my research will either be “spi0” or spi2" in the device tree.

You can see the SPI2_xxx is map to SPI1_xxx as I said in early comment. The you can know it’s map to spi0, spi@32100000 in the device tree.

Sorry, I’m not following.

I see from the pinmux that SPI2_xxx is mapped to SPI1_xxx, like you said. However, how am I supposed to know that this is “spi@3210000”? Is this because there is a “1” in “spi@3210000”?

Right, as below your mention the spi in device tree is start from 0 however the pimux is start from 1.

spi0 = "/spi@3210000";
spi1 = "/spi@c260000";
spi2 = "/spi@3230000";
spi3 = "/spi@3240000";
spi4 = "/aon_spi@c260000";
qspi6 = "/spi@3270000";