Re: [PATCH v5] kernel-fit-image: allow extending compatible string property for DTBs

Dmitry Baryshkov
2025-10-11T20:07:55Z

On Sat, Oct 11, 2025 at 03:18:15PM +0530, Kavinaya S wrote:
> The Linux kernel allows multiple DTBs to share the same compatible string.
> For example:
> qcs6490-rb3gen2.dtb
> qcs6490-rb3gen2-vision-mezzanine.dtb
> qcs6490-rb3gen2-industrial-mezzanine.dtb
>
> All of these use the same base compatible string:
> compatible = "qcom,qcs6490-rb3gen2", "qcom,qcm6490";
>
> Since the latter two DTBs are overlays on top of the base DTB and do not
> modify platform properties, they retain the same compatible string.
>
> When these DTBs are bundled into a single fitImage, the bootloader cannot
> distinguish between them due to identical compatible strings.
>
> To address this, introduce a mechanism to extend the compatible string
> using a OE build variable:
> FIT_DTB_COMPATIBLE_EXTENTION[dtb_name] = "extension"
>

[...]

> +FIT_DTB_COMPATIBLE_EXTENTION ?= ""
> diff --git a/meta/lib/oe/fitimage.py b/meta/lib/oe/fitimage.py
> index f303799155..98af4aad14 100644
> --- a/meta/lib/oe/fitimage.py
> +++ b/meta/lib/oe/fitimage.py
> @@ -289,7 +289,7 @@ class ItsNodeRootKernel(ItsNode):
> self._kernel = kernel_node
>
> def fitimage_emit_section_dtb(self, dtb_id, dtb_path, dtb_loadaddress=None,
> - dtbo_loadaddress=None, add_compatible=False):
> + dtbo_loadaddress=None, add_compatible=False, compatible_extention=""):

I don't think this completely fulfills our needs. We have a usecase,
where we want to supply a complete compatible string (in order to build
the DTB fitImage. It would be much nicer to be able to specify the whole
compatible string here rather than just specifying an extension (and
still having to hack the function later).

> """Emit the fitImage ITS DTB section"""
> load=None
> dtb_ext = os.path.splitext(dtb_path)[1]

--
With best wishes
Dmitry