All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v5 0/5] Add FIT multi-DTB selection for Qualcomm
@ 2026-10-12 17:07 Aswin Murugan
  2026-10-12 17:07 ` [PATCH RESEND v5 1/5] misc: qcom: Add HW-Info aggregator driver Aswin Murugan
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Aswin Murugan @ 2026-10-12 17:07 UTC (permalink / raw)
  To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
	quic_varada, neil.armstrong, sumit.garg, u-boot,
	balaji.selvanathan, Michael.Srba, nathbappai, jbx6244,
	quentin.schulz, anshuld, marcello.bauer, tan.siewert, u-boot-qcom

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 at boot.

Qualcomm FIT-based DTB format is documented in [1].

The FIT image contains only DTBs, while the kernel is provided
separately as part of a UKI image.

The implementation consists of:

1. Hardware detection infrastructure: Introduces the qcom,hwinfo
   driver and qcom_hwdetect helper to collect hardware identification
   data from SMEM, IMEM and TCSR into a single qcom_hw_params
   structure for consumers such as FIT multi-DTB selection.

2. FIT multi-DTB selection: Implements DTB selection based on the
   aggregated hardware information. The code parses metadata DTBs,
   matches FIT configurations against detected hardware attributes,
   applies overlays, and loads the selected DTB for EFI boot.

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

---

Changes in v4:
1. Drop the SMEM cache infrastructure.

2. misc: qcom: add qcom,hwinfo driver to provide a common interface
   for reading IMEM boot cookie and TCSR SOC version information.

3. arm: snapdragon: add qcom_hwdetect helper to aggregate hardware
   information from SMEM, IMEM and TCSR into a single
   struct qcom_hw_params.

4. Refactor FIT multi-DTB selection to consume qcom_hw_params instead
   of accessing SMEM, IMEM and TCSR data directly.

5. Separate hardware discovery from FIT parsing and DTB matching
   logic, reducing complexity and improving code organization.

6. Load FIT images directly from a raw GPT partition and remove the
   FAT filesystem image based loading approach.

7. Drop IH_TYPE_FATFS, mkimage FAT image generation support and
   related documentation updates.

8. arm: dts: enable qcom,hwinfo on qcs9100-ride-r3, qcs615-ride and
   qcs6490-rb3gen2 by adding the required qcom,hwinfo DT nodes and
   board-specific offsets.

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

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:
1. 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 via U-Boot (5):
  misc: qcom: Add HW-Info aggregator driver
  mach-snapdragon: Add hardware detection helper
  mach-snapdragon: Add FIT multi-DTB selection support
  configs: qcom_defconfig: Enable QCOM_FIT_MULTIDTB
  arm: dts: Enable qcom, hwinfo on qcs9100-ride-r3, qcs615-ride and
    qcs6490-rb3gen2

 arch/arm/dts/qcs615-ride-u-boot.dtsi         |   10 +
 arch/arm/dts/qcs6490-rb3gen2-u-boot.dtsi     |   10 +
 arch/arm/dts/qcs9100-ride-r3-u-boot.dtsi     |   10 +
 arch/arm/mach-snapdragon/Kconfig             |   17 +
 arch/arm/mach-snapdragon/Makefile            |    2 +
 arch/arm/mach-snapdragon/board.c             |    7 +
 arch/arm/mach-snapdragon/qcom_fit_multidtb.c | 1033 ++++++++++++++++++
 arch/arm/mach-snapdragon/qcom_fit_multidtb.h |   61 ++
 arch/arm/mach-snapdragon/qcom_hwdetect.c     |  167 +++
 arch/arm/mach-snapdragon/qcom_hwdetect.h     |   52 +
 configs/qcom_defconfig                       |    2 +
 drivers/misc/Kconfig                         |    9 +
 drivers/misc/Makefile                        |    1 +
 drivers/misc/qcom_hwinfo.c                   |  160 +++
 include/qcom_hwinfo.h                        |  109 ++
 15 files changed, 1650 insertions(+)
 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/qcom_hwdetect.c
 create mode 100644 arch/arm/mach-snapdragon/qcom_hwdetect.h
 create mode 100644 drivers/misc/qcom_hwinfo.c
 create mode 100644 include/qcom_hwinfo.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-10-16 16:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 17:07 [PATCH RESEND v5 0/5] Add FIT multi-DTB selection for Qualcomm Aswin Murugan
2026-10-12 17:07 ` [PATCH RESEND v5 1/5] misc: qcom: Add HW-Info aggregator driver Aswin Murugan
2026-10-12 17:07 ` [PATCH RESEND v5 2/5] mach-snapdragon: Add hardware detection helper Aswin Murugan
2026-10-12 17:07 ` [PATCH RESEND v5 3/5] mach-snapdragon: Add FIT multi-DTB selection support Aswin Murugan
2026-10-12 17:07 ` [PATCH RESEND v5 4/5] configs: qcom_defconfig: Enable QCOM_FIT_MULTIDTB Aswin Murugan
2026-10-12 17:07 ` [PATCH RESEND v5 5/5] arm: dts: Enable qcom, hwinfo on qcs9100-ride-r3, qcs615-ride and qcs6490-rb3gen2 Aswin Murugan
2026-10-12 17:50 ` [PATCH RESEND v5 0/5] Add FIT multi-DTB selection for Qualcomm Tom Rini
2026-10-13  7:20   ` Aswin Murugan
2026-10-13 15:03     ` Tom Rini
2026-10-16 12:15       ` Sumit Garg
2026-10-16 16:27         ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.