custom u-boot on Xavier (Solved)

Hi Anish,

Could you share what you’ve done in cboot source?

Also, I would like to know what is turned on and what is off now?

I have been successfully booting images off of TFTP server. The issue is that when extlinux capability is turned on in the cboot_t194.bin and cbo.dts is updated to boot off of TFTP first, the system hangs as seen in the attached logs.

It sounds like even disabling TFTP server and directly boot from emmc failed.

Hello Wayne,

The diff with the original cboot_src is below:

diff -rpubw cboot_orig/bootloader/partner/t18x/cboot/platform/t194/l4t.mk cboot_src/bootloader/partner/t18x/cboot/platform/t194/l4t.mk
--- cboot_orig/bootloader/partner/t18x/cboot/platform/t194/l4t.mk	2019-07-16 19:41:34.000000000 -0400
+++ cboot_src/bootloader/partner/t18x/cboot/platform/t194/l4t.mk	2019-09-10 08:09:02.484738302 -0400
@@ -16,6 +16,7 @@ GLOBAL_DEFINES += \
 	CONFIG_ENABLE_ETHERNET_BOOT=1 \
 	CONFIG_ENABLE_USB_MS=1 \
 	CONFIG_ENABLE_SECURE_BOOT=1 \
+	CONFIG_ENABLE_EXTLINUX_BOOT=1 \
 	CONFIG_ENABLE_DISPLAY=1 \
 	CONFIG_ENABLE_SHELL=1
 
Only in cboot_src: out

Regarding your second commend (#22), I didn’t understand why you say that booting from emmc fails. Here’s what’s failing and working for me:

cbo.dtb having “emmc” before “net” :

  1. With no change to the cboot source code, booting off of emmc works as expected. But of course no option to choose between different kernel entries present under /boot because of lack of support for CONFIG_ENABLE_EXTLINUX_BOOT.
  2. Adding CONFIG_ENABLE_EXTLINUX_BOOT=1 to the cboot_src also works as expected where during the boot process a kernel selection menu appears.

cbo.dtb having “net” before “emmc” :

  1. With no change to the cboot source code, booting the signed boot.img and *.dtb files off of the TFTP server works as expected.
  2. But when CONFIG_ENABLE_EXTLINUX_BOOT=1 is added to the cboot source code, the above method fails.

As you can see in the log that it downloads the boot.img and *.dtb files from the TFTP server, authenticates it, strips it off of the authentication tokens, loads it at the kernel_load_address, sets the kernel cmdline, but fails when (I think) tries to load the kernel at the address.

Since I couldn’t deduce anything from the failure information, it’s difficult for me to figure out what went wrong.

In brief, the error can be reproduced if

  1. Put net boot priority before emmc
  2. Enable CONFIG_ENABLE_EXTLINUX_BOOT in l4t.mk

Is that correct?

Hello Wayne,

Yes, that’s correct.

Hi anish,

Thanks for confirm. I am checking this with our internal team.

May I know what is your purpose to enable CONFIG_ENABLE_EXTLINUX_BOOT? Are you trying to implement something similar to PXE boot?

Hello Wayne,

Thank you.

As you may know that our company, Concurrent Real-Time develops a Real-Time OS called RedHawk. We release RedHawk for both x86, x86_64 and ARM64 architectures. We have been releasing RedHawk on top L4T kernels on all of NVIDIA’s Jetson platforms except NANO which will be released soon.

Regarding turning on the CONFIG_ENABLE_EXTLINUX_BOOT option in cboot, we usually release 6 flavors of RedHawk kernels and this feature helps us toggle between the kernels during boot time instead of flashing them each time. This feature also lets us compare the behavior of a bug between L4T kernel vs RedHawk kernel(s).

Regarding PXE booting, we currently have a mechanism to boot the Xaviers off of a TFTP server using the cbo.dtb file. But if we can get extlinux.conf file to be loaded from the TFTP server, if there’s such a plan, that will be great. But that’s not needed as such.

However, we want this bug fixed so that we could go back and forth between “net” boot vs “emmc” boot as we like.

Hope that answers your question.

Hi anish,

I notice the kernel image and ramdisk size seems to be 0 in your log. After checking the code, it looks an issue that would happen when CONFIG_ENABLE_EXTLINUX_BOOT is ON.

I am discussing it with our internal bootloader team. Once we have any conclusion, I will let you know.

Hi anish,

One more qeuestion…

What is your expectation or usecase for this ticket? I am not sure if there is any existing usecase that enables network boot + extlinux boot. Are you expecting there would be a menu for you to choose different images from TFTP server?

or you just want to try either net boot or emmc boot+ extlinux function and you notice extlinux would cause netboot to crash…?

Hello Wayne,

That’s interesting. I had not realized this before, no wonder the Xavier didn’t boot.

Please let me know if you need more info from my end to resolve this.

Hello Wayne,

We have our internal setup for Tegra boards (TX1, TX2 and NANO) where a pxelinux.cfg (similar as extlinux.conf) file is read during PXE boot and an option is presented to choose different kernels to boot from which will be downloaded from the TFTP server. But looking at the code I don’t think it will be a simple fix. Happy to be proved wrong :)

It’s an internal usecase and even though it would be great to have same behavior for Xavier as other Jetson boards, there’s no urgency or even necessity. We have a work around mechanism in place, currently.

However,

This feature would be great to have so we can, again for our internal development purposes keep toggling between kernels booted off of TFTP server and internal storage.

Hello Wayne,

BTW, I know couple of bugs with cboot, shall I mention it here or open a new post for each?

Hi anish,

Please file a new topic.

Also, unfortunately our cboot team confirmed extlinux boot is not yet supported and under development.
There would be no fix at this moment…

Hello Wayne,

Okay will open new topics for those.

And thank you for letting this know.