[PATCH] arm64: dts: mediatek: Apply all DT overlays at build time

Rob Herring (Arm) posted 1 patch 2 weeks ago
arch/arm64/boot/dts/mediatek/Makefile | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
[PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by Rob Herring (Arm) 2 weeks ago
It's a requirement that DT overlays be applied at build time in order to
validate them as overlays are not validated on their own.

Add targets for all the Mediatek overlays.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
This will soon be a warning[1].

Note that if it is desired that the combined .dtb is not installed, then
the combined .dtb should be added to 'dtb-' variable instead.

[1] https://lore.kernel.org/all/20251114222759.4181152-1-robh@kernel.org/
---
 arch/arm64/boot/dts/mediatek/Makefile | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
index a4df4c21399e..4e92bd9f0e53 100644
--- a/arch/arm64/boot/dts/mediatek/Makefile
+++ b/arch/arm64/boot/dts/mediatek/Makefile
@@ -15,16 +15,30 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-acelink-ew-7886cax.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-mini.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
+mt7986a-bananapi-bpi-r3-emmc-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-emmc.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
+mt7986a-bananapi-bpi-r3-nand-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-nand.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
+mt7986a-bananapi-bpi-r3-nor-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-nor.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
+mt7986a-bananapi-bpi-r3-sata-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-sata.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
+mt7986a-bananapi-bpi-r3-sd-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-sd.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
+mt7988a-bananapi-bpi-r4-emmc-dtbs := mt7988a-bananapi-bpi-r4.dtb mt7988a-bananapi-bpi-r4-emmc.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
+mt7988a-bananapi-bpi-r4-sd-dtbs := mt7988a-bananapi-bpi-r4.dtb mt7988a-bananapi-bpi-r4-sd.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm-hana.dtb
@@ -104,6 +118,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8390-genio-700-evk.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-kontron-3-5-sbc-i1200.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtbo
+mt8395-radxa-nio-12l-8-hd-panel-dtbs := mt8395-radxa-nio-12l.dtb mt8395-radxa-nio-12l-8-hd-panel.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb
 
 # Device tree overlays support
-- 
2.51.0
Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by AngeloGioacchino Del Regno 1 week, 6 days ago
Il 17/11/25 22:13, Rob Herring (Arm) ha scritto:
> It's a requirement that DT overlays be applied at build time in order to
> validate them as overlays are not validated on their own.
> 
> Add targets for all the Mediatek overlays.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> This will soon be a warning[1].
> 
> Note that if it is desired that the combined .dtb is not installed, then
> the combined .dtb should be added to 'dtb-' variable instead.
> 

Uhm, sorry, can't we do something such that we don't generate a DTB with a
preapplied overlay?

Even something like generating those and deleting before build finalization
could work, I guess, though that'd be hacky maybe.

I don't know if this is the case, but I'm worried that various people have
scripts to copy DTBs somewhere (in some partition) or embed those in images,
and if they get the preapplied overlay dtbs in the same place, havoc could
happen as the bootloaders might be selecting wrong dtbs (as a plus, there is
no dtbo that varies machine compatible strings, rightfully).

Cheers,
Angelo

> [1] https://lore.kernel.org/all/20251114222759.4181152-1-robh@kernel.org/
> ---
>   arch/arm64/boot/dts/mediatek/Makefile | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> index a4df4c21399e..4e92bd9f0e53 100644
> --- a/arch/arm64/boot/dts/mediatek/Makefile
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -15,16 +15,30 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-acelink-ew-7886cax.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-mini.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
> +mt7986a-bananapi-bpi-r3-emmc-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-emmc.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
> +mt7986a-bananapi-bpi-r3-nand-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-nand.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
> +mt7986a-bananapi-bpi-r3-nor-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-nor.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
> +mt7986a-bananapi-bpi-r3-sata-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-sata.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
> +mt7986a-bananapi-bpi-r3-sd-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-sd.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
> +mt7988a-bananapi-bpi-r4-emmc-dtbs := mt7988a-bananapi-bpi-r4.dtb mt7988a-bananapi-bpi-r4-emmc.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
> +mt7988a-bananapi-bpi-r4-sd-dtbs := mt7988a-bananapi-bpi-r4.dtb mt7988a-bananapi-bpi-r4-sd.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm-hana.dtb
> @@ -104,6 +118,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8390-genio-700-evk.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-kontron-3-5-sbc-i1200.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtbo
> +mt8395-radxa-nio-12l-8-hd-panel-dtbs := mt8395-radxa-nio-12l.dtb mt8395-radxa-nio-12l-8-hd-panel.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtb
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb
>   
>   # Device tree overlays support
Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by Rob Herring 1 week, 6 days ago
On Tue, Nov 18, 2025 at 3:36 AM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 17/11/25 22:13, Rob Herring (Arm) ha scritto:
> > It's a requirement that DT overlays be applied at build time in order to
> > validate them as overlays are not validated on their own.
> >
> > Add targets for all the Mediatek overlays.
> >
> > Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> > ---
> > This will soon be a warning[1].
> >
> > Note that if it is desired that the combined .dtb is not installed, then
> > the combined .dtb should be added to 'dtb-' variable instead.
> >
>
> Uhm, sorry, can't we do something such that we don't generate a DTB with a
> preapplied overlay?
>
> Even something like generating those and deleting before build finalization
> could work, I guess, though that'd be hacky maybe.
>
> I don't know if this is the case, but I'm worried that various people have
> scripts to copy DTBs somewhere (in some partition) or embed those in images,
> and if they get the preapplied overlay dtbs in the same place, havoc could
> happen as the bootloaders might be selecting wrong dtbs (as a plus, there is
> no dtbo that varies machine compatible strings, rightfully).

If they aren't using dtbs_install for that, then that is their
problem. When we moved all the arm32 DTs to vendor directories,
dtbs_install maintained the old structure which seemed sufficient to
not break folks. The same should apply here.

Rob
Aw: Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by Frank Wunderlich 1 week, 6 days ago
Hi,

this looks similar to my attempt i did here

https://patchwork.kernel.org/project/linux-mediatek/patch/20240608080530.9436-2-linux@fw-web.de/

But in my case i added full dtb with 2 overlays as there can be 2 devices (1 mmc + 1 spi) at one time.
So usable as dtb for bootloader config without overlays, not only for validation...

regards Frank


> Gesendet: Dienstag, 18. November 2025 um 13:31
> Von: "Rob Herring" <robh@kernel.org>
> An: "AngeloGioacchino Del Regno" <angelogioacchino.delregno@collabora.com>
> CC: "Matthias Brugger" <matthias.bgg@gmail.com>, "Krzysztof Kozlowski" <krzk+dt@kernel.org>, "Conor Dooley" <conor+dt@kernel.org>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org
> Betreff: Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
>
> On Tue, Nov 18, 2025 at 3:36 AM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
> >
> > Il 17/11/25 22:13, Rob Herring (Arm) ha scritto:
> > > It's a requirement that DT overlays be applied at build time in order to
> > > validate them as overlays are not validated on their own.
> > >
> > > Add targets for all the Mediatek overlays.
> > >
> > > Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> > > ---
> > > This will soon be a warning[1].
> > >
> > > Note that if it is desired that the combined .dtb is not installed, then
> > > the combined .dtb should be added to 'dtb-' variable instead.
> > >
> >
> > Uhm, sorry, can't we do something such that we don't generate a DTB with a
> > preapplied overlay?
> >
> > Even something like generating those and deleting before build finalization
> > could work, I guess, though that'd be hacky maybe.
> >
> > I don't know if this is the case, but I'm worried that various people have
> > scripts to copy DTBs somewhere (in some partition) or embed those in images,
> > and if they get the preapplied overlay dtbs in the same place, havoc could
> > happen as the bootloaders might be selecting wrong dtbs (as a plus, there is
> > no dtbo that varies machine compatible strings, rightfully).
> 
> If they aren't using dtbs_install for that, then that is their
> problem. When we moved all the arm32 DTs to vendor directories,
> dtbs_install maintained the old structure which seemed sufficient to
> not break folks. The same should apply here.
> 
> Rob
> 
>
Re: Aw: Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by AngeloGioacchino Del Regno 1 week, 5 days ago
Il 18/11/25 18:02, Frank Wunderlich ha scritto:
> Hi,
> 
> this looks similar to my attempt i did here
> 
> https://patchwork.kernel.org/project/linux-mediatek/patch/20240608080530.9436-2-linux@fw-web.de/
> 
> But in my case i added full dtb with 2 overlays as there can be 2 devices (1 mmc + 1 spi) at one time.
> So usable as dtb for bootloader config without overlays, not only for validation...
> 

Please don't top post :-)

That said, for the target of what is done here, I think yours is nicer to the eye
compared to Rob's (not his fault at all, most of the times overlays cannot be
applied together, he can't possibly know if that is possible in this case).

If there is really no other solution to that... well, at this point I prefer to
have something nicer to the eye, with all of the necessary "evil" that comes with
it.

P.S.: Strong words contained in this reply are meant to be lighter than they appear

Cheers,
Angelo

> regards Frank
> 
> 
>> Gesendet: Dienstag, 18. November 2025 um 13:31
>> Von: "Rob Herring" <robh@kernel.org>
>> An: "AngeloGioacchino Del Regno" <angelogioacchino.delregno@collabora.com>
>> CC: "Matthias Brugger" <matthias.bgg@gmail.com>, "Krzysztof Kozlowski" <krzk+dt@kernel.org>, "Conor Dooley" <conor+dt@kernel.org>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org
>> Betreff: Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
>>
>> On Tue, Nov 18, 2025 at 3:36 AM AngeloGioacchino Del Regno
>> <angelogioacchino.delregno@collabora.com> wrote:
>>>
>>> Il 17/11/25 22:13, Rob Herring (Arm) ha scritto:
>>>> It's a requirement that DT overlays be applied at build time in order to
>>>> validate them as overlays are not validated on their own.
>>>>
>>>> Add targets for all the Mediatek overlays.
>>>>
>>>> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
>>>> ---
>>>> This will soon be a warning[1].
>>>>
>>>> Note that if it is desired that the combined .dtb is not installed, then
>>>> the combined .dtb should be added to 'dtb-' variable instead.
>>>>
>>>
>>> Uhm, sorry, can't we do something such that we don't generate a DTB with a
>>> preapplied overlay?
>>>
>>> Even something like generating those and deleting before build finalization
>>> could work, I guess, though that'd be hacky maybe.
>>>
>>> I don't know if this is the case, but I'm worried that various people have
>>> scripts to copy DTBs somewhere (in some partition) or embed those in images,
>>> and if they get the preapplied overlay dtbs in the same place, havoc could
>>> happen as the bootloaders might be selecting wrong dtbs (as a plus, there is
>>> no dtbo that varies machine compatible strings, rightfully).
>>
>> If they aren't using dtbs_install for that, then that is their
>> problem. When we moved all the arm32 DTs to vendor directories,
>> dtbs_install maintained the old structure which seemed sufficient to
>> not break folks. The same should apply here.
>>
>> Rob
>>
>>


Re: Aw: Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by Frank Wunderlich 1 week, 5 days ago
Am 19. November 2025 09:39:07 MEZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:
>Il 18/11/25 18:02, Frank Wunderlich ha scritto:
>> Hi,
>> 
>> this looks similar to my attempt i did here
>> 
>> https://patchwork.kernel.org/project/linux-mediatek/patch/20240608080530.9436-2-linux@fw-web.de/
>> 
>> But in my case i added full dtb with 2 overlays as there can be 2 devices (1 mmc + 1 spi) at one time.
>> So usable as dtb for bootloader config without overlays, not only for validation...
>> 
>
>Please don't top post :-)

Sorry for that :(

>That said, for the target of what is done here, I think yours is nicer to the eye
>compared to Rob's (not his fault at all, most of the times overlays cannot be
>applied together, he can't possibly know if that is possible in this case).
>
>If there is really no other solution to that... well, at this point I prefer to
>have something nicer to the eye, with all of the necessary "evil" that comes with
>it.

If my version is ok for rob (afair he did not replied on that yet),i would resend it again with similar for R4 and R4Pro.

>P.S.: Strong words contained in this reply are meant to be lighter than they appear

>Cheers,
>Angelo

regards Frank
Re: Aw: Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by Rob Herring 1 week, 5 days ago
On Wed, Nov 19, 2025 at 3:26 AM Frank Wunderlich
<frank-w@public-files.de> wrote:
>
> Am 19. November 2025 09:39:07 MEZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:
> >Il 18/11/25 18:02, Frank Wunderlich ha scritto:
> >> Hi,
> >>
> >> this looks similar to my attempt i did here
> >>
> >> https://patchwork.kernel.org/project/linux-mediatek/patch/20240608080530.9436-2-linux@fw-web.de/
> >>
> >> But in my case i added full dtb with 2 overlays as there can be 2 devices (1 mmc + 1 spi) at one time.
> >> So usable as dtb for bootloader config without overlays, not only for validation...
> >>
> >
> >Please don't top post :-)
>
> Sorry for that :(
>
> >That said, for the target of what is done here, I think yours is nicer to the eye
> >compared to Rob's (not his fault at all, most of the times overlays cannot be
> >applied together, he can't possibly know if that is possible in this case).
> >
> >If there is really no other solution to that... well, at this point I prefer to
> >have something nicer to the eye, with all of the necessary "evil" that comes with
> >it.

Use 'dtb-' if you don't want to keep the targets (or can't agree if
you want to keep them or not).

> If my version is ok for rob (afair he did not replied on that yet),i would resend it again with similar for R4 and R4Pro.

Yes, please do.

Rob
Re: [PATCH] arm64: dts: mediatek: Apply all DT overlays at build time
Posted by Chen-Yu Tsai 1 week, 6 days ago
On Tue, Nov 18, 2025 at 5:36 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 17/11/25 22:13, Rob Herring (Arm) ha scritto:
> > It's a requirement that DT overlays be applied at build time in order to
> > validate them as overlays are not validated on their own.
> >
> > Add targets for all the Mediatek overlays.
> >
> > Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> > ---
> > This will soon be a warning[1].
> >
> > Note that if it is desired that the combined .dtb is not installed, then
> > the combined .dtb should be added to 'dtb-' variable instead.
> >
>
> Uhm, sorry, can't we do something such that we don't generate a DTB with a
> preapplied overlay?
>
> Even something like generating those and deleting before build finalization
> could work, I guess, though that'd be hacky maybe.
>
> I don't know if this is the case, but I'm worried that various people have
> scripts to copy DTBs somewhere (in some partition) or embed those in images,
> and if they get the preapplied overlay dtbs in the same place, havoc could
> happen as the bootloaders might be selecting wrong dtbs (as a plus, there is
> no dtbo that varies machine compatible strings, rightfully).

The in-tree scripts/make_fit.py can take a list of DTBs to pack, so
it's conceivable that someone would just use a wildcard path.

We do something similar downstream in ChromeOS, but we probably won't
get this change anytime soon.

OOTH the "make fit" target uses arch/arm64/boot/dts/dtbs-list , which
it seems is also used for DTB install?


ChenYu

> Cheers,
> Angelo
>
> > [1] https://lore.kernel.org/all/20251114222759.4181152-1-robh@kernel.org/
> > ---
> >   arch/arm64/boot/dts/mediatek/Makefile | 16 ++++++++++++++++
> >   1 file changed, 16 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> > index a4df4c21399e..4e92bd9f0e53 100644
> > --- a/arch/arm64/boot/dts/mediatek/Makefile
> > +++ b/arch/arm64/boot/dts/mediatek/Makefile
> > @@ -15,16 +15,30 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-acelink-ew-7886cax.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-mini.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
> > +mt7986a-bananapi-bpi-r3-emmc-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-emmc.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
> > +mt7986a-bananapi-bpi-r3-nand-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-nand.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
> > +mt7986a-bananapi-bpi-r3-nor-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-nor.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
> > +mt7986a-bananapi-bpi-r3-sata-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-sata.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
> > +mt7986a-bananapi-bpi-r3-sd-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-sd.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
> > +mt7988a-bananapi-bpi-r4-emmc-dtbs := mt7988a-bananapi-bpi-r4.dtb mt7988a-bananapi-bpi-r4-emmc.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
> > +mt7988a-bananapi-bpi-r4-sd-dtbs := mt7988a-bananapi-bpi-r4.dtb mt7988a-bananapi-bpi-r4-sd.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm-hana.dtb
> > @@ -104,6 +118,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8390-genio-700-evk.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-kontron-3-5-sbc-i1200.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtbo
> > +mt8395-radxa-nio-12l-8-hd-panel-dtbs := mt8395-radxa-nio-12l.dtb mt8395-radxa-nio-12l-8-hd-panel.dtbo
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtb
> >   dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb
> >
> >   # Device tree overlays support
>
>
>