Hi Aswin,

On 29/01/2026 19:48, Aswin Murugan wrote:
> 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.

Excited to see support for this!

Without getting too deep into patch review yet, I have some high level
feedback with this approach.

Regarding SMEM, did you take a look at my old series refactoring that?
I'd like to resend it if you guys didn't pick it up yet.

The main issue that still needs to be solved is how we deal with the
multiple incompatible versions of the "ram_partition_table", this needs
to be detected and handled properly at runtime. Are there relevant
version fields in SMEM we can check?

Of note, with the smem refactor it won't be part of the driver model, it
will just look-up the SMEM node manually and use a global since that
vastly simplifies things since it can be called from so many contexts
including before the DM is set up.

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

This is definitely an overcomplication of the problem... Is there even a
time save here?

With new SMEM the udevice will go, the RAM partition table and socinfo
you should only fetch once and pass them around.

> 
> 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. Platform configuration: Enables the feature by default and
>    configures platform-specific IMEM sizes needed for storage
>    type detection (QCM6490/QCS615: 0x2B000, QCS9100: 0x59000).

I'm not suuuuper comfortable with this, particularly with zero
documentation on how to derive this value. I'm a little confused since I
thought the shared struct lived directly at SCL_IMEM_BASE? Or does this
vary per-platform?

I believe the right way to handle this would be to get this modelled
properly in DT, the whole imem region can be modelled as a reserved
memory node with a compatible string and a property describing the
offset of the shared imem data. Is this something you guys can push
upstream?

In the mean time, rather than offload this to the defconfig please just
drop in a table to map from SoC compatible (e.g. qcom,sc7280) to the
address of the shared imem cookie. Though this would very much be a
workaround until this can be modelled correctly in DT.

Kind regards,
> 
> [1] 
> https://github.com/qualcomm-linux/qcom-dtb-metadata/blob/main/Documentation.md
> 
> ---
> 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/[email protected]/
> 
> Aswin Murugan (3):
>   mach-snapdragon: Add generic SMEM cache infrastructure
>   mach-snapdragon: Add FIT multi-DTB selection support
>   configs: snapdragon: Enable FIT multi-DTB and configure IMEM
> 
>  arch/arm/mach-snapdragon/Kconfig             |   18 +
>  arch/arm/mach-snapdragon/Makefile            |    1 +
>  arch/arm/mach-snapdragon/board.c             |  112 ++
>  arch/arm/mach-snapdragon/qcom-priv.h         |   10 +
>  arch/arm/mach-snapdragon/qcom_fit_multidtb.c | 1237 ++++++++++++++++++
>  arch/arm/mach-snapdragon/qcom_fit_multidtb.h |  170 +++
>  arch/arm/mach-snapdragon/rampart.h           |  236 ++++
>  configs/qcm6490_defconfig                    |    2 +
>  configs/qcom_defconfig                       |    2 +
>  configs/qcom_qcs615_defconfig                |    2 +
>  configs/qcom_qcs9100_defconfig               |    1 +
>  include/soc/qcom/socinfo.h                   |  114 ++
>  12 files changed, 1905 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/rampart.h
>  create mode 100644 include/soc/qcom/socinfo.h
> 

-- 
// Casey (she/her)

Reply via email to