The confusion with DTB

Hi,

I was trying to modify the device tree for Jetson AGX Orin and I added a simple custom_prop = “dtb modified” to check the device tree being loaded. after this modification i tried flashing to A_kernel-dtb partition as well as APP partitions with no success in updating the dtb. It was only when I changed the L4T configuration from Extlinux to kernel partition from the UEFI console that I was able to update the dtb. I had ruled out this possibility because the extlinux.config file did not mention DTB or FDT. Finally, I have the question as to from where does the board actually load the device tree from. It is not from the boot/dtb partition either.

It is from the UEFI-dtb.

Yes, I did see that but still there should be a specific file where it gets decided. I went through the config files and my board sku is 0005. It boots with the corresponing dtb too. But when I try to modify that I expected the dtb to be picked up automaticallly but it is not so. If I am able to find fro where UEFI picks its dtb it would help.

The whole logic here is that there is a if-else condition in your flash config file.

It decides which dtb is in use w.r.t the chip id/sku in use.

When running flash command, it will read the module info from the EEPROM of the module, and then go into that if-else to decide which file to pick.

And all the kernel device tree files are put under Linux_for_Tegra/kernel/dtb.

UEFI dtb and kernel dtb are by default the same file but flashed into different partition. And by default kernel-dtb partition is not in use.

Yes, by default ExtLinux is in use but if all dtbs that I checked have been modified. I made the edit to the source files in source/hardware/nvidia/t23x/nv-public/staging/ and build he dtbs. So which partition handles uefi dtb?

Just to make sure we are on same page. Are you using rel-36 or rel-35 release? The behavior is slightly different.

rel-36.4; from flash log

L4T BSP Information:

R36 , REVISION: 4.0

User release: 0.0

####################

uefi partition shall include the uefi-dtb as a part. The partition contains not just the dtb file.

The partition name should be cpu-bootloader-A and B

This is the partition information I was able to gather with gdisk

Number Start (sector) End (sector) Size Code Name
1 3050048 124321751 57.8 GiB 0700 APP
2 40 262183 128.0 MiB 0700 A_kernel
3 262184 263719 768.0 KiB 0700 A_kernel-dtb
4 263720 328487 31.6 MiB 0700 A_reserved_on_user
5 328488 590631 128.0 MiB 0700 B_kernel
6 590632 592167 768.0 KiB 0700 B_kernel-dtb
7 592168 656935 31.6 MiB 0700 B_reserved_on_user
8 656936 820775 80.0 MiB 0700 recovery
9 820776 821799 512.0 KiB 0700 recovery-dtb
10 821800 952871 64.0 MiB EF00 esp
11 952872 1116711 80.0 MiB 0700 recovery_alt
12 1116712 1117735 512.0 KiB 0700 recovery-dtb_alt
13 1117736 1248807 64.0 MiB 0700 esp_alt
14 1248832 2068031 400.0 MiB 0700 UDA
15 2068032 3050047 479.5 MiB 0700 reserved

What you dump there is the partitions on your boot medium.

It does not include the bootloader partitions which are on the QSPI flash.

If you check flash.xml in your BSP directory, you will know what I mean.

I was able to find this in flash.xml but the .bin file mentioned here cannot be found
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
3670016
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
uefi_jetson_with_dtb.bin
<align_boundary> 65536 </align_boundary>
this right?

so the best method to modify dtb is to use FDT in extlinux.conf?

You need to define what does that mean “best” to you.

I am merely telling how things work here. Something is better or worse to you depends on your usecase.

To expect the board will boot from the modified dtb always if I add FDT /boot/dtb in extlinux.conf. The other method is to make it boot from the kernel partition. The difference I feel here is in the former there is nothing hidden you can always check /boot/dtb partition to get the current dtb and when you place modified dtb in kernel/dtb the dtb in /boot/dtb will reflect that too as it is copied from here.

Referring to this might help.

The whole decision tree to decide where to load a device tree.

Thanks for your help.

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