How to prevent Orin UEFI freezing with custom display?

Hi,
We got a custom display with some unusual resolutions.
And now UEFI is freezing somewhere inside this call:
Status = Private->GraphicsOutput->SetMode (Private->GraphicsOutput, ModeNumber);
where SetMode appears to point somewhere inside nvgop-chips-platform.efi, which appears to be a closed source driver, so I cannot fix it.
I added some extra logs around and got:
GraphicsConsoleControllerDriverStart:478 QueryMode 0 ret 0 2160x112
GraphicsConsoleControllerDriverStart:478 QueryMode 1 ret 0 800x600
GraphicsConsoleControllerDriverStart:540 call SetMode #0
freeze
Also, Orin gets very hot while being frozen, its power regulation may not be active at this time, which is kind of dangerous.

I tried to disable display in UEFI according to this post:

I did the following:

sed ‘s@!include Silicon/NVIDIA/Drivers/NvGopDriver/NvGopDriver.dsc.inc@#!include Silicon/NVIDIA/Drivers/NvGopDriver/NvGopDriver.dsc.inc@g’ -i edk2-nvidia/Platform/NVIDIA/NVIDIA.common.dsc.inc
sed ‘s@Silicon/NVIDIA/Drivers/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf@#Silicon/NVIDIA/Drivers/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf@g’ -i edk2-nvidia/Platform/NVIDIA/NVIDIA.common.dsc.inc
sed ‘s@Silicon/NVIDIA/Drivers/NvDisplayControllerDxe/NvDisplayControllerDxe.inf@#Silicon/NVIDIA/Drivers/NvDisplayControllerDxe/NvDisplayControllerDxe.inf@g’ -i edk2-nvidia/Platform/NVIDIA/NVIDIA.common.dsc.inc
sed ‘s@!include Silicon/NVIDIA/Drivers/NvGopDriver/NvGopDriver.fdf.inc@#!include Silicon/NVIDIA/Drivers/NvGopDriver/NvGopDriver.fdf.inc@g’ -i edk2-nvidia/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
sed ‘s@INF Silicon/NVIDIA/Drivers/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf@#INF Silicon/NVIDIA/Drivers/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf@g’ -i edk2-nvidia/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
sed ‘s@INF Silicon/NVIDIA/Drivers/NvDisplayControllerDxe/NvDisplayControllerDxe.inf@#INF Silicon/NVIDIA/Drivers/NvDisplayControllerDxe/NvDisplayControllerDxe.inf@g’ -i edk2-nvidia/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc

Then rebuilding UEFI.
OK, it works: UEFI does not init display anymore and boots normally.

But I would prefer to avoid rebuilding UEFI every time Jetson is released.
Rebuilding UEFI is very troublesome process, especially “edk2_docker edkrepo clone nvidia-uefi NVIDIA-Platforms main”, which fails almost every time.

So, question is how to disable display in UEFI or force it to use a different mode without rebuilding? May be using some config options?

Thank you

Hi jhnlmn,

Are you using the devkit or custom board for AGX Orin?
What’s your Jetpack version in use?

Actually, we don’t suggest using the main branch, which is the latest branch but may not available for your release. Please download the source corresponding to the L4T release you are using.

UEFI is dtb driven so that you can just disable them in device tree and flash the board to apply the change.

This problem is reproducible with Orin AGX Devkit with Jetson 36.3.0 as well as previous version.

I was following instructions at

which said that for Jetpack 6 to use " edkrepo clone nvidia-uefi NVIDIA-Platforms main"
Unfortunately, it fails out most of the time.
Also note that the problem happens with stock prebuilt uefi_jetson.bin. I only rebuilt it for debugging.

UEFI is dtb driven so that you can just disable them in device tree and flash the board to apply the change.

That would be great. Can you tell me the file and entry name to disable display?

Thank you

Have you also tried the following command to clone the source of UEFI binary for JP6.0GA?

$ edkrepo clone nvidia-uefi-36.3.0 NVIDIA-Platforms r36.3.0

Please try to disable display@13800000 { node in your device tree.

Could you be more specific?
I only see display@13800000 in kernel device tree, but I do need display in kernel,
I need to disable display in UEFI to prevent it from freezing, but I cannot find display@13800000 in any .dts under Jetson_Linux_R36.3.0_aarch64/Linux_for_Tegra/bootloader
I tried reading
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/Bootloader/UEFI.html
but it does not mention how to disable display. Please, tell me

By default UEFI will use the same dtb file as the one used in kernel.
You can find the following line in jetson-agx-orin-devkit.conf

DTB_FILE=tegra234-p3737-0000+p3701-0000-nv.dtb;
TBCDTB_FILE="${DTB_FILE}";

Now, you have 2 methods to disable display in UEFI.

  1. use two dtb file, one for kernel(DTB_FILE) with display enabled, one for uefi(TBCDTB_FILE) with display disabled
  2. rebuild uefi binary and remove the display related modules in configuration files

I tried creating tegra234-p3737-0000+p3701-0000-nv-modified.dtb as a copy of tegra234-p3737-0000+p3701-0000-nv.dtb
but with “nvidia,tegra234-display” replaced by “nvidia,tegra234-cisplay”
This disables display in the bootloader, but also disables it in Linux.
It appears that flash.sh copies ./kernel/dtb/tegra234-p3737-0000+p3701-0000-nv-modified.dtb
to ./bootloader/tegra234-p3737-0000+p3701-0000-nv-no-display.dtb
So, both bootloader and Linux always use the same .dtb.

This is what I did:


cp ./bootloader/tegra234-p3737-0000+p3701-0000-nv.dtb \
   ./bootloader/tegra234-p3737-0000+p3701-0000-nv-modified.dtb
cp ./bootloader/tegra234-p3737-0000+p3701-0000-nv.dtb \
   ./kernel/dtb//tegra234-p3737-0000+p3701-0000-nv-modified.dtb
# Note: I have to copy .dtb to kernel/dtb/, otherwise flash.sh fails with error:
# 'Error: Can not find --concat_cpubl_bldtb to create --concat_cpubl_bldtb_with_odm'

 # Now modify the bootloader copy, but not kernel:
sed 's@nvidia,tegra234-display\x0@nvidia,tegra234-cisplay\x0@g' -i ./bootloader/tegra234-p3737-0000+p3701-0000-nv-modified.dtb

#verify:
grep --text cisplay ./bootloader/tegra234-p3737-0000+p3701-0000-nv-modified.dtb # Should find
grep --text cisplay ./kernel/dtb/tegra234-p3737-0000+p3701-0000-nv-modified.dtb # Should not find

cp jetson-agx-orin-devkit.conf jetson-agx-orin-devkit.conf_save
sed 's@TBCDTB_FILE=.*@TBCDTB_FILE="tegra234-p3737-0000+p3701-0000-nv-modified.dtb";@g' -i jetson-agx-orin-devkit.conf
diff jetson-agx-orin-devkit.conf jetson-agx-orin-devkit.conf_save

sudo st ./flash.sh -k A_cpu-bootloader jetson-agx-orin-devkit mmcblk0p1 | tee flash_out.txt 2>&1

# Now have logo in BL and Kernel
grep --text cisplay ./bootloader/tegra234-p3737-0000+p3701-0000-nv-modified.dtb
# Does not find because flash.sh copied ./kernel/dtb/tegra234-p3737-0000+p3701-0000-nv-modified.dtb to  ./bootloader/tegra234-p3737-0000+p3701-0000-nv-modified.dtb

# Now try to modify both:
sed 's@nvidia,tegra234-display\x0@nvidia,tegra234-cisplay\x0@g' -i ./bootloader/tegra234-p3737-0000+p3701-0000-nv-modified.dtb
sed 's@nvidia,tegra234-display\x0@nvidia,tegra234-cisplay\x0@g' -i ./kernel/dtb/tegra234-p3737-0000+p3701-0000-nv-modified.dtb

# Now no display neither in BL nor in kernel. In kernel we can double check:

cat /proc/device-tree/display@13800000/compatible
nvidia,tegra234-cisplay

How to force flash.sh to give different .dtb to Linux?

You may need to customize the flash.sh for this use case.

mkfilesoft tbcdtbfile	"${TBCDTB_FILE}" "${DTB_DIR}/${DTB_FILE}";
if [ "${CHIPID}" = "0x23" ]; then
mkfilesoft tbcdtbfile	"${TBCDTB_FILE}" "${DTB_DIR}/${TBCDTB_FILE}";
fi;

Does not work.

I replaced the lines above by
mkfilesoft tbcdtbfile “tegra234-p3737-0000+p3701-0000-nv-modified.dtb” "kernel/dtb/tegra234-p3737-0000+p3701-0000-nv-modified.dtb
using
sed ‘s@mkfilesoft tbcdtbfile.*@mkfilesoft tbcdtbfile “tegra234-p3737-0000+p3701-0000-nv-modified.dtb” “kernel/dtb/tegra234-p3737-0000+p3701-0000-nv-modified.dtb”;@g’ -i flash.sh

cp ./bootloader/tegra234-p3737-0000+p3701-0000-nv.dtb
./kernel/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb-modified
sed ‘s@nvidia,tegra234-display\x0@nvidia,tegra234-cisplay\x0@g’ -i ./kernel/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb-modified

I tried flashing everything using
sudo ./flash.sh jetson-agx-orin-devkit mmcblk0p1

Now neither UEFI nor kernel has display.
cat /proc/device-tree/display@13800000/compatible
nvidia,tegra234-cisplay

I tried flashing only bootloader alone using
./flash.sh -k A_cpu-bootloader jetson-agx-orin-devkit mmcblk0p1
with original flash.sh or patched one,
and again, UEFI and Linux either both has display or none.

Sorry for the late reply, please let me share the detailed steps to separate the DTB for UEFI and kernel in Jetpack 6.
(UEFI dtb disable display node, Kernel dtb enable display node)

Step 1. Generate device tree for UEFI (tegra234-p3737-0000+p3701-0000-uefi.dtb)
1-1: decompile dtb

$ cd <Linux_for_Tegra>/kernel/dtb/
$ dtc -I dtb -O dts -o temp.dts tegra234-p3737-0000+p3701-0000-nv.dtb

1-2: modify the content

$ vim temp.dts
	display@13800000 {
		compatible = "nvidia,tegra234-display";
		power-domains = <0x3 0x3>;
		..
-		status = "okay";
+		status = "disabled";

1-3: assemble it back to uefi dtb

$ dtc -I dts -O dtb -o tegra234-p3737-0000+p3701-0000-uefi.dtb temp.dts

Step 2. Update board config to specify TBCDTB_FILE (p3737-0000-p3701-0000.conf)

		echo "Error: Unrecognized module SKU ${board_sku}";
		exit 1;
	fi

-	TBCDTB_FILE="${DTB_FILE}";
+	TBCDTB_FILE=tegra234-p3737-0000+p3701-0000-uefi.dtb;
}
..
DTB_FILE=tegra234-p3737-0000+p3701-0000-nv.dtb;
-TBCDTB_FILE="${DTB_FILE}";
+TBCDTB_FILE=tegra234-p3737-0000+p3701-0000-uefi.dtb;

Step 3. Modify extlinux.conf to specify the dtb used for kernel (Or it will load dtb from UEFI-DTB)

$ sudo vim <Linux_for_Tegra>/rootfs/boot/extlinux/extlinux.conf
LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
+	  FDT /boot/dtb/kernel_tegra234-p3737-0000+p3701-0000-nv.dtb
      INITRD /boot/initrd
      APPEND ${cbootargs}

Step 4. Flash the board to apply change

$ sudo ./flash.sh jetson-agx-orin-devkit internal
1 Like

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