zephyr/scripts/dts
Martí Bolívar e96ca54fd8 gen_defines: play tricks to benefit DT_INST users
Even though it is about to be done for sound technical reasons, a
subsequent patch adding access to all device nodes at the last minute
in the 2.3 release is going to be playing a bit of a fast one on
the Zephyr community, especially users of DT_INST APIs.

In particular, instance numbers are currently allocated only to
enabled nodes, but that will not be true soon: *every* node of a
compatible will be allocated an instance number, even disabled ones.

This is especially unfortunate for drivers and applications that
expect singletons of their compatibles, and use DT_INST(0, ...) to
mean "the one enabled instance of my compatible".

To avoid gratuitous breakage, let's prepare for that by sorting each
edt.compat2nodes sub-list so that enabled instances always come before
disabled ones.

This doesn't break any API guarantees, because there basically *are*
no ordering guarantees, in part precisely to give us the flexibility
to do things like this. And it does help patterns that use instances 0
through N-1, including the important singleton case.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
..
test-bindings dts: edtlib: Add 'type: path' for path references 2020-01-08 08:02:00 -06:00
test-bindings-2
dtlib.py
edtlib.py edtlib: add EDT.compat2nodes, EDT.compat2okay 2020-05-07 08:12:49 -05:00
gen_defines.py gen_defines: play tricks to benefit DT_INST users 2020-05-08 19:37:18 -05:00
gen_legacy_defines.py edtlib: allow default property types for nodes without bindings 2020-05-07 08:12:49 -05:00
grutils.py scripts: grutils: tweak sort keys to group siblings 2020-02-04 07:28:45 -06:00
test-multidir.dts
test.dts dts: edtlib: Turn Node.instance_no into EDT.compat2enabled 2020-01-29 09:46:38 -06:00
testdtlib.py
testedtlib.py edtlib: allow register addr / size to be None 2020-03-24 10:11:20 -05:00