Finding / Updating Device Tree

Hi,

I’m new to using the Jetsons and am trying to edit the device tree to keep the pcie controller from powering down. I’ve seen it mentioned in several articles, but I can’t figure out how to edit / update the device tree. I’m not even sure where to find it tbh.

For example, it’s mentioned here:

I’m just not sure where to find it / update it on my Orin. Thanks for any help

Hello @adams2,

You coud check the following 2 files:

kernel/nvidia/drivers/pci/dwc/pcie-tegra.c

and

hardware/nvidia/soc/t23x/kernel-dts/tegra234-soc/tegra234-soc-pcie.dtsi

I was not able to find nvidia,enable-power-down anywhere, but you could find something useful in there.

regards,
Andrew
Embedded Software Engineer

Where are those “kernel” and “hardware” folders found? Are they located in the “Linux_for_Tegra” directory? Are they somewhere on the orin after it is flashed?

I downloaded the files shown in the screenshot below for Jetson Linux 36.3:

In the files that I got there, I don’t have the hardware folder in my main “Linux_for_Tegra” folder.

Hello @adams2,

That is a great question!

Those files are part of the NVIDIA Jetpack sources.

You can download them by running the source_sync.sh script inside Linux_For_Tegra. You need to provide the -t tag parameter for the script to sync your sources to a specific Jetpack release, in your case you can run the following:

./source_sync.sh -k -t rel-36_eng_2023-10-04

That will download the sources file, inside you should find the directories I mentioned.

Please let us know if you require further assistance with modifying and building the sources.

regards,
Andrew
Embedded Software Engineer

Hello adams2

You can donwload the sources from “Driver Package (BSP) Sources” or get the kernel source, running the source_sync.sh script

Please see here the instructions of how to build the kernel and device tree.

https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/Kernel/KernelCustomization.html#building-the-dtbs

Manuel Leiva
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com

Hello @adams2,

Manuel is right, you can also get the sources from “Driver Package (BSP) Sources”.

Here is the link in case you might be wondering where to find that:

Please keep us posted, we would love to help if you have further questions.

If this is your first time doing kernel customization and building, it might seem overwhelming, however, you will see it gets easier with practice.

regards,
Andrew
Embedded Software Engineer

Andrew / Manuel,

It does feel a little overwhelming lol.
I had already pulled the sources manually by following the instructions here :
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/Kernel/KernelCustomization.html#to-manually-download-and-expand-the-kernel-sources

But my file system doesn’t have what you described earlier:

hardware/nvidia/soc/t23x/kernel-dts/tegra234-soc/tegra234-soc-pcie.dtsi

the source/hardware/nvidia folder contains the “t23x” directly, and it contains a “nv-public” folder. When I run “ls -R | grep pci” in the /source/hardware folder, it returns nothing.

@adams2,

No worries, we will try to get you through this.

Can you please try downloading the sources using the sources_sync script?

./source_sync.sh -k -t rel-36_eng_2023-10-04

I usually rather use the script than downloading everything by hand.

regards,
Andrew
Embedded Software Engineer

when I run the script, I get this output:

Directory for kernel/kernel-jammy-src, /home/orin_flasher/Documents/Linux_for_Tegra/source/kernel/kernel-jammy-src, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Directory for nvgpu, /home/orin_flasher/Documents/Linux_for_Tegra/source/nvgpu, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Directory for nvidia-oot, /home/orin_flasher/Documents/Linux_for_Tegra/source/nvidia-oot, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Directory for hwpm, /home/orin_flasher/Documents/Linux_for_Tegra/source/hwpm, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Directory for nvethernetrm, /home/orin_flasher/Documents/Linux_for_Tegra/source/nvethernetrm, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Directory for hardware/nvidia/t23x/nv-public, /home/orin_flasher/Documents/Linux_for_Tegra/source/hardware/nvidia/t23x/nv-public, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Directory for hardware/nvidia/tegra/nv-public, /home/orin_flasher/Documents/Linux_for_Tegra/source/hardware/nvidia/tegra/nv-public, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Directory for nvdisplay, /home/orin_flasher/Documents/Linux_for_Tegra/source/nvdisplay, already exists!
fatal: not a git repository (or any of the parent directories): .git
But the directory is not a git repository – clean it up first

Downloading default dtc-src/1.4.5 source…
Cloning into ‘/home/orin_flasher/Documents/Linux_for_Tegra/source/dtc-src/1.4.5’…
fatal: unable to connect to nv-tegra.nvidia.com:
nv-tegra.nvidia.com[0: 34.216.216.36]: errno=Connection timed out
nv-tegra.nvidia.com[1: 35.82.181.43]: errno=Connection timed out

/home/orin_flasher/Documents/Linux_for_Tegra/source/dtc-src/1.4.5 source sync failed!