JP6 - SPI3 (/dev/spidev2.0) is not showing up after setting up overlay

I created an overlay to setup all the 40 pin header settings just as I had with 5.1.2. I have verified it is loading with OVERLAYS, but no matter what I do it doesn’t seem to be actually setting up spi3 (or I2s either).

Any idea what I am doing wrong? This has worked on Orin 5.1.2, Xaver, Jetson Nano doing it this way (with help of Jetson_io.py)

// Content of my-overlay.dts
/dts-v1/;
/plugin/;

/ {
    overlay-name = "Jetson Overlay";
    jetson-header-name = "Jetson 40pin Header";
    compatible = "nvidia,p3768-0000+p3767-0005";

    fragment@0 {
        target = <&pinmux>;

        __overlay__ {
           pinctrl-names = "default";
           pinctrl-0 = <&jetson_io_pinmux>;

           jetson_io_pinmux: exp-header-pinmux {

			hdr40-pin33 {
				nvidia,enable-input = <0x00>;
				nvidia,tristate = <0x00>;
				nvidia,function = "gp";
				nvidia,pins = "soc_gpio21_ph0";
			};

			hdr40-pin40 {
				nvidia,enable-input = <0x00>;
				nvidia,tristate = <0x00>;
				nvidia,function = "i2s2";
				nvidia,pins = "soc_gpio42_pi0";
			};

			hdr40-pin38 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x01>;
				nvidia,function = "i2s2";
				nvidia,pins = "soc_gpio43_pi1";
			};

			hdr40-pin37 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi3";
				nvidia,pins = "spi3_mosi_py2";
			};


			hdr40-pin35 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "i2s2";
				nvidia,pins = "soc_gpio44_pi2";
			};
		
			hdr40-pin26 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi1";
				nvidia,pins = "spi1_cs1_pz7";
			};

			hdr40-pin24 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi1";
				nvidia,pins = "spi1_cs0_pz6";
			};

			hdr40-pin23 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi1";
				nvidia,pins = "spi1_sck_pz3";
			};

			hdr40-pin22 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi3";
				nvidia,pins = "spi3_miso_py1";
			};

			hdr40-pin21 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi1";
				nvidia,pins = "spi1_miso_pz4";
			};

			hdr40-pin19 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi1";
				nvidia,pins = "spi1_mosi_pz5";
			};

			hdr40-pin18 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi3";
				nvidia,pins = "spi3_cs0_py3";
			};

			hdr40-pin16 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi3";
				nvidia,pins = "spi3_cs1_py4";
			};


			hdr40-pin13 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "spi3";
				nvidia,pins = "spi3_sck_py0";
			};

			hdr40-pin12 {
				nvidia,enable-input = <0x01>;
				nvidia,tristate = <0x00>;
				nvidia,function = "i2s2";
				nvidia,pins = "soc_gpio41_ph7";
			};


			hdr40-pin7 {
				nvidia,enable-input = <0x00>;
				nvidia,tristate = <0x00>;
				nvidia,function = "aud";
				nvidia,pins = "soc_gpio59_pac6";
			};
            };
        };
    };
};

Hi enc0der,

Are you using the devkit or custom board for Orin Nano?
What’s your current Jetpack release? (JP6.x?)

Your current overlay is used to configure the pinmux through pinctrl-tegra driver in kernel.
You have to load the driver to get the device node probed/appears.

$ sudo modprobe spidev

This is a custom board that I built to match the setup of the devkit. We used this same board with 5.1.2 using jetson_oi.py to generate the pinmux settings for the hdr40 and it worked no problem. Was trying to replicated with 6.0 (I’ve asked @anomad to verify the version)

I tried doing ‘sudo mod probe spidev’ before creating this topic. I did not see spidev2.0, 2.1 show up in /dev when I did that.

So far, none of the settings are taking. (I2S is not working, general purpose IO not working, PWM pin not working) all setup in the HDR section.

Built from JetPack6.1 -

 cat /etc/nv_tegra_release
# R36 (release), REVISION: 4.0, GCID: 37537400, BOARD: generic, EABI: aarch64, DATE: Fri Sep 13 04:36:44 UTC 2024
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
modprobe spidev
ls -la /dev/spi*
crw-rw---- 1 root gpio 153, 1 Dec 31  1969 /dev/spidev0.0
crw-rw---- 1 root gpio 153, 0 Dec 31  1969 /dev/spidev0.1
crw-rw---- 1 root gpio 153, 3 Dec 31  1969 /dev/spidev1.0
crw-rw---- 1 root gpio 153, 2 Dec 31  1969 /dev/spidev1.1

depmod -a
lsmod | grep spi
spidev                 28672  0
spi_tegra114           28672  0

For the custom carrier board, jetson-io tool may not work since there might be custom design we don’t know.
We would suggest contacting your vendor for the steps to configure them in pinmux spreadsheet.

Please check the dmesg for any error when you run the command to load the driver.

We do not see any errors. This is right after reboot :

root@orinhd:~# dmesg -c | grep spi
[   10.895895] spi-tegra114 3210000.spi: Adding to iommu group 1
[   10.929756] spi-tegra114 3230000.spi: Adding to iommu group 1
root@orinhd:~# modprobe spidev
root@orinhd:~# dmesg
root@orinhd:~#

@KevinFFF I designed the board myself and had it made. Please reread what I said above.

1- I used the same setup as the dev board for these interfaces.
2- I used this EXACT SAME BOARD with 5.1.2 and using jetson-io tool worked. It was when we switched to JP6.1 that all of a sudden it is not working and we do not understand why.

If your pin definitions are exactly same as the devkit board, you could use Jetson-IO to configure the pinmux.

Please share the detailed steps how did you use Jetson-IO tool to enable SPI and the full dmesg for further check.
I would also like to check the /boot/extlinux/extlinux.conf on your board.

In addition, do you have the Orin Nano devkit board for comparison?

We did use the Jetson-IO to configure the pinmux. We have tried it multiple ways with JP6.1 and are seeing the same results.

We had the tool generate the dtbo where we enabled everything we wanted active. We let the tool put the OVERLAYS line into the extlinx.conf. We also pulled the active device tree and referenced with FDT as we ran into in 5.1.2 that if you want to use an overlay, you cannot pull the main device tree from flash.

This works on the exact same hardware with 5.1.2 using the same method. So something has changed in JP6.1 but we are not sure what. Once the system is booted, we can write out the system DTB in use and see all the pinmux settings, but it’s not using it. Given it seems to be ignoring all our settings, is there something specific we should be searching for in the dmessg output? I don’t think we are even to the point of it trying to setup spi2 because NONE of the pin functions are working that we have enabled (I2S, SPI, GPIO, PWM). So the problem is more fundamental.

What I am showing above is from another test of trying to get it to work using the mythology someone else had for creating their own overlay for the orin agx using JP6.0. But, the results are the same, nothing is showing up.

how to control gpio in hp6

Again, I want to repeat, with 5.1.2 on this same Orin SoC on this same board, I used Jetson_io to get all this to work. The ONLY thing we did was rebuilt with 6.1 and flash. Then I tried to go through the same procedure and it didn’t work.

When I compared the DTB for the 5.1.2 and 6.1 I do notice a lot of differences. For instance, I see like 7 SPI ports defined in 5.1.2 (sections that setup the ports) but in the JP6.1 version, I only see 2. It seems to me that maybe some portions of the flashed DTB when we built the OS are missing sections for the HDR functionality. If that is the case, how do we ensure those all get added to the DTB initially?

I’ll let @anomad talk about the process in setting up the build to flash and write the OS. Maybe there is a step we need to add to make sure we can support HDR that is not on by default in JP6.1?

Files requested:

orin_dmesg.txt (97.0 KB)
extinux.conf.txt (1.6 KB)

So I’ve been digging deeper and I don’t see the pinmux showing up, only the new aon one that was not in 5.1.2:

sudo ls /sys/kernel/debug/pinctrl
c300000.pinmux	c360000.pmc  pinctrl-devices  pinctrl-handles  pinctrl-maps

In 5.1.2 I would use this to look tat the pinmux settings to verify:
sudo cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinmux-pins

But, as I said, that is not there.

Oh, now I see a clue! This is in dmesg:

[ 0.075040] tegra234-pinctrl 2430000.pinmux: can’t request region for resource [mem 0x0c300000-0x0c303fff]
[ 0.075048] tegra234-pinctrl: probe of 2430000.pinmux failed with error -16

I discovered the issue for this, it was the reg setting, it needs to be this because _aon pinmux is taking some of the address space now:

reg = <0x00 0x2430000 0x00 0x19100>;

This means this is back:

sudo cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinmux-pins

So now I actually see the settings showing up:

pin 122 (SPI3_SCK_PY0): 2430000.pinmux (GPIO UNCLAIMED) (HOG) function spi3 group spi3_sck_py0
pin 123 (SPI3_MISO_PY1): 2430000.pinmux (GPIO UNCLAIMED) (HOG) function spi3 group spi3_miso_py1
pin 124 (SPI3_MOSI_PY2): 2430000.pinmux (GPIO UNCLAIMED) (HOG) function spi3 group spi3_mosi_py2
pin 125 (SPI3_CS0_PY3): 2430000.pinmux (GPIO UNCLAIMED) (HOG) function spi3 group spi3_cs0_py3
pin 126 (SPI3_CS1_PY4): 2430000.pinmux (GPIO UNCLAIMED) (HOG) function spi3 group spi3_cs1_py4

Which is what I would expect, but doing this:

sudo modprobe spidev

Does not add /dev/spidev2.x

Your extlinux.conf looks good to me that it would use /boot/dtb/clean_device_tree.dtb as device tree and /boot/sthd_overlay.dtbo as overlay.

I do see the following lines in your dmesg.

[   12.338030] spi-tegra114 3210000.spi: Adding to iommu group 1
..
[   12.416632] spi-tegra114 3230000.spi: Adding to iommu group 1

Are you looking for 3230000.spi?

Please share the result of the following command on your board.

$ ls -l /dev/spi*
root@orinhd:~# ls -l /dev/spi*
crw-rw---- 1 root gpio 153, 1 Dec 31  1969 /dev/spidev0.0
crw-rw---- 1 root gpio 153, 0 Dec 31  1969 /dev/spidev0.1
crw-rw---- 1 root gpio 153, 3 Dec 31  1969 /dev/spidev1.0
crw-rw---- 1 root gpio 153, 2 Dec 31  1969 /dev/spidev1.1

These 2 nodes come from 3230000.spi.
I think it is what you need.

Ahhh, okay. I think what must have happened is some other spi is not active anymore and it changed the numbers. I see that mapping makes sense. Thanks for helping with this.