zephyr/scripts/dts
Ulf Magnusson 88db84b89b dts: edtlib: Turn Node.instance_no into EDT.compat2enabled
Add an EDT.compat2enabled attribute that maps compatibles to enabled
devicetree nodes that implement them. For example,
EDT.compat2enabled["foo"] is a list of all enabled nodes with "foo" in
the 'compatible' property.

The old Node.instance_no functionality can be implemented in terms of
EDT.compat2enabled, so remove Node.instance_no. EDT.compat2enabled is
more flexible and easier to understand.

Simplify main() in gen_defines.py by using EDT.compat2enabled to
generate the DT_COMPAT_<compatible> existence macros. The behavior is
slightly different now, as DT_COMPAT_<compatible> is generated for
enabled nodes that don't have a binding as well, but that might be an
improvement overall. It probably doesn't hurt at least.

EDT.compat2enabled simplifies the implementation of the new
$(dt_compat_get_str) preprocessor function in
https://github.com/zephyrproject-rtos/zephyr/pull/21560. That was the
original motivation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-29 09:46:38 -06:00
..
test-bindings dts: edtlib: Add 'type: path' for path references 2020-01-08 08:02:00 -06:00
test-bindings-2 scripts: edtlib.py: Deprecate 'title:' 2019-12-18 11:52:45 +01:00
dtlib.py scripts: dtlib/edtlib: Make output consistent on Python 3.5- 2019-11-12 17:57:50 -06:00
edtlib.py dts: edtlib: Turn Node.instance_no into EDT.compat2enabled 2020-01-29 09:46:38 -06:00
gen_defines.py dts: edtlib: Turn Node.instance_no into EDT.compat2enabled 2020-01-29 09:46:38 -06:00
grutils.py dts: grutils: Remove spaces before '(' in function definitions 2019-11-06 17:33:59 -08:00
test-multidir.dts scripts: dts: Add test for multiple binding directories 2019-08-03 14:17:49 -04:00
test.dts dts: edtlib: Turn Node.instance_no into EDT.compat2enabled 2020-01-29 09:46:38 -06:00
testdtlib.py scripts: edtlib: Add a Device.children attribute with child Devices 2019-09-21 09:10:36 -05:00
testedtlib.py dts: edtlib: Turn Node.instance_no into EDT.compat2enabled 2020-01-29 09:46:38 -06:00