zephyr/scripts/dts/test-bindings
Ulf Magnusson b97ed9e4b4 scripts: dts: Generalize handling of phandle-array types
Generating generic information for 'type: phandle-array' properties in
edtlib was difficult due to defining phandle-array as just a list of
phandles and numbers. To make sense of a phandle-array property like
'pwms', you have to know that #pwm-cells is expected to appear on
each referenced controller, and that the binding for the controller has
a #cells.

Because of this, handling of various 'type: phandle-array' properties
was previously hardcoded in edtlib and exposed through properties like
Node.pwms, instead of through the generic Node.props (though with a lot
of shared code).

In practice, it turns out that all 'type: phandle-array' properties in
Zephyr work exactly the same way: They all have names that end in -s,
the 's' is removed to derive the name of related properties, and they
all look up #cells in the binding for the controller, which gives names
to the data values.

Strengthen the definition of 'type: phandle-array' to mean a property
that works exactly like the existing phandle-array properties (which
also means requiring that the name ends in -s). This removes a ton of
hardcoding from edtlib and allows new 'type: phandle-array' properties
to be added without making any code changes.

If we ever need a property type that's a list of phandles and numbers
but that doesn't follow this scheme, then we could add a separate type
for it. We should check if the standard scheme is fine first though.

The only property type for which no information is generated is now
'compound'.

There's some inconsistency in how we generate identifiers for clocks
compared to other 'type: phandle-array' properties, so keep
special-casing them for now in gen_defines.py (see the comment in
write_clocks()).

This change also enabled a bunch of other simplifications, like reusing
the ControllerAndData class for interrupts.

Piggyback generalization of *-map properties so that they work for any
phandle-array properties. It's now possible to have things like
'io-channel-map', if you need to.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-26 15:30:23 -07:00
..
bar-bus.yaml scripts: dts: Change 'child/parent: bus: ...' to 'child/parent-bus:' 2019-09-17 14:37:43 -05:00
child-binding.yaml scripts: dts: Replace 'sub-node:' with more general 'child-binding:' 2019-09-19 08:39:22 -05:00
child.yaml scripts: edtlib: Add backwards compatibility for 'category:' 2019-09-07 10:25:02 -05:00
defaults.yaml dts: edtlib: Support giving missing properties a default value 2019-09-09 08:47:49 -05:00
deprecated-include.yaml scripts: edtlib: Add backwards compatibility for 'category:' 2019-09-07 10:25:02 -05:00
deprecated.yaml scripts: dts: Replace 'sub-node:' with more general 'child-binding:' 2019-09-19 08:39:22 -05:00
device-on-bar-bus.yaml scripts: dts: Change 'child/parent: bus: ...' to 'child/parent-bus:' 2019-09-17 14:37:43 -05:00
device-on-foo-bus.yaml scripts: dts: Change 'child/parent: bus: ...' to 'child/parent-bus:' 2019-09-17 14:37:43 -05:00
false-positive.yaml scripts: dts: Generalize handling of phandle-array types 2019-09-26 15:30:23 -07:00
foo-bus.yaml scripts: dts: Change 'child/parent: bus: ...' to 'child/parent-bus:' 2019-09-17 14:37:43 -05:00
foo-optional.yaml scripts: edtlib: Make order irrelevant when including multiple files 2019-09-11 07:50:30 -05:00
foo-required.yaml scripts: edtlib: Make order irrelevant when including multiple files 2019-09-11 07:50:30 -05:00
gpio-dst.yaml scripts: dts: Generalize handling of phandle-array types 2019-09-26 15:30:23 -07:00
gpio-src.yaml scripts: dts: Generalize handling of phandle-array types 2019-09-26 15:30:23 -07:00
grandchild-1.yaml scripts: dts: Improve syntax and code for including binding files 2019-09-07 10:25:02 -05:00
grandchild-2.yaml scripts: dts: Improve syntax and code for including binding files 2019-09-07 10:25:02 -05:00
grandchild-3.yaml scripts: dts: Change 'child/parent: bus: ...' to 'child/parent-bus:' 2019-09-17 14:37:43 -05:00
interrupt-1-cell.yaml scripts: dts: Simplify and improve 'compatible' matching 2019-09-07 10:25:02 -05:00
interrupt-2-cell.yaml scripts: dts: Simplify and improve 'compatible' matching 2019-09-07 10:25:02 -05:00
interrupt-3-cell.yaml scripts: dts: Simplify and improve 'compatible' matching 2019-09-07 10:25:02 -05:00
multidir.yaml scripts: dts: Simplify and improve 'compatible' matching 2019-09-07 10:25:02 -05:00
order-1.yaml scripts: edtlib: Make order irrelevant when including multiple files 2019-09-11 07:50:30 -05:00
order-2.yaml scripts: edtlib: Make order irrelevant when including multiple files 2019-09-11 07:50:30 -05:00
parent.yaml scripts: dts: Simplify and improve 'compatible' matching 2019-09-07 10:25:02 -05:00
phandle-array-controller-1.yaml scripts: dts: Generalize handling of phandle-array types 2019-09-26 15:30:23 -07:00
phandle-array-controller-2.yaml scripts: dts: Generalize handling of phandle-array types 2019-09-26 15:30:23 -07:00
props.yaml scripts: dts: Generalize handling of phandle-array types 2019-09-26 15:30:23 -07:00