zephyr/scripts/dts/test-bindings
Johan Hedberg 4ba387829b edtlib: Match any parent bus when binding lacks an explicit on-bus
There are some drivers in the tree that support devices on multiple
different buses, although so far this has not been represented in
device tree using the bus concept. In order to convert these drivers &
bindings to refer to a formal bus in device tree we need to be able to
match bindings which lack an explicit "on-bus: ..." value against any
parent bus. This will also be needed for any external bindings, since
those would not be aware of on-bus (as it's a Zephyhr-specific
extension).

The two drivers I'm particularly targeting is the ns16550 UART driver
(drivers/serial/uart_ns16550.c) and the DW I2C driver
(drivers/i2c/i2c_dw.c). They both support devices with a fixed MMIO
address as well as devices connected and discovered over PCIe. The
only issue is that instead of encoding the bus information the proper
DT way these bindings use a special "pcie" property in the DT node
entries to indicate whether the node is on the PCIe bus or not.

Being able to convert the above two drivers to use the DT bus concept
allow the removal of "hacks" like this:

 if DT_INST_PROP(0, pcie) || \
       DT_INST_PROP(1, pcie) || \
       DT_INST_PROP(2, pcie) || \
       DT_INST_PROP(3, pcie)

to the more intuitive:

 if DT_ANY_INST_ON_BUS_STATUS_OKAY(pcie)

This also has the benefit that the driver doesn't need to make any
arbitrary assumptions of how many matching devices there may be but
works for any number of matches. This is already a problem now since
e.g. the ns16550 driver assumes a maximum of 4 nodes, whereas
dts/x86/elkhart_lake.dtsi defines up to 9 different ns16550 nodes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2021-01-07 20:07:12 +02:00
..
bar-bus.yaml
child-binding-with-compat.yaml scripts: testedtlib: add more child-binding tests 2020-11-03 14:58:51 -06:00
child-binding.yaml
child.yaml
defaults.yaml
deprecated.yaml scripts: edtlib: Add support for 'deprecated' 2020-10-29 11:06:32 -05:00
device-on-any-bus.yaml edtlib: Match any parent bus when binding lacks an explicit on-bus 2021-01-07 20:07:12 +02:00
device-on-bar-bus.yaml
device-on-foo-bus.yaml
enums.yaml edtlib: improve enum support 2020-12-13 19:25:24 -05:00
false-positive.yaml
foo-bus.yaml
foo-optional.yaml
foo-required.yaml
gpio-dst.yaml
gpio-src.yaml
grandchild-1.yaml
grandchild-2.yaml
grandchild-3.yaml
interrupt-1-cell.yaml
interrupt-2-cell.yaml
interrupt-3-cell.yaml
multidir.yaml
order-1.yaml
order-2.yaml
parent.yaml
phandle-array-controller-0.yaml
phandle-array-controller-1.yaml
phandle-array-controller-2.yaml
props.yaml dts: handle unspecified phandle-array elements 2020-12-22 07:34:29 -06:00