Re: [PATCH 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, Feb 22, 2018 at 11:04:47AM +0100, Maxime Ripard wrote:
> Hi Rob,
> 
> On Wed, Feb 21, 2018 at 09:20:45AM -0600, Rob Herring wrote:
> > On Sat, Feb 3, 2018 at 3:14 AM, Maxime Ripard <maxime.ripard@xxxxxxxxxxx> wrote:
> > > From: Heiko Stuebner <heiko.stuebner@xxxxxx>
> > >
> > > On i.MX, which carries a lot of pin-groups of which most are unused on
> > > individual boards, they noticed that this plethora of nodes also results
> > > in the runtime-lookup-performance also degrading [0].
> > >
> > > A i.MX-specific solution defining the pingroups in the board files but
> > > using macros to reference the pingroup-data was not well received.
> > >
> > > This patch is trying to solve this issue in a more general way, by
> > > adding the ability to mark nodes as needing to be referenced somewhere
> > > in the tree.
> > >
> > > To mark a node a needing to be referenced it must be prefixed with
> > > /delete-if-unreferenced/. This makes dtc check the nodes reference-status
> > > when creating the flattened tree, dropping it if unreferenced.
> > >
> > > For example, the i.MX6SL pingroup
> > >
> > >         /delete-if-unreferenced/ pinctrl_ecspi1_1: ecspi1grp-1 {
> > >                 fsl,pins = <
> > >                         MX6SL_PAD_ECSPI1_MISO__ECSPI1_MISO 0x100b1
> > >                         MX6SL_PAD_ECSPI1_MOSI__ECSPI1_MOSI 0x100b1
> > >                         MX6SL_PAD_ECSPI1_SCLK__ECSPI1_SCLK 0x100b1
> > >                 >;
> > >         };
> > 
> > This could also be out of band somewhere else in the tree or have a
> > newline after the tag, right? Like this:
> > 
> > /delete-if-unreferenced/ &pinctrl_ecspi1_1;
> > 
> > Otherwise, the line could get quite long if other tags are added.
> 
> Indeed, I'll make sure this is the case (if not already).

You can certainly put a newline after it - whitespace is not
significant to the parser outside of tokens.  Putting it somewhere
else in the tree by reference might involve some actual work.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[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