Re: [PATCH v2 1/2] dtc: add ability to make nodes conditional on them being referenced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, May 3, 2018 at 3:27 PM, Maxime Ripard <maxime.ripard@xxxxxxxxxxx> wrote:
> A number of platforms have a need to reduce the number of DT nodes,
> mostly because of two similar constraints: the size of the DT blob, and
> the time it takes to parse it.
>
> As the DT is used in more and more SoCs, and by more projects, some
> constraints start to appear in bootloaders running from SRAM with an
> order of magnitude of 10kB. A typical DT is in the same order of
> magnitude, so any effort to reduce the blob size is welcome in such an
> environment.
>
> Some platforms also want to reach very fast boot time, and the time it
> takes to parse a typical DT starts to be noticeable.
>
> Both of these issues can be mitigated by reducing the number of nodes in
> the DT. The biggest provider of nodes is usually the pin controller and
> its subnodes, usually one for each valid pin configuration in a given
> SoC.
>
> Obviously, a single, fixed, set of these nodes will be used by a given
> board, so we can introduce a node property that will tell the DT
> compiler to drop the nodes when they are not referenced in the tree, and
> as such wouldn't be useful in the targetted system.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@xxxxxxxxxxx>
>
> ---
> Changes from v1:
>   - Rename the property from delete-if-unreferenced to omit-if-no-ref
>   - Change the various variables in the code to reflect this
>   - Added support to set the property on a label instead of a full node
>   - Also take into account the reference by path, and not only by
>     phandle
>   - Prune the unused nodes in a fixup pass, and not during the tree
>     flattening that allows to have the same behaviour when having an
>     output to a format other than dtb or asm
>   - Rebased on current master
> ---
>  checks.c     | 13 +++++++++++++
>  dtc-lexer.l  |  7 +++++++
>  dtc-parser.y | 17 +++++++++++++++++
>  dtc.h        |  4 ++++
>  livetree.c   | 14 ++++++++++++++
>  5 files changed, 55 insertions(+)

Not intimately familiar with some parts of this code, but FWIW:

Reviewed-by: Rob Herring <robh@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux