[RFC PATCH] imx: skip unused compatible strings in drivers

Marek Vasut marex at denx.de
Tue May 26 14:00:40 CEST 2020

On 5/26/20 1:58 PM, Anatolij Gustschin wrote:
> On Tue, 26 May 2020 13:25:00 +0200
> Marek Vasut marex at denx.de wrote:
>> On 5/26/20 1:12 PM, Soeren Moch wrote:
>>> On 25.05.20 22:24, Anatolij Gustschin wrote:  
>>>> Converting to DM increases binary size and breaks building some
>>>> boards (i.e. tbs2910, gcc 9.2). The approach to address this issue
>>>> via cutting off unused properties/nodes in device tree via custom
>>>> u-boot.dtsi was not welcome, even if the affected boards do not
>>>> pass the built-in device tree to the kernel.  
>>> But there is CONFIG_OF_REMOVE_PROPS="dmas dma-names interrupt-parent
>>> interrupts interrupts-extended interrupt-names interrupt-map
>>> interrupt-map-mask" in tbs2910_defconfig. So removing properties is
>>> already done via this config option. Removing nodes is not implemented
>>> (yet? AFAIK). But would be welcome if someone implements this in a
>>> similar way, I think.  
>> Why don't we turn this the other way around -- put the { compat string ,
>> driver } tuple list into a U-Boot linker list, then filter this linker
>> list against a DT which will be used for the platform (what if there are
>> multiple DTs?), and then scrub all unreferrenced symbols.
> This might be a topic again when new bloat causes build breakage
> again. For now I've succeeded to build the tbs2910 board with
> default CI tool chain without this patch (by making DM_VIDEO parts
> optional). Stripping unused compatible entries doesn't save much here
> (around 800 bytes). So the question is if it is worth the effort
> to implement such scrubbing.

It is if you can remove all the unused compatibles and all the
data/rodata they reference. I think it would be nice to prototype this
at least and see how much this really saves. I suspect for SPL this
might be interesting even more.

More information about the U-Boot mailing list