Hi,
Please tell me how to enable SPI1/SPI3 on the 40 pin Header by default in the kernel without having to use a dtbo overlay file or using jetson-io.py.
Also I want anyone who is logged into the Orin to not be able to disable/enable the SPI 1 /SPI3 using thr jetson-io.py.
I want the SPI1/SPI3 to be configured in the kernel device tree directly. After flashing the SPI node should be enabled by default and by using jetson-io.py i should not be able to disable/enable the SPI1/SPI3.
Please let me know how to do this in the Jetpack 6.2.1 onwards.
*** Please note that this reply is generated by LLM automatically ***
To enable SPI1 and SPI3 on the 40-pin header by default in the kernel without using a dtbo overlay file or jetson-io.py, you need to modify the device tree directly. This can be done by modifying the kernel’s device tree source files.
Here are the steps to follow:
-
Locate the device tree source files: The device tree source files for the Jetson Orin NX are located in the hardware/nvidia/platform/t19x/common/kernel-dts/t19x-common-platforms directory of the Linux kernel source tree.
-
Modify the device tree source files: You need to modify the tegra194-p3701-0000-p3737-0000.dts file to enable SPI1 and SPI3 by default.
Add the following lines to the &spi1 and &spi3 nodes:
&spi1 {
status = “okay”;
spi-max-frequency = <1000000>;
};
&spi3 {
status = “okay”;
spi-max-frequency = <1000000>;
};
This will enable SPI1 and SPI3 by default and set their maximum frequency to 1 MHz.
3. **Rebuild the device tree**: After modifying the device tree source files, you need to rebuild the device tree.
Run the following command to rebuild the device tree:
```bash
make dtbs
This will rebuild the device tree and create a new tegra194-p3701-0000-p3737-0000.dtb file.
-
Flash the new device tree: You need to flash the new device tree to the Jetson Orin NX.
Run the following command to flash the new device tree:
sudo flash.sh -k kernel-dtb jetson-orin-nx-devkit mmcblk0p1
This will flash the new device tree to the Jetson Orin NX.
After flashing the new device tree, SPI1 and SPI3 should be enabled by default, and you should not be able to disable or enable them using jetson-io.py.
**Comparison with other methods**:
* Using a dtbo overlay file: This method allows you to enable SPI1 and SPI3 without modifying the kernel's device tree source files. However, it requires you to create a dtbo overlay file and apply it to the kernel.
* Using jetson-io.py: This method allows you to enable or disable SPI1 and SPI3 dynamically. However, it requires you to run the jetson-io.py script and specify the SPI interface you want to enable or disable.
**Note**: Modifying the kernel's device tree source files requires you to have a good understanding of the device tree and the kernel's build process. It also requires you to have the necessary tools and permissions to rebuild and flash the kernel.
*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***
@carolyuu This does not work. Also note that I dont want the jetson_io.py to be able to disable the SPI