[PATCH v3 0/7] Add FIT multi-DTB selection for Qualcomm platforms

Aswin Murugan aswin.murugan at oss.qualcomm.com
Fri Apr 17 14:09:44 CEST 2026


This series adds dynamic device tree selection from FIT images for
Qualcomm Snapdragon platforms, enabling U-Boot to select the
appropriate DTB based on hardware parameters detected from SMEM.

Qualcomm fit based DTB format is documented in [1]
The fit image contains only DTB, while the kernel will be part of UKI image.

The implementation consists of three parts:

1. SMEM cache infrastructure: Provides cached access to commonly
   used SMEM data (socinfo, RAM partitions) to avoid redundant
   lookups during boot. Includes socinfo header from Linux kernel
   for SoC identification.

2. FIT multi-DTB selection: Implements the core selection logic
   that reads hardware parameters from SMEM, parses metadata DTB,
   matches FIT configurations, and loads the selected DTB with
   overlays. Integrates with EFI boot flow by setting fdt_addr.

3. mkimage: add fatfs image type for FAT partition images
   Added fatimage.c handler that uses mkfs.vfat and mcopy to create
   FAT images from a directory.

[1] https://github.com/qualcomm-linux/qcom-dtb-metadata/blob/main/Documentation.md

---
Changes in v3:
1. Runtime IMEM address lookup via DT: Removed CONFIG_QCOM_IMEM_SIZE Kconfig option.
   Added qcom_imem_table[] mapping SoC compatible strings to IMEM addresses.

2. Split SoC version sources: SoC hardware version now read from TCSR register via
   qcom_read_tcsr_soc_version(). The soc_info->plat_ver from SMEM is stored separately
   as board_version. Added socver and boardrev metadata node matching for finer-grained DTB selection.

3. qcom_load_fit_image() returns int: Changed return type from efi_status_t to int,
   returning standard Linux error codes for consistency with the rest of the driver.

4. Code cleanup: strtok() replaced with strsep(); memcpy + manual null-termination replaced with strlcpy();
   DDR thresholds use SZ_* macros; compatible matching and FDT loading extracted into dedicated helpers.

5. image: add IH_TYPE_FATFS image type: Added new fatfs image type to represent a raw FAT
   filesystem partition image, registered in the image type lookup table.

6. mkimage: add fatfs image type for FAT partition images: Added fatimage.c handler that
   uses mkfs.vfat and mcopy to create FAT images from a directory.
   New --fat-extra-space, --fat-type, --fat-volume-id, --fat-mkfs-opts long options added
   to mkimage.

7. doc: document mkimage fatfs type and Qualcomm multi-DTB: Updated 'doc/mkimage.1' for the new
   fatfs type and options. Added 'doc/board/qualcomm/multi_dtb.rst' covering FIT ITS configuration,
   QCOM metadata format, socver/boardrev guidelines, and image creation steps.

Link to v2:
https://lore.kernel.org/u-boot/20260129184817.224101-1-aswin.murugan@oss.qualcomm.com/

Changes in v2:
- In v1, a combined DTB format was used for multi-DTB support. Based on
  feedback, v2 implements FIT-based DTB selection instead.
- Link to v1: https://lore.kernel.org/all/20260106122134.2047864-1-aswin.murugan@oss.qualcomm.com/

Aswin Murugan (7):
  mach-snapdragon: Add generic SMEM cache infrastructure
  mach-snapdragon: Add FIT multi-DTB selection support
  configs: snapdragon: Enable FIT multi-DTB and configure IMEM
  image: add IH_TYPE_FATFS image type
  mkimage: add fatfs image type for FAT partition images
  doc: document mkimage fatfs type and Qualcomm multi-DTB
  mach-snapdragon: Reorder header includes

 arch/arm/mach-snapdragon/Kconfig             |    8 +
 arch/arm/mach-snapdragon/Makefile            |    1 +
 arch/arm/mach-snapdragon/board.c             |  123 +-
 arch/arm/mach-snapdragon/qcom-priv.h         |   24 +
 arch/arm/mach-snapdragon/qcom_fit_multidtb.c | 1103 ++++++++++++++++++
 arch/arm/mach-snapdragon/qcom_fit_multidtb.h |  189 +++
 arch/arm/mach-snapdragon/rampart.h           |  225 ++++
 boot/image.c                                 |    1 +
 configs/qcom_defconfig                       |    2 +
 doc/board/qualcomm/index.rst                 |    1 +
 doc/board/qualcomm/multi_dtb.rst             |  352 ++++++
 doc/mkimage.1                                |  103 ++
 include/image.h                              |    1 +
 include/soc/qcom/socinfo.h                   |  114 ++
 tools/Makefile                               |    1 +
 tools/fatimage.c                             |  495 ++++++++
 tools/fatimage.h                             |   25 +
 tools/mkimage.c                              |   21 +
 tools/mkimage.h                              |   15 +
 19 files changed, 2793 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/mach-snapdragon/qcom_fit_multidtb.c
 create mode 100644 arch/arm/mach-snapdragon/qcom_fit_multidtb.h
 create mode 100644 arch/arm/mach-snapdragon/rampart.h
 create mode 100644 doc/board/qualcomm/multi_dtb.rst
 create mode 100644 include/soc/qcom/socinfo.h
 create mode 100644 tools/fatimage.c
 create mode 100644 tools/fatimage.h

-- 
2.34.1



More information about the U-Boot mailing list