Spi dts modifications

I modify the spi to the following into “myspi”, the driver probes ok but I can not see spi waveform on SPI0 in 40 pinmux (the below default comment about 40 pin should be wrong? should be SPI0/SPI1 ?)

After building the dtb file under kernel_out, I copy it to /boot/kernel_…dtb and /boot/dtb/kernel…dtb, then reboot and insmod my ko to test it

spi@3210000{ /* SPI1 in 40 pin conn */
	status = "okay";
	/* spi@0 { /1* chip select 0 *1/ */
	/* 	compatible = "tegra-spidev"; */
	/* 	reg = <0x0>; */
	/* 	spi-max-frequency = <50000000>; */
	/* 	controller-data { */
	/* 		nvidia,enable-hw-based-cs; */
	/* 		nvidia,rx-clk-tap-delay = <0x10>; */
	/* 		nvidia,tx-clk-tap-delay = <0x0>; */
	/* 	}; */
	/* }; */
	myspi@0 { /* chip select 0 */
		status = "okay";
		compatible = "myspidev";
		reg = <0x0>;
		spi-max-frequency = <50000000>;
	};
	spi@1 { /* chip select 1 */
		compatible = "tegra-spidev";
		reg = <0x1>;
		spi-max-frequency = <50000000>;
		controller-data {
			nvidia,enable-hw-based-cs;
			nvidia,rx-clk-tap-delay = <0x10>;
			nvidia,tx-clk-tap-delay = <0x0>;
		};
	};
};

spi@3230000{ /* SPI3 in 40 pin conn */
	status = "okay";
	spi@0 { /* chip select 0 */
		compatible = "tegra-spidev";
		reg = <0x0>;
		spi-max-frequency = <50000000>;
		controller-data {
			nvidia,enable-hw-based-cs;
			nvidia,rx-clk-tap-delay = <0x10>;
			nvidia,tx-clk-tap-delay = <0x0>;
		};
	};
	spi@1 { /* chips select 1 */
		compatible = "tegra-spidev";
		reg = <0x1>;
		spi-max-frequency = <50000000>;
		controller-data {
			nvidia,enable-hw-based-cs;
			nvidia,rx-clk-tap-delay = <0x10>;
			nvidia,tx-clk-tap-delay = <0x0>;
		};
	};
};

Hi lykaio1203,

Are you using the devkit or custom board for Orin Nano?

Have you also configured the pinmux to enable SPI0?

Could you share the dmesg after you insert your kernel module?

Hello Kevin,

I’m using the devkit which has 40 pin pinmux on it.
Could you point out what steps do we need to enable SPI0?
From the above dtsi I thought we can just use status = “ok” to enable it but it does not work.

dtsi file is:
hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi

This SPI0 in the picture should be SPI1 in the dtsi?

Thanks

Please use Jetson-IO to enable SPI on 40-pins expansion header.

1. Run Jetson IO
$ sudo /opt/nvidia/jetson-io/jetson-io.py
2. Configure SPI1
Configure Jetson 40pin Header => Configure header pins manually => Select "spi1" => Back -> Save pin changes => Save and reboot to reconfigure pins

Yes.

1 Like

after executing this:
sudo /opt/nvidia/jetson-io/jetson-io.py

A window seems to want to pop up on the cmd screen but instantly disappears, without an error log printing on the console.

Is there some package version that I can check or provide to you?

Or would this work?

Hello Kevin,

Does Jetson-IO not compatiable with R35.3.1?

Thanks

You could provide the result of the following command on your board.

$ cat /etc/nv_tegra_release
$ cat /etc/nv_boot_control.conf

It should also work to configure the pinmux for SPI.
You may use sudo for these commands.

It dose compatible with R35.3.1, or you could use SDKM to flash the latest R35.4.1 for your Orin Nano devkit.

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