zephyr/scripts/dts
Ulf Magnusson 5e55eda30e scripts: edtlib: Support nested nodes on buses
For the following devicetree, view 'nested' as being on the bus.
Previously, only 'node' was considered to be on the bus.

    some-bus {
    	compatible = "foo,bus-controller";
    	node {
    		nested {
    			compatible = "foo,device-on-bus";
    		};
    	};
    };

In practice, this means that a 'bus:' key in the binding for
'foo,bus-controller' will now get matched up to an 'on-bus:' key in the
binding for 'foo,device-on-bus'.

Change the meaning of Node.bus and add two new attributes Node.on_bus
and Node.bus_node, with these meanings:

    Node.bus:
      The bus type (as a string) if the node is a bus controller, and
      None otherwise

    Node.on_bus:
      The bus type (as a string) if the node appears on a bus, and None
      otherwise. The bus type is determined from the closest parent
      that's a bus controller.

    Node.bus_node:
      The node for the bus controller if the node appears on a bus, and
      None otherwise

It's a bit redundant to have both Node.bus_node and Node.on_bus, since
Node.on_bus is the same as Node.bus_node.bus, but Node.on_bus is pretty
handy to save some None checks.

Also update gen_defines.py to use Node.on_bus and Node.bus_node instead
of Node.parent wherever the code deals with buses.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 11:02:28 +01:00
..
test-bindings scripts: edtlib: Rename 'child-bus:'/'parent-bus:' to 'bus:'/'on-bus:' 2019-12-19 11:02:28 +01:00
test-bindings-2 scripts: edtlib.py: Deprecate 'title:' 2019-12-18 11:52:45 +01:00
dtlib.py
edtlib.py scripts: edtlib: Support nested nodes on buses 2019-12-19 11:02:28 +01:00
gen_defines.py scripts: edtlib: Support nested nodes on buses 2019-12-19 11:02:28 +01:00
grutils.py
test-multidir.dts
test.dts scripts: edtlib: Support nested nodes on buses 2019-12-19 11:02:28 +01:00
testdtlib.py
testedtlib.py scripts: edtlib: Support nested nodes on buses 2019-12-19 11:02:28 +01:00