Configure 40-pin Header gpio pins to SPI0 functions in device tree source

Hello All,

Need to configure the 40-pin Header Gpio pins to SPI0 functions in device tree source, not using the jetson-io tool.

Added like this:

pinmux@2430000 {

            40pin-spi-pinmux {

                    pin24 {
                            nvidia,lpdr = <0x0>;
                            nvidia,enable-input = <0x1>;
                            nvidia,tristate = <0x0>;
                            nvidia,pull = <0x2>;
                            nvidia,pins = "spi1_cs0_pz6";
                            nvidia,function = "spi1";
                    };

                    pin23 {
                            nvidia,lpdr = <0x0>;
                            nvidia,enable-input = <0x1>;
                            nvidia,tristate = <0x0>;
                            nvidia,pull = <0x1>;
                            nvidia,pins = "spi1_sck_pz3";
                            nvidia,function = "spi1";
                    };

                    pin21 {
                            nvidia,lpdr = <0x0>;
                            nvidia,enable-input = <0x1>;
                            nvidia,tristate = <0x0>;
                            nvidia,pull = <0x1>;
                            nvidia,pins = "spi1_miso_pz4";
                            nvidia,function = "spi1";
                    };
                    pin19 {
                            nvidia,lpdr = <0x0>;
                            nvidia,enable-input = <0x1>;
                            nvidia,tristate = <0x0>;
                            nvidia,pull = <0x1>;
                            nvidia,pins = "spi1_mosi_pz5";
                            nvidia,function = "spi1";
                    };

            };

    };

With this, spi loopback test using userspace device /dev/spidev0.0 is not working.
Using Jetson-io tool,spi loopback test is working.

Looking for the solutions to this.

The above device tree values are taken when jetson-io tool is used, i.e. this tool creates the device tree configurations. But the same configurations not working in device tree source.

-Thanks.

You’re going to have to show us the non working device tree, both the full pinmux@2430000 entry and the spi@3210000 entry.

You’re also going to have to describe the exact method you’re using to create the dtb.

You can check exactly what’s been loaded by doing dtc -I dtb -O dts -o /tmp/running.dts /sys/firmware/fdt and by examining the nodes in /sys/firmware/devicetree/base/…

Also check the kernel message to check if apply your dtb.

dmesg | grep -i kernel

Hello ShaneCCC,

For this, whether I need to change anything in GPIO controller section in device tree.
In device tree, I have done the two things:

  1. Pinmux settings
  2. SPI controller settings

Whether I need to change in Boot loader settings? Need the below details:
In high level, what are the things, need to change for this.

Please provide this information.

-Thanks.

I think you just need to confirm the 40pin-spi-pinmux context include in your DTB and been applied in system.

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