On Fri, Feb 20, 2015 at 02:11:02AM +0530, Nikhil Devshatwar wrote:
> This patch changes the dtc grammar to allow following syntax
>
> i2cexp: &i2c2 {
> ...
> };
>
> Current device tree compiler allows to define multiple labels when defining
> the device node the first time. Typically device nodes are defined in
> DTSI files. Now these nodes can be overwritten for updating some of the
> properties. Typically, device nodes are overridden in DTS files.
>
> When working with adapter boards, most of the time adapter board can fit to
> multiple base boards. But depending on which base board it is connected to,
> the devices on the adapter board would be children of different devices.
>
> e.g. On dra7-evm.dts, i2c2 is exported for expansion connector whereas
> on dra72-evm.dts, i2c5 is exported for expansion connector.
> This causes a problem when writing a generic device tree file for
> the adapter board. Because, you cannot know whether all the devices on
> adapter board are present on i2c or i2c5.
>
> The problem can be solved by adding a common label (e.g. i2cexp) in both
> of the DTS files when overriding the device nodes for i2c2 or i2c5.
> This way, generic adapter board file would override the i2cexp. And
> depending on which base board you use the adapter board, all the devices
> are automatically added for correct device nodes.
>
> Signed-off-by: Nikhil Devshatwar <[email protected]>
Applied, thanks.
I did tweak the testcase to use dtbs_unordered_equal instead of going
through the set of tree1 tests.
The fact that you can only apply a single label by this method is a
bit of a wart, but it's something we can fix later. I had a look at
it and (as I suspect you already discovered) it's surprisingly
complicated to do so.
--
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
pgpdYN9Zuaw5H.pgp
Description: PGP signature
