Jetpack 6.0 : /proc/device-tree differs erroneously from FDT file

Hello,

I have a strange problem with jetpack-6.0 on my custom orin-nx based board : entries in /proc/device-tree differ erroneously from the ones in my FDT file.

Here is an example :

 tegra-capture-vi {                      tegra-capture-vi {
  compatible = "nvidia,tegra-camrtc-c     compatible = "nvidia,tegra-camrtc-c
  num-channels = <0x02>;                  num-channels = <0x02>;
  nvidia,vi-devices = <0x21e 0x220>;      nvidia,vi-devices = <0x21e 0x220>;
  nvidia,vi-mapping = <0x00 0x00 0x01     nvidia,vi-mapping = <0x00 0x00 0x01
  nvidia,vi-mapping-names = "csi-stre     nvidia,vi-mapping-names = "csi-stre
  nvidia,vi-mapping-size = <0x06>;        nvidia,vi-mapping-size = <0x06>;
  nvidia,vi-max-channels = <0x48>;        nvidia,vi-max-channels = <0x48>;
  phandle = <0x382>;                      phandle = <0x382>;

  ports {                                 ports {
   #address-cells = <0x01>;                #address-cells = <0x01>;
   #size-cells = <0x00>;                   #size-cells = <0x00>;

   port@0 {                                port@0 {
                                      >     phandle = <0x38e>;
    reg = <0x00>;                           reg = <0x00>;

    endpoint {                              endpoint {
     bus-width = <0x04>;              |      bus-width = <0x02>;
     devnode = "video0";                     devnode = "video0";
     phandle = <0x110>;               |      phandle = <0x389>;
     port-index = <0x00>;             |      port-index = <0x01>;
     remote-endpoint = <0x221>;       |      remote-endpoint = <0x386>;
    };                                      };
   };                                      };

   port@1 {                                port@1 {
                                      >     phandle = <0x38f>;
    reg = <0x01>;                           reg = <0x01>;

    endpoint {                              endpoint {
     bus-width = <0x04>;              |      bus-width = <0x02>;
     devnode = "video1";                     devnode = "video1";
     phandle = <0x112>;               |      phandle = <0x38b>;
     port-index = <0x02>;                    port-index = <0x02>;
     remote-endpoint = <0x222>;       |      remote-endpoint = <0x387>;
    };                                      };
   };                                      };
  };                                      };
 };                                      };

At left the ‘decompiled’ FDT file, at right the ‘decompiled’ /proc/device-tree.
Note the addition of phandle’s, and the changed ‘bus-width’ and ‘port-index’ properties.

How can I ensure that my FDT file is used without distortion ?

Hello @phdm,

Would it be possible for you to provide us with the output of the following commands ?

dmesg | grep DTB

dmesg | greo dts

regards,
Andrew
support@proventusnova.com

There is no occurrence of DTB or dts in the output of ‘dmesg’.

The only message related to DT that I see is in the serial log :

EFI stub: Using DTB from configuration table

This message happens just after the display of the extlinux.conf entries and the automatic choice

0: primary kernel
1: backup kernel
2: wip kernel
3: wip dtb
4: wip kernel backup
Press 0-4 to boot selection within 3.0 seconds.
Press any other key to boot default (Option: 2)
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table

Have you checked the dtbo in use on your board?

There are plenty of dtbo’s in /boot.

Some of them are even said to be compatible :

root@tegra-ubuntu:/home/nvidia# sudo /opt/nvidia/jetson-io/config-by-hardware.py
 -l
Header 1 [default]: Jetson 40pin Header
  Available hardware modules:
  1. Adafruit SPH0645LM4H
  2. Adafruit UDA1334A
  3. FE-PI Audio V1 and Z V2
  4. ReSpeaker 4 Mic Array
  5. ReSpeaker 4 Mic Linear Array
Header 2: Jetson 24pin CSI Connector
  Available hardware modules:
  1. Camera IMX219 Dual
  2. Camera IMX477 Dual
  3. Camera IMX477 Dual 4 lane
  4. Camera IMX477-A and IMX219-C
Header 3: Jetson M.2 Key E Slot
  No hardware configurations found!
root@tegra-ubuntu:/home/nvidia#

but I did not add any of them manually to my dtb.

Are some of those dtbo’s added automatically to the /proc/device-tree copy of my FDT file at boot ?

Yes, it is possible. There are lists of dtbo in default flash board config.

There was an erroneous entry left in my DTB. I have removed it, and now no dtbo is said compatible.

sudo /opt/nvidia/jetson-io/config-by-hardware.py -l    Traceback (most recent call last):
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 125, in <module>
    main()
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 99, in main
    raise RuntimeError("Platform not supported, no headers found!")
RuntimeError: Platform not supported, no headers found!

Nevertheless the problem is still there.

Where does that modification of my DT happen ?
How can I force my DTB to be used as is ?

I don’t know what you are talking about regarding that “erroneous entry left in my DTB”. Looks like you just broken the format of the device tree.

Sorry.

The top-level ‘compatible’ property in my DT was

compatible = "nvidia,p3768-0000+p3767-0000", "nvidia,p3767-0000", "nvidia,tegra234";

I now have removed "nvidia,p3768-0000+p3767-0000" from the list.

Hello Wayne

thank you for your hint about overlays.

I have now reflashed my custom board with the following instructions

$ cd nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra
$ cat nooverlay.conf
source "${LDK_DIR}/jetson-orin-nano-devkit-nvme.conf";
unset OVERLAY_DTB_FILE
$ cat FLASH-MY-BOARD
BOARD=nooverlay
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
        -c tools/kernel_flash/flash_l4t_external.xml \
        -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
        --showlogs --network usb0 ${BOARD} internal
$ bash FLASH-MY-BOARD

then re-added the entry with my LINUX Image and my FDT dtb to /boot/extlinux/extlinux.conf, and then rebooted the board.

The problem has disappeared.

Nevertheless, I still do not understand why overlays were applied automatically (the imx219 one at least) although there is no trace of such device on my board.

PS: for the flash to succeed, I disconnected the ethernet cable. My previous flash attempt, although not with exactly the same conf file had failed with an endless stream of

NFS: state manager: check lease failed on NFSv4 server fc00:1:1:0::1 with error 13

on the serial console