bootz command on tegraTX1 not working


I am trying to use the bootz on the tegraTX1 development board. To no success for now.

I am using sources of the tegra-l4t-r23.1 release.

Unfortunately, the bootz command was not enabled in u-boot, so I had to enable it manually and recompile:

diff --git a/common/Kconfig b/common/Kconfig
index f6478fa..cfc1880 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -138,6 +138,12 @@ config CMD_BOOTM
          Boot an application image from the memory.
+config CMD_BOOTZ
+       bool "bootz"
+       default y
+       help
+         Boot zImage from memory.
 config CMD_GO
        bool "go"
        default y

So I reflashed and the command appeared in the list. Then I tried these commands:

ext4load mmc 0 ${kernel_addr_r} /boot/zImage
ext4load mmc 0 ${fdt_addr_r} /boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
bootz ${kernel_addr_r} - ${fdt_addr}

but result was:

Tegra210 (P2371-2180) # bootz ${kernel_addr_r} - ${fdt_addr}
Bad Linux ARM zImage magic!
Tegra210 (P2371-2180) #

Looking at sources of u-boot it seems to be searching for this number:

#define LINUX_ARM_ZIMAGE_MAGIC  0x016f2818

which doesn’t seem t be present in my zImage

hexdump -C -n 100 OUTPUT/arch/arm64/boot/zImage 
00000000  1f 8b 08 00 00 00 00 00  02 03 ec 5a 7b 50 54 67  |...........Z{PTg|
00000010  96 3f f7 01 34 88 b1 e5  2d 10 bb 1b f1 91 ce 54  |.?..4...-......T|
00000020  32 ab 80 90 64 e5 76 63  b2 6e c6 64 4c c3 64 4c  ||
00000030  b2 15 1a 3b ba ee 50 c9  0e d1 51 51 66 b8 20 63  |...;..P...QQf. c|
00000040  9c b8 9b 78 f1 c6 cc 66  b2 b1 01 b5 b4 6b ab e2  |...x...f.....k..|
00000050  18 48 a6 27 0f d0 24 ee  4e 51 d9 28 2c 4c 6a fe  |.H.'..$.NQ.(,Lj.|
00000060  18 1b 70 9d                                       |..p.|

Any ideas why zImage boot is not supported in aarch64?

Although I have not experimented with it, u-boot on L4T has supported zImage at least since R19.1. However, manual commands for loading a zImage may not have caught up. On a TX1 there may also be complications from needing both 32-bit and 64-bit support…this may have required disabling compression in order to mix 32/64-bit.

It gets more interesting if you look at the /boot/extlinux/extlinux.conf file. Instead of naming zImage, it names Image. A zImage does exist, but this isn’t what the boot loader points at. The file “Image” is a bit larger than zImage, and the “file” command claims Image is just data. I can’t say for certain, but I suspect once again that this is a complication of using both 32-bit and 64-bit compilers when building a kernel (which could also mean compression won’t be possible until switching from a mixed 32/64-bit to pure 64-bit…but this is a guess).

As an interesting experiment to convince yourself that /boot/zImage and /boot/Image are more or less the same file, do this and compare the two command outputs:

cat Image | strings | grep Linux
zcat zImage | strings | grep Linux

Or for proof:

cat Image | sha1sum
zcat zImage | sha1sum

I suspect things will return to “normal” when a pure 64-bit L4T is released (“yet another guess”). For now you might experiment with taking your zImage and creating Image:

zcat zImage > Image

Thanks for the clarifications. It indeed seems that zImage is just a gzipped version of Image, since checksums match. Actually, building zImage, Image is always produces as the source for zipping into zImage

make zImage
  OBJCOPY arch/arm64/boot/Image
  GZIP    arch/arm64/boot/zImage

Unfortunately, this fact still makes bootz command of u-boot unusable, no matter it could be successfully compiled in the u-boot image.

Since I was trying to find a simple way of booting, the only way to do it for now seems to be the sysboot command that is using /boot/extlinux/extlinux.conf

Hi again,

As I read through various sources found by G, it turns out that bootz is somehow deprecated, and is especially not used in 64 bit ARM versions. But there is booti for this purpose, it turns out.

So, this successfully booted a custom built kernel:

tftpboot $kernel_addr_r Image
tftpboot $fdt_addr_r tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
set bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p1 rw rootwait
booti $kernel_addr_r - $fdt_addr_r

NOTE: There is a little catch, however. Onboard ethernet doesn’t work with u-boot, nether do the USB3 host. Network boot is only possible with USB->Ethernet dongle plugged into the USB OTG interface. My experience with cheap dongles as the “dm9601” based blue translucent ones:

are not supported in u-boot. ASIX AX88772 USB 2.0 Ethernet, however, are OK.

According to kernel\Documentation\arm64\booting.txt, it says:

[i]3. Decompress the kernel image

Requirement: OPTIONAL

The AArch64 kernel does not currently provide a decompressor and
therefore requires decompression (gzip etc.) to be performed by the boot
loader if a compressed Image target (e.g. Image.gz) is used. For
bootloaders that do not implement this requirement, the uncompressed
Image target is available instead.[/i]

Hope it can explain.