zephyr/scripts/dts/test-bindings/props.yaml
Martí Bolívar 38ede5aded dts: handle unspecified phandle-array elements
The DTS language permits zeroing out phandles in a phandle array to
say "there's nothing at this index", and dtlib manages that correctly,
but edtlib and gen_defines.py aren't equipped to do so.

Fix this by allowing None elements in the lists of ControllerAndData
values returned by edtlib for such properties.

Handle that in gen_defines.py by setting the generated
DT_N_<node>_P_<prop>_IDX_<i>_EXISTS macro to 0 in such cases.

The DT_N_<node>_P_<prop>_LEN macro still accounts for the entire
length of the phandle-array; it's just that some indexes may be
missing data.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-12-22 07:34:29 -06:00

51 lines
850 B
YAML

# SPDX-License-Identifier: BSD-3-Clause
description: Device.props test
compatible: "props"
properties:
nonexistent-boolean:
type: boolean
existent-boolean:
type: boolean
int:
type: int
const: 1
array:
type: array
uint8-array:
type: uint8-array
string:
type: string
const: "foo"
string-array:
type: string-array
phandle-ref:
type: phandle
phandle-refs:
type: phandles
phandle-array-foos:
type: phandle-array
phandle-array-foo-names:
type: string-array
# There's some slight special-casing for GPIOs in that 'foo-gpios = ...'
# gets resolved to #gpio-cells rather than #foo-gpio-cells, so test that
# too
foo-gpios:
type: phandle-array
path:
type: path