Optimizing boot time on Orin NX (JP5.1.2)

Hi,

We are trying to optimize the boot time on Orin NX (p3767+p3768) with R35.4.1 BSP. We are booting the Orin device from a USB.
Initially, the boot time was 55-57 seconds. After some optimization on the kernel end we are now at 38-40 seconds. We are trying to boot the Orin device under 15 seconds.
The UEFI itself takes 12 seconds to complete.

UEFI optimization:

https://github.com/NVIDIA/edk2-nvidia/wiki/Build-with-docker - cloned this repository.
I disable drivers in the files which are not required - NVIDIA.common.dsc.inc and NVIDIA.fvmain.fdf.inc
Build the image
Replace ./bootloader/uefi_jetson.bin with uefi_jetson_DEBUG.bin
The flash is successful but the Orin does not boot up (shutdown state requested -1)

A simple change like - setting auto timeout to 0s also leads to shutdown state requested -1

- gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5
+ gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|0

Hence I am unable to optimize the UEFI further.

Kernel optimization:

I have implemented the steps given in https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/Kernel/BootTimeOptimzation.html#boot-time-optimization

I was able to set auto timeout to 0s from the efibootmgr tool

After attempting to direct boot, there is an additional 5s wait.

[2023-12-21 **16:10:15.314**] L4TLauncher: Attempting Direct Boot ------- > (15th second)

**(5s wait)**

[2023-12-21 **16:10:20.016**] Processing "L4T Configuration Settings" DTB overlay -------> (20th second)

Also from CPU shutdown to login there is 3 seconds wait

kernel_log.txt (72.0 KB)
uefi_log.txt (88.5 KB)

I have attached the UEFI and kernel logs.
Thank you in advance

Hi san1998,

Are you using the devkit or custom board for Orin NX?

How did you clone the UEFI source? (i.e. which <combo> you are using)

How did you flash your USB device?

Before disabling the drivers in configuration files, could you boot up the board sucessfully?

@KevinFFF

Currently I am using the development kit.

Cloned with : r35.4.1

edk2_docker edkrepo clone /home/edk_workspace/ NVIDIA-Platforms r35.4.1

I was able to successfully flash the USB device with

sudo ADDITIONAL_DTB_OVER\LAY_OPT="BootOrderNvme.dtbo" ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 jetson-orin-nano-devkit internal

Yes before disabling the configuration files / modification, I am able to boot the board successfully with both uefi_jetson.bin and uefi_jetson_DEBUG.bin

Okay, it seems you steps are correct and you could boot up successfully before modifying configuration file in UEFI.

Your boot issue may be caused from something disabled in UEFI configuration.
Please disable them one-by-one to debug which driver causes the current boot issue.

@KevinFFF

I disable the drivers one by one.

Even I make a change like this one and flash, the orin does not boot up.

- gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5
+ gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|0

Do you mean that this modification cause you boot up failed?

@KevinFFF

Any modification i do, the boot up fails. Above one was an example.
even changing the logo to customized one.
I get the below , after Flash is successful, the system does not reboot.

Synchronous Exception at 0x0000000445A297B4


Synchronous Exception at 0x0000000445A297B4
ASSERT [ArmCpuDxe] /home/edk_workspace/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c(333): ((BOOLEAN)(0==1))

Resetting the system in 5 seconds.
����Shutdown state requested 1
Rebooting system ...

I make changes to replace to logo, or to set auto time out to 0s.
i build the new uefi image using the command

edk2_docker edk2-nvidia/Platform/NVIDIA/Jetson/build.sh

I replace the newly built uefi RELEASE image and flash.
Flash says successful but boot up fails.

Please assist.

@KevinFFF

It stops here and does not reach the bootloader part:


ASSERT [HiiDatabase] /home/edk_workspace/edk2/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c(303): GlyphBuffer != ((void *) 0) && Origin != ((void *) 0) && *Origin != ((void *) 0)

Resetting the system in 5 seconds.
����Shutdown state requested 1
Rebooting system ...

@KevinFFF

Okay, so when I use the DEBUG image , firs time, the boot was successful
I hit the above errors when I use the RELEASE Image.
And when i use the DEBGUG Image again, i hit the error:

Data abort: Translation fault, third level

Stack dump:
  000046E9FE3F0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  000046E9FE410: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  000046E9FE430: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  000046E9FE450: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  000046E9FE470: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  000046E9FE490: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
  000046E9FE4B0: 0000000000000000 0000000000000000 000000046A4217B4 0000000040000308
  000046E9FE4D0: 0000000000000000 0000000096000007 000000046EA20000 0000000000000AFF
> 000046E9FE4F0: 0000000442B0E7A6 000000046E9FE5AF 000000046E9FE658 0000000000000AFF
  000046E9FE510: 000000046E9FE680 0000000443B032B0 0000000442DF0418 0000000000000001
  000046E9FE530: 7FFFFFFFFFFFFFFC 0000000000000000 0000000443B22000 0000000000000000
  000046E9FE550: 0000000000000000 0000000465CABF18 0000000000000000 0000000442DF0280
  000046E9FE570: 000000046E9FE640 0000000442DF6D18 7FFFFFFFFFFFFFFC 0000000442B0E018
  000046E9FE590: 0000000000000059 0000000442DF6398 000000136E9FE5D0 0000000400000000
  000046E9FE5B0: 0000000000000000 0000000000000000 0000000000000006 000000000000001F
  000046E9FE5D0: 0000000000000000 0000000400000000 0000000442DF6198 000000046E9FE718
ASSERT [ArmCpuDxe] /home/sanya/edk_workspace/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c(333): ((BOOLEAN)(0==1))

Resetting the system in 5 seconds.
MnpSyncSendPacket: No network cable detected.
����Shutdown state requested 1
Rebooting system ...

Please use the following command to clone the source for r35.4.1.

$ edk2_docker edkrepo clone nvidia-uefi-r35.4.1 NVIDIA-Platforms r35.4.1

and use the following command to build UEFI binary.

$ cd nvidia-uefi-r35.4.1
$ edk2_docker edk2-nvidia/Platform/NVIDIA/Jetson/build.sh

Your UEFI binary will be generated in nvidia-uefi-r35.4.1/images/uefi_Jetson_RELEASE.bin and nvidia-uefi-r35.4.1/images/uefi_Jetson_DEBUG.bin.

Please replace the UEFI binary in BSP package with the image you built.

$ cp nvidia-uefi-r35.4.1/images/uefi_Jetson_RELEASE.bin <Linux_for_Tegra>/bootloader/uefi_jetson.bin

and run the flash command to flash your board.

I would suggest you don’t modify anything in UEFI source first and verify you could boot up successfully with the above steps.

1 Like

@KevinFFF

I am able to flash the board and boot it from the RELEASE image without any modification to the UEFI source.

It’s a good start.
Please just modify the following line and check if you can still boot up the board successfully.

- gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5
+ gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|0
1 Like

@KevinFFF

Yes i am able to boot the Orin with this change.

Please apply the following change in edk2-nvidia

diff --git a/Platform/NVIDIA/Jetson/Jetson.dsc.inc b/Platform/NVIDIA/Jetson/Jetson.dsc.inc
index 498e58bc..6b6ff671 100644
--- a/Platform/NVIDIA/Jetson/Jetson.dsc.inc
+++ b/Platform/NVIDIA/Jetson/Jetson.dsc.inc
@@ -292,7 +292,7 @@
   #
   # EQOS NIC Support
   #
-  Silicon/NVIDIA/Drivers/EqosDeviceDxe/EqosDeviceDxe.inf
+  #Silicon/NVIDIA/Drivers/EqosDeviceDxe/EqosDeviceDxe.inf
 
   #
   # VPR Support
diff --git a/Platform/NVIDIA/Jetson/Jetson.fdf b/Platform/NVIDIA/Jetson/Jetson.fdf
index 7f960f98..0580717a 100644
--- a/Platform/NVIDIA/Jetson/Jetson.fdf
+++ b/Platform/NVIDIA/Jetson/Jetson.fdf
@@ -51,8 +51,6 @@ FvNameGuid         = 49a79a15-8f69-4be7-a30c-a172f44abce7
     INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
     INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
     INF MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.inf
-    INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
-    INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
     INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
     INF FatPkg/EnhancedFatDxe/Fat.inf
     }
diff --git a/Platform/NVIDIA/Jetson/Jetson.fdf.inc b/Platform/NVIDIA/Jetson/Jetson.fdf.inc
index 8d74d048..09fd745d 100644
--- a/Platform/NVIDIA/Jetson/Jetson.fdf.inc
+++ b/Platform/NVIDIA/Jetson/Jetson.fdf.inc
@@ -122,7 +122,7 @@
   #
   # EQOS NIC Support
   #
-  INF Silicon/NVIDIA/Drivers/EqosDeviceDxe/EqosDeviceDxe.inf
+  #INF Silicon/NVIDIA/Drivers/EqosDeviceDxe/EqosDeviceDxe.inf
 
   #
   # VPR Support
diff --git a/Platform/NVIDIA/NVIDIA.common.dsc.inc b/Platform/NVIDIA/NVIDIA.common.dsc.inc
index 31a815bd..dee40c48 100644
--- a/Platform/NVIDIA/NVIDIA.common.dsc.inc
+++ b/Platform/NVIDIA/NVIDIA.common.dsc.inc
@@ -67,15 +67,15 @@ CONFIG_MEMORY_TEST=n
   BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
 
   # Networking Requirements
-  NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
-  DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
-  UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  TcpIoLib|NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
-  HttpIoLib|NetworkPkg/Library/DxeHttpIoLib/DxeHttpIoLib.inf
+  #NetLib|NetworkPkg/Library/DxeNetLib/DxeNetLib.inf
+  #DpcLib|NetworkPkg/Library/DxeDpcLib/DxeDpcLib.inf
+  #UdpIoLib|NetworkPkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
+  #IpIoLib|NetworkPkg/Library/DxeIpIoLib/DxeIpIoLib.inf
+  #TcpIoLib|NetworkPkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
+  #HttpIoLib|NetworkPkg/Library/DxeHttpIoLib/DxeHttpIoLib.inf
 
   # HttpLib is used for Http Boot
-  HttpLib|NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf
+  #HttpLib|NetworkPkg/Library/DxeHttpLib/DxeHttpLib.inf
 
   TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
@@ -645,7 +645,7 @@ CONFIG_MEMORY_TEST=n
 
 [PcdsDynamicHii.common.DEFAULT]
   # Global variables
-  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5
+  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|0
   # NVIDIA internal variables
   gNVIDIATokenSpaceGuid.PcdPcieResourceConfigNeeded|L"PCIeResourceConfig"|gNVIDIATokenSpaceGuid|0x0|0|BS
   gNVIDIATokenSpaceGuid.PcdPcieEntryInAcpiConfigNeeded|L"PCIeInOsConfig"|gNVIDIATokenSpaceGuid|0x0|0|BS
@@ -807,29 +807,29 @@ CONFIG_MEMORY_TEST=n
   #
   # Networking stack
   #
-  NetworkPkg/DpcDxe/DpcDxe.inf
-  NetworkPkg/ArpDxe/ArpDxe.inf
-  NetworkPkg/Dhcp4Dxe/Dhcp4Dxe.inf
-  NetworkPkg/Ip4Dxe/Ip4Dxe.inf
-  NetworkPkg/MnpDxe/MnpDxe.inf
-  NetworkPkg/SnpDxe/SnpDxe.inf
-  NetworkPkg/VlanConfigDxe/VlanConfigDxe.inf
-  NetworkPkg/Mtftp4Dxe/Mtftp4Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
-  NetworkPkg/Udp4Dxe/Udp4Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-
-  NetworkPkg/TlsDxe/TlsDxe.inf
-  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
-  NetworkPkg/DnsDxe/DnsDxe.inf
-  NetworkPkg/HttpDxe/HttpDxe.inf
-  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
-  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+  #NetworkPkg/DpcDxe/DpcDxe.inf
+  #NetworkPkg/ArpDxe/ArpDxe.inf
+  #NetworkPkg/Dhcp4Dxe/Dhcp4Dxe.inf
+  #NetworkPkg/Ip4Dxe/Ip4Dxe.inf
+  #NetworkPkg/MnpDxe/MnpDxe.inf
+  #NetworkPkg/SnpDxe/SnpDxe.inf
+  #NetworkPkg/VlanConfigDxe/VlanConfigDxe.inf
+  #NetworkPkg/Mtftp4Dxe/Mtftp4Dxe.inf
+  #NetworkPkg/TcpDxe/TcpDxe.inf
+  #NetworkPkg/Udp4Dxe/Udp4Dxe.inf
+  #NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  #NetworkPkg/IScsiDxe/IScsiDxe.inf
+  #NetworkPkg/Ip6Dxe/Ip6Dxe.inf
+  #NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
+  #NetworkPkg/Udp6Dxe/Udp6Dxe.inf
+  #NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
+
+  #NetworkPkg/TlsDxe/TlsDxe.inf
+  #NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
+  #NetworkPkg/DnsDxe/DnsDxe.inf
+  #NetworkPkg/HttpDxe/HttpDxe.inf
+  #NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
+  #NetworkPkg/HttpBootDxe/HttpBootDxe.inf
 
   # FV Filesystems
   MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
@@ -853,11 +853,11 @@ CONFIG_MEMORY_TEST=n
   #
   # SATA Controller
   #
-  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
-  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
-  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
-  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
-  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
+  #MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
+  #MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
+  #MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
+  #MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
+  #MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
 
   #
   # NVMe boot devices
@@ -898,16 +898,10 @@ CONFIG_MEMORY_TEST=n
       NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
       NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
       NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
-      NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
-      NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
       OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
       PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
       BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
   }
-  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
-    <PcdsFixedAtBuild>
-      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
-  }
   ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf {
     <PcdsFixedAtBuild>
       gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
@@ -1018,7 +1012,7 @@ CONFIG_MEMORY_TEST=n
   #
   # Third party drivers
   #
-  Drivers/Realtek/Bus/Pcie/PcieNetworking/RtkUndiDxe.inf
+  #Drivers/Realtek/Bus/Pcie/PcieNetworking/RtkUndiDxe.inf
 
   #
   # Tegra Pin Control support
diff --git a/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc b/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
index 2e5ea98d..e14c387c 100644
--- a/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
+++ b/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
@@ -144,11 +144,11 @@
   #
   # SATA Controller
   #
-  INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
-  INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
-  INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
-  INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
-  INF MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
+  #INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
+  #INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
+  #INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
+  #INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
+  #INF MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
 
   #
   # NVMe boot devices
@@ -158,35 +158,35 @@
   #
   # Networking stack
   #
-  INF NetworkPkg/DpcDxe/DpcDxe.inf
-  INF NetworkPkg/ArpDxe/ArpDxe.inf
-  INF NetworkPkg/Dhcp4Dxe/Dhcp4Dxe.inf
-  INF NetworkPkg/Ip4Dxe/Ip4Dxe.inf
-  INF NetworkPkg/MnpDxe/MnpDxe.inf
-  INF NetworkPkg/SnpDxe/SnpDxe.inf
-  INF NetworkPkg/VlanConfigDxe/VlanConfigDxe.inf
-  INF NetworkPkg/Mtftp4Dxe/Mtftp4Dxe.inf
-  INF NetworkPkg/TcpDxe/TcpDxe.inf
-  INF NetworkPkg/Udp4Dxe/Udp4Dxe.inf
-  INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF NetworkPkg/IScsiDxe/IScsiDxe.inf
-  INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  INF NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  INF NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-
-  INF NetworkPkg/TlsDxe/TlsDxe.inf
-  INF NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
-  INF NetworkPkg/DnsDxe/DnsDxe.inf
-  INF NetworkPkg/HttpDxe/HttpDxe.inf
-  INF NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
-  INF NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+  #INF NetworkPkg/DpcDxe/DpcDxe.inf
+  #INF NetworkPkg/ArpDxe/ArpDxe.inf
+  #INF NetworkPkg/Dhcp4Dxe/Dhcp4Dxe.inf
+  #INF NetworkPkg/Ip4Dxe/Ip4Dxe.inf
+  #INF NetworkPkg/MnpDxe/MnpDxe.inf
+  #INF NetworkPkg/SnpDxe/SnpDxe.inf
+  #INF NetworkPkg/VlanConfigDxe/VlanConfigDxe.inf
+  #INF NetworkPkg/Mtftp4Dxe/Mtftp4Dxe.inf
+  #INF NetworkPkg/TcpDxe/TcpDxe.inf
+  #INF NetworkPkg/Udp4Dxe/Udp4Dxe.inf
+  #INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+  #INF NetworkPkg/IScsiDxe/IScsiDxe.inf
+  #INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf
+  #INF NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
+  #INF NetworkPkg/Udp6Dxe/Udp6Dxe.inf
+  #INF NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
+
+  #INF NetworkPkg/TlsDxe/TlsDxe.inf
+  #INF NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
+  #INF NetworkPkg/DnsDxe/DnsDxe.inf
+  #INF NetworkPkg/HttpDxe/HttpDxe.inf
+  #INF NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
+  #INF NetworkPkg/HttpBootDxe/HttpBootDxe.inf
 
   #
   # Shell dynamic commands
   #
-  INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
-  INF ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
+  #INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
+  #INF ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
 
   #
   # UEFI applications
@@ -283,7 +283,7 @@
   #
   # Third party drivers
   #
-  INF Drivers/Realtek/Bus/Pcie/PcieNetworking/RtkUndiDxe.inf
+  #INF Drivers/Realtek/Bus/Pcie/PcieNetworking/RtkUndiDxe.inf
 
   #
   # Tegra Pin Control support
diff --git a/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c b/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c
index 669c6044..46c7eece 100644
--- a/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/Silicon/NVIDIA/Library/PlatformBootManagerLib/PlatformBm.c
@@ -562,6 +562,7 @@ AddOutput (
     ));
 }
 
+# if 0
 STATIC
 VOID
 PlatformRegisterFvBootOption (
@@ -628,6 +629,7 @@ PlatformRegisterFvBootOption (
   EfiBootManagerFreeLoadOption (&NewOption);
   EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
 }
+#endif
 
 STATIC
 VOID
@@ -1390,7 +1392,7 @@ PlatformBootManagerBeforeConsole (
     // Enumerate all possible boot options.
     //
     EfiBootManagerRefreshAllBootOption ();
-
+# if 0
     //
     // Register platform-specific boot options and keyboard shortcuts.
     //
@@ -1405,6 +1407,7 @@ PlatformBootManagerBeforeConsole (
       LOAD_OPTION_ACTIVE,
       LoadOptionTypeBoot
       );
+#endif
 
     //
     // Set Boot Order
-- 
1 Like

@KevinFFF

Okay, I am able to flash it and boot the board successfully, now the UEFI takes 10 seconds.

Can we optimize this further?

1 Like

@KevinFFF ,

There is wait time in certain places like:

5 seconds wait time here:

[2024-03-19 11:51:04] L4TLauncher: Attempting Direct Boot
[2024-03-19 11:51:09] EFI stub: Booting Linux Kernel...
[2024-03-19 11:51:09] EFI stub: Using DTB from configuration table
[2024-03-19 11:51:09] EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
[2024-03-19 11:51:09] EFI stub: Exiting boot services and installing virtual address map...

2+4 seconds wait time here:

2024-03-19 11:51:26] [   16.809168] using random self ethernet address
[2024-03-19 11:51:26] [   16.813764] using random host ethernet address
[2024-03-19 11:51:28] [   18.419610] using random self ethernet address
[2024-03-19 11:51:28] [   18.424195] using random host ethernet address
[2024-03-19 11:51:32] [   22.041032] CPU4: shutdown
[2024-03-19 11:51:32] [   22.245559] CPU5: shutdown
[2024-03-19 11:51:32] [   22.360741] CPU6: shutdown
[2024-03-19 11:51:32] [   22.442908] IRQ 116: no longer affine to CPU7
[2024-03-19 11:51:32] [   22.448016] CPU7: shutdown
[2024-03-19 11:51:33] 
[2024-03-19 11:51:33] Ubuntu 20.04.6 LTS tegra-ubuntu ttyTCU0
[2024-03-19 11:51:33] 
[2024-03-19 11:51:33] tegra-ubuntu login:  (automatic login)

How can we optimize this further?

Could you use debug UEFI to check what it is doing between 11:51:04 and 11:51:09?

I’ve checked the devkit and there’s no 5s delay here.

[2024-03-19 16:56:20] L4TLauncher: Attempting Direct Boot
[2024-03-19 16:56:20] Processing "L4T Configuration Settings" DTB overlay
[2024-03-19 16:56:20] Deleting fragment fragment@0
[2024-03-19 16:56:20] Processing "P3767 Overlay Support" DTB overlay
[2024-03-19 16:56:20] Deleting fragment fragment@0
[2024-03-19 16:56:20] Deleting fragment fragment@1
[2024-03-19 16:56:20] Deleting fragment fragment@2
[2024-03-19 16:56:20] Deleting fragment fragment@3
[2024-03-19 16:56:20] Processing "P3768 Overlay Support" DTB overlay
[2024-03-19 16:56:20] Deleting fragment fragment@0
[2024-03-19 16:56:20] Deleting fragment fragment@1
[2024-03-19 16:56:20] UpdateRamOopsMemory: RamOopsBase: 0x46EB70000, RamOopsSize: 0x200000
[2024-03-19 16:56:20] FtpmProtocol Not Found - Not Found
[2024-03-19 16:56:20] GetParentPcieControllerPrivate: cannot retrieve device path protocol from device handle: Unsupported
[2024-03-19 16:56:21] Loading driver at 0x004596C0000 EntryPoint=0x0045B05AE2C
[2024-03-19 16:56:21] Loading driver at 0x004596C0000 EntryPoint=0x0045B05AE2C 
[2024-03-19 16:56:21] EFI stub: Booting Linux Kernel...

@KevinFFF

There is nothing that displays even in the DEBUG image, just wait time of 5 seconds:


[2023-12-21 16:10:14.837] PROGRESS CODE: V03051001 I0
[2023-12-21 16:10:14.837] [Bds]Booting UEFI USB SanDisk 3.2Gen1 0401560f40952dbc0e3436df992295ab6675723839beef3157b08d7291ecd0dd91ef00000000000000000000fee19030008c2a18ab558107562ee5c1
[2023-12-21 16:10:15.313] PROGRESS CODE: V03058000 I0
[2023-12-21 16:10:15.313] add-symbol-file /out/nvidia/bootloader/uefi/Jetson_RELEASE/Build/Jetson/RELEASE_GCC5/AARCH64/Silicon/NVIDIA/Application/L4TLauncher/L4TLauncher/DEBUG/L4TLauncher.dll 0x4480BA000
[2023-12-21 16:10:15.314] Loading driver at 0x004480B9000 EntryPoint=0x004480C5820 L4TLauncher.efi
[2023-12-21 16:10:15.314] PROGRESS CODE: V03058001 I0
[2023-12-21 16:10:15.314] 
                          [2023-12-21 16:10:15.314] L4TLauncher: Attempting Direct Boot
[2023-12-21 16:10:20.016] Processing "L4T Configuration Settings" DTB overlay
[2023-12-21 16:10:20.064] Deleting fragment fragment@0
[2023-12-21 16:10:20.065] Processing "P3767 Overlay Support" DTB overlay
[2023-12-21 16:10:20.065] Deleting fragment fragment@0
[2023-12-21 16:10:20.065] Deleting fragment fragment@1
[2023-12-21 16:10:20.065] Deleting fragment fragment@2
[2023-12-21 16:10:20.065] Deleting fragment fragment@3
[2023-12-21 16:10:20.065] Processing "P3768 Overlay Support" DTB overlay
[2023-12-21 16:10:20.065] Deleting fragment fragment@0
[2023-12-21 16:10:20.065] Deleting fragment fragment@1
[2023-12-21 16:10:20.065] Processing "UEFI Boot order nvme default" DTB overlay
[2023-12-21 16:10:20.065] Deleting fragment fragment@0
[2023-12-21 16:10:20.080] UpdateRamOopsMemory: RamOopsBase: 0x46EA70000, RamOopsSize: 0x200000
[2023-12-21 16:10:20.112] FtpmProtocol Not Found - Not Found
[2023-12-21 16:10:20.113] GetParentPcieControllerPrivate: cannot retrieve device path protocol from device handle: Unsupported
[2023-12-21 16:10:20.658] Loading driver at 0x004405A0000 EntryPoint=0x00441F3C598
[2023-12-21 16:10:20.658] Loading driver at 0x004405A0000 EntryPoint=0x00441F3C598 
[2023-12-21 16:10:20.658] EFI stub: Booting Linux Kernel...
[2023-12-21 16:10:20.659] EFI stub: Using DTB from configuration table

Do you connect display on your devkit?

Could you also verify with the latest JP5.1.3(L4T R35.5.0)?

@KevinFFF

Yes, display is connected. Will check with 5.1.3

Is this an issue with 5.1.2?