Hi Bala,
- Actually the rule of device tree(dts/dtb) is from linux but not defined by NV. NV just splits it into many dtsi files because we have too much platforms to handle (e.g. t210 for TX1/Nano, T186 for TX2 series and T194 for Xavier/NX)
You can figure out the dts file by firstly checking the board config. For example, if you are using NX devkit, then the board config is jetson-xavier-nx-devkit.conf.
Then, according to the board config, you shall see it includes another source file.
source “${LDK_DIR}/p3668.conf.common”;
BLBlockSize=1048576;
EMMC_CFG=flash_l4t_t194_spi_sd_p3668.xml;
RECROOTFSSIZE=100MiB
So we open this p3668.conf.common too. Around line 100, you can see “DTB_FILE = tegra194-p3668-all-p3509-0000.dtb;” This is the dtb file you are using for jetson NX.
97 ODMDATA=0xB8190000;
98 CHIPID=0x19;
99 ITS_FILE=;
100 BPFDTB_FILE=tegra194-a02-bpmp-p3668-a00.dtb;
101 DTB_FILE=tegra194-p3668-all-p3509-0000.dtb;
102 TBCDTB_FILE=tegra194-p3668-all-p3509-0000.dtb;
After figuring out the dtb file, you can go to the download center and download the source.
In the source file, find the file name “tegra194-p3668-all-p3509-0000.dts”. Again, open this file and you shall see it includes other dtsi files too. You can then track it down. It is the start of your hardwork.
16 /dts-v1/;
17 #include "common/tegra194-p3668-common.dtsi"
18 #include "common/tegra194-p3509-0000-a00.dtsi"
19
20 / {
21 nvidia,dtsfilename = __FILE__;
22 nvidia,dtbbuildtime = __DATE__, __TIME__;
23
24 compatible = "nvidia,p3449-0000+p3668-0000", "nvidia,p3449-0000+p3668-0001", "nvidia,p3509-0000+p3668-0000", "nvidia,p3509-0000+p3668-0001", "nvidia,tegra194";
25 };
~
If you are tired of tracking this code, you can also add your change directly to tegra194-p3668-all-p3509-0000.dts. Since it is the last dts file, it won’t be override by other dtsi files anymore.
-
i generated the dts file using the excel sheet. and then generated the .cfg file as per the steps given. Then i used flash.sh to update only the cfg file. The flash script showed great verbose logs and there was no error. After the reboot nothing chaged.
So i am only modifying the dtb file directly.
I think there are some mistakes here because AFAIK the flash.sh cannot flash pinmux cfg file only. You have to do the full flash.
Also, updating the pinmux cfg only changes the pin function between SFIO and GPIO. This has nothing to do with your goal. If you want to use a GPIO in your driver, then you need to configure the pinmux and add gpio pin to “gps-enable-gpio” to dts.
As for configuring pinmux, actually there are two methods
-
using the spreadsheet to generating dts and then use python tool to generate cfg file. You already knew this method. I also suggest to use this method.
-
directly configuring the pin function to gpio in dts.