Skip to content

Support android boot image v3/v4

Safae Ouajih u-boot 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest19 patches 24 repliesIn review
  2. v217 patches 41 repliesSuperseded
  3. v117 patches 10 repliesSuperseded

Changes in v3 from the cover letter

- Ddd documentation for v3,v4 boot image header
- Add mkbootimg tool to Dockerfile
- Add full comments for functions/structs in include/image.h and include/android_image.h
- Add map_sysmem() to make the boot work on Sandbox
- Rename andr_vendor_img_hdr -> andr_vnd_boot_img_hdr

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19android: boot: rename andr_img_hdr -> andr_boot_img_hdr_v0boot/image-android.c boot/image-fdt.c cmd/abootimg.c +3 more+129 -330 replies
2/19android: boot: support vendor boot image in abootimgcmd/abootimg.c+15 -30 replies
3/19android: boot: replace android_image_check_headerboot/image-android.c boot/image-board.c cmd/abootimg.c +2 more+19 -290 replies
4/19android: boot: add boot image header v3 and v4 structuresinclude/android_image.h+182 -10 replies
5/19android: boot: kcomp: support andr_image_databoot/image-android.c include/android_image.h include/image.h+113 -10 replies
6/19android: boot: move to andr_image_data structureboot/image-android.c cmd/abootimg.c+81 -714 replies
7/19android: boot: content print is not supported for v3, v4 header versionboot/image-android.c+5 -10 replies
8/19android: boot: boot image header v3, v4 do not support recovery DTBOboot/image-android.c+2 -20 replies
9/19android: boot: add vendor boot image to prepare for v3, v4 supportboot/bootm.c boot/image-android.c boot/image-board.c +3 more+81 -394 replies
10/19android: boot: update android_image_get_data to support v3, v4boot/image-android.c include/android_image.h include/image.h+91 -31 reply
11/19android: boot: ramdisk: support vendor ramdiskboot/image-android.c include/image.h+13 -43 replies
12/19android: boot: support extra command lineboot/image-android.c+11 -00 replies
13/19android: boot: update android_image_get_dtb_img_addr to support v3, v4boot/image-android.c+33 -140 replies
14/19drivers: fastboot: zImage flashing is not supported for v3, v4drivers/fastboot/fb_mmc.c+8 -01 reply
15/19android: boot: support boot image header version 3 and 4boot/bootm.c boot/image-android.c boot/image-board.c +3 more+99 -231 reply
16/19android: boot: support bootconfigboot/image-android.c include/android_image.h+67 -20 replies
17/19doc: android: add documentation for v3, v4 boot image headerdoc/android/boot-image.rst+12 -12 replies
18/19test/py: android: extend abootimg testtest/py/tests/test_android/test_abootimg.py+123 -136 replies
19/19Dockerfile: add mkbootimg tooltools/docker/Dockerfile+4 -00 replies

Reviews trailers per patch

17 of 19 patches have a Reviewed-by or Acked-by.

PatchSimon GlassMattijs Korpershoek
SeriesT-b
1/19R-b R-b
2/19R-b R-b
3/19R-b R-b
4/19R-b R-b
5/19R-b R-b
6/19
7/19R-b R-b
8/19R-b R-b
9/19R-b R-b R-b
10/19R-b R-b
11/19R-b R-b
12/19R-b R-b
13/19R-b R-b
14/19R-b
15/19R-b
16/19R-b R-b
17/19R-b R-b
18/19R-b
19/19

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/19] Support android boot image v3/v4

Hello everyone,

* This is based on Roman Stratiienko's work to support boot image header version 3 and 4.

* This supports the new boot image headers v3, v4 and bootconfig feature.
https://source.android.com/docs/core/architecture/bootloader/boot-image-header
https://source.android.com/docs/core/architecture/bootloader/implementing-bootconfig

- Tested on Amlogic Khadas vim3l, a reference board for Android Open Source Project
https://www.khadas.com/vim3l

And on AM625 Texas Instruments board with 5.10 linux kernel

Main changes :
- New partition : vendor boot, with a specific vendor ramdisk
- DTB is stored in the vendor boot partition
- The generic ramdisk is placed after the vendor ramdisk
- Bootconfig feature support

Here is a link to see the related android boot flow changes on KHADAS vim3l as an example:
https://gitlab.baylibre.com/baylibre/amlogic/atv/u-boot/-/commits/souajih/BootImagev4/

Changes in v3:
- Ddd documentation for v3,v4 boot image header
- Add mkbootimg tool to Dockerfile
- Add full comments for functions/structs in include/image.h and include/android_image.h
- Add map_sysmem() to make the boot work on Sandbox
- Rename andr_vendor_img_hdr -> andr_vnd_boot_img_hdr

Changes in v2:
- Rework parts of the code to fix the abootimg test: test_abootimg
- Update test_abootimg to support boot image header v4
- Remove LIBXBC library, import and adapt the functions to support bootconfig feature
- Rename the used structures :

	andr_boot_img_hdr_v0_v1_v2 -> andr_boot_img_hdr_v0
       	andr_boot_img_hdr_v3_v4 -> andr_boot_img_hdr_v3
	andr_vendor_boot_img_hdr_v3_v4 -> andr_vendor_img_hdr

Safae Ouajih (19):
android: boot: rename andr_img_hdr -> andr_boot_img_hdr_v0
android: boot: support vendor boot image in abootimg
android: boot: replace android_image_check_header
android: boot: add boot image header v3 and v4 structures
android: boot: kcomp: support andr_image_data
android: boot: move to andr_image_data structure
android: boot: content print is not supported for v3,v4 header version
android: boot: boot image header v3,v4 do not support recovery DTBO
android: boot: add vendor boot image to prepare for v3,v4 support
android: boot: update android_image_get_data to support v3,v4
android: boot: ramdisk: support vendor ramdisk
android: boot: support extra command line
android: boot: update android_image_get_dtb_img_addr to support v3,v4
drivers: fastboot: zImage flashing is not supported for v3,v4
android: boot: support boot image header version 3 and 4
android: boot: support bootconfig
doc: android: add documentation for v3,v4 boot image header test/py: android: extend abootimg test
Dockerfile: add mkbootimg tool

 boot/bootm.c                                |  37 +-
 boot/image-android.c                        | 461 ++++++++++++++++----
 boot/image-board.c                          |  19 +-
 boot/image-fdt.c                            |   5 +-
 cmd/abootimg.c                              |  75 +++-
 doc/android/boot-image.rst                  |  13 +-
 drivers/fastboot/fb_mmc.c                   |  19 +-
 include/android_image.h                     | 228 +++++++++-
 include/image.h                             | 173 +++++++-
 test/py/tests/test_android/test_abootimg.py | 136 +++++-
 tools/docker/Dockerfile                     |   4 +
 11 files changed, 1009 insertions(+), 161 deletions(-)

--
2.34.1