How do I configure my device tree and where are the source files for my device tree?

Question 1: How can I configure gpio before a cheap kernel, such as multiplexing i2c into gpio mode and setting high/low levels?
Q2: I am using a jetson orin nano device, I have very little content in the device tree in the kernel, how do I configure in the device book, such as changing the i2c clock frequency, etc. What is the primary device tree?

root@ubuntu:/boot/dtb# ls
kernel_tegra234-p3767-0003-p3768-0000-a0.dtb

My kernel structure:kaka@kaka-linux:~/work/kernel_src$ tree -L 1
.
├── build
├── hardware
├── kernel
├── kernel_out
├── nvbuild.sh
└── nvcommon_build.sh

Hi bwliu99,

Are yo using the devkit or custom board for Orin NX?
What’s the Jetpack version in use?

Do you want to use the pin as GPIO instead of I2C?
If so, please configure them in pinmux spreadsheet and refer to Generating the Pinmux dtsi Files to apply the change.

You can check the flash log to know which one is the DTB used for your board.
You can either decompile DTB through dtc tool or modify them in dts source in BSP package.
Please refer to Kernel Customization for the steps to clone and build kernel image/dtb.

1 Like

How do I configure the three files I generate from the following xlsm file into the kernel or system? I didn’t find any dts files related to pinmux in the kernel.
‘Jetson_Orin_NX_and_Orin_Nano_series_Pinmux_Config_Template.xlsm’
----->
‘Orin-jetson orin nano&nx pinmux dp-pinmux.dtsi’
‘Orin-jetson orin nano&nx pinmux dp-gpio-default.dtsi’
‘Orin-jetson orin nano&nx pinmux dp-padvoltage-default.dtsi’

thank you for the response

You might find this of interest:

Btw, starting with L4T R36.x (see “head -n 1 /etc/nv_tegra_release”) the kernel switched to mainline. As a result the default configuration changes from tegra_defconfig to just defconfig.

These dtsi are loaded in MB1 rather than kernel.
Please refer to Jetson Orin NX and Nano Series — NVIDIA Jetson Linux Developer Guide to apply the change.

I forgot about that! The URLs I gave were for direct device tree edits. An overlay cannot add new device tree nodes, but it can edit those nodes which exist. Boot stage can use the overlays before passing it on to the kernel. On the other hand, the “include files” for a device tree in the kernel source are for combining fragments (sub-trees) to create a whole device tree. If the .dtsi is from the PINMUX spreadsheet, then it is likely an overlay; if the .dtsi is from kernel source, then it is likely a fragment.