u-boot/boot
Tom Rini d7a2c7ff75 Merge patch series "bootm: Handle compressed arm64 images with bootm"
To quote the author:

This little series corrects a problem I noticed with arm64 images,
where the kernel is not recognised if compression is used:

   U-Boot> tftp image.fit
   Using ethernet@7d580000 device
   TFTP from server 192.168.4.7; our IP address is 192.168.4.147
   Filename 'image.fit'.
   Load address: 0x1000000
   Loading: ##################################################  23 MiB
   	 20.5 MiB/s
   done
   Bytes transferred = 24118272 (1700400 hex)
   U-Boot> bootm
   ## Loading kernel from FIT Image at 01000000 ...
      Using 'conf-768' configuration
      Trying 'kernel' kernel subimage
        Description:  Linux
        Type:         Kernel Image (no loading done)
        Compression:  gzip compressed
        Data Start:   0x01000120
        Data Size:    13662338 Bytes = 13 MiB
      Verifying Hash Integrity ... OK
   Bad Linux ARM64 Image magic!

With this series:

   U-Boot> tftp 20000000 image.fit
   Using ethernet@7d580000 device
   TFTP from server 192.168.4.7; our IP address is 192.168.4.147
   Filename 'image.fit'.
   Load address: 0x20000000
   Loading: ##################################################  23.5 MiB
   	 20.8 MiB/s
   done
   Bytes transferred = 24642560 (1780400 hex)
   U-Boot> bootm 0x20000000
   ## Loading kernel from FIT Image at 20000000 ...
      Using 'conf-768' configuration
      Trying 'kernel' kernel subimage
        Description:  Linux
        Type:         Kernel Image (no loading done)
        Compression:  zstd compressed
        Data Start:   0x20000120
        Data Size:    14333475 Bytes = 13.7 MiB
      Verifying Hash Integrity ... OK
   Using kernel load address 80000
   ## Loading fdt from FIT Image at 20000000 ...
      Using 'conf-768' configuration
      Trying 'fdt-768' fdt subimage
        Description:  Raspberry Pi 4 Model B
        Type:         Flat Device Tree
        Compression:  zstd compressed
        Data Start:   0x215f820c
        Data Size:    9137 Bytes = 8.9 KiB
        Architecture: AArch64
      Verifying Hash Integrity ... OK
      Uncompressing Flat Device Tree to 3aff3010
      Booting using the fdt blob at 0x3aff3010
   Working FDT set to 3aff3010
      Uncompressing Kernel Image (no loading done) to 80000
   Moving Image from 0x80000 to 0x200000, end=2b00000
      Using Device Tree in place at 000000003aff3010, end 000000003afff4c4
   Working FDT set to 3aff3010

   Starting kernel ...

   [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]

The problem is that the arm64 magic is checked before the image is
decompressed. However this is only part of it. The kernel_noload image
type doesn't work with compression, since the kernel is not loaded. So
this series deals with that by using an lmb-allocated buffer for the
uncompressed kernel.

Another issue is that the arm64 handling is done too early, before the
image is loaded. This series moves it to after loading, so that
compression can be handled.

A patch is included to show the kernel load-address, so it is easy to
see what is going on.

One annoying feature of arm64 is that the image is often copied to
another address. It might be possible for U-Boot to figure that out
earlier and decompress it to the right place, but perhaps not.

With all of this it should be possible to boot a compressed kernel on
any of the 990 arm64 boards supported by Linux, although I have only
tested two.
2023-12-15 09:41:44 -05:00
..
android_ab.c crc32: Drop duplicates crc header includes 2023-08-08 17:41:52 -04:00
boot_fit.c global: Use proper project name U-Boot 2023-06-12 13:24:31 +02:00
bootdev-uclass.c bootstd: Skip over bad device during bootflows scanning 2023-11-10 11:01:50 -05:00
bootflow.c bootstd: Avoid freeing a non-allocated buffer 2023-11-17 11:58:26 -05:00
bootflow_internal.h bootstd: Support creating a boot menu 2023-01-16 18:26:50 -05:00
bootflow_menu.c expo: Rename exp_set_text_mode() 2023-07-14 12:54:51 -04:00
bootm.c Merge patch series "bootm: Handle compressed arm64 images with bootm" 2023-12-15 09:41:44 -05:00
bootm_os.c bootm: optee: Drop special call to bootm_find_other() 2023-12-13 11:51:24 -05:00
bootmeth-uclass.c bootstd: Add a command to read all files for a bootflow 2023-08-11 07:33:38 -06:00
bootmeth_cros.c bootstd: cros: Correct condition for read method 2023-11-01 12:26:44 -04:00
bootmeth_cros.h bootstd: cros: Bring in some ChromiumOS structures 2023-08-10 18:34:54 -06:00
bootmeth_efi.c bootstd: Avoid freeing a non-allocated buffer 2023-11-17 11:58:26 -05:00
bootmeth_efi_mgr.c bootstd: Fix a memory leak in the efi manager bootflow 2023-12-13 18:39:06 -05:00
bootmeth_extlinux.c bootstd: Adjust the default bootmeth order 2023-08-28 15:59:22 -04:00
bootmeth_pxe.c bootstd: Init the size before reading extlinux file 2023-08-03 15:30:54 -04:00
bootmeth_qfw.c bootstd: Correct the name of the QEMU bootmeth 2023-07-16 23:13:17 +08:00
bootmeth_sandbox.c bootstd: Rename distro and syslinux to extlinux 2023-05-13 09:52:32 -04:00
bootmeth_script.c bootstd: sata: Add bootstd support for ahci sata 2023-10-23 13:07:12 -04:00
bootretry.c cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
bootstd-uclass.c bootstd: Remove special-case code for boot_targets 2023-01-23 18:11:39 -05:00
cedit.c expo: Plumb in textline to cedit 2023-10-11 15:43:55 -04:00
common_fit.c Create a new boot/ directory 2021-11-11 19:01:56 -05:00
expo.c expo: Correct background colour 2023-11-14 20:04:00 -07:00
expo_build.c expo: Support building an expo with a textline 2023-10-11 15:43:55 -04:00
fdt_region.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
fdt_simplefb.c Move fdt_simplefb to boot/ 2023-09-19 11:36:25 -04:00
fdt_support.c fdt: Improve the comment for fdt_shrink_to_minimum() 2023-12-13 18:39:05 -05:00
image-android-dt.c doc: replace @return by Return: 2022-01-19 18:11:34 +01:00
image-android.c android: boot: support bootconfig 2023-04-04 14:50:47 -04:00
image-board.c boot: Drop size parameter from image_setup_libfdt() 2023-12-13 18:39:05 -05:00
image-cipher.c Create a new boot/ directory 2021-11-11 19:01:56 -05:00
image-fdt.c fdt: Move ft_verify_fdt() before the final fixups 2023-12-13 18:39:05 -05:00
image-fit-sig.c mkimage: fit: Fix signing of configs with external data 2022-10-26 11:36:06 -04:00
image-fit.c image: Allow loading a FIT image for a particular phase 2022-10-31 11:02:45 -04:00
image-host.c Create a new boot/ directory 2021-11-11 19:01:56 -05:00
image-pre-load.c boot: image-pre-load: Check environment for location of signature info 2022-10-11 15:40:48 -04:00
image-sig.c boot: Remove unused NEEDS_MANUAL_RELOC code bits 2023-09-14 10:42:24 -04:00
image.c image: Show the load address when decompressing 2023-12-15 09:41:38 -05:00
Kconfig bootstd: Introduce programmatic boot 2023-12-13 11:51:24 -05:00
Makefile bootstd: Introduce programmatic boot 2023-12-13 11:51:24 -05:00
prog_boot.c bootstd: Introduce programmatic boot 2023-12-13 11:51:24 -05:00
pxe_utils.c x86: pxeboot: bugfix: Set variable for size of initrd 2023-09-22 06:03:46 +08:00
scene.c expo: Plumb in textlines to a scene 2023-10-11 15:43:55 -04:00
scene_internal.h expo: Plumb in textlines to a scene 2023-10-11 15:43:55 -04:00
scene_menu.c expo: Allow rendering the background of any object 2023-10-11 15:43:55 -04:00
scene_textline.c expo: Support opening a textline 2023-10-11 15:43:55 -04:00
vbe.c boot: fix vbe_find_first_device() 2022-08-26 16:32:59 -06:00
vbe_request.c dm: core: Reverse the argument order in ofnode_copy_props() 2023-10-06 14:38:12 -04:00
vbe_simple.c boot: vbe_simple: Fix vbe_simple_read_bootflow() dependency 2023-04-28 11:30:17 -06:00
vbe_simple.h vbe: Move OS implementation into a separate file 2022-10-31 11:03:36 -04:00
vbe_simple_fw.c bootstd: Treat DHCP and PXE as bootdev labels 2023-01-23 18:11:41 -05:00
vbe_simple_os.c dm: core: Reverse the argument order in ofnode_copy_props() 2023-10-06 14:38:12 -04:00