zephyr/dts/bindings/device_node.yaml.template
Erwan Gouriou 93d3a42776 scripts: extract_includes_dts: Remove usage of cell_string yaml attribute
'cell_string' yaml attribute has been introduced in order to
help enforcement of specific string during defines generation.
This adds complexity in understanding script behavior as a black
box and create additional dependency which is not strictly required.

For node specific generation functions (pinctrl and interrupts),
this could be replaced directly by an hardcoded version
(as everyone used the same 'cell_string' anyway).
For extract_cells functions, string could be replaced by extracted
property name. As a consequence, we're now able to generate defines
for properties refering to these controllers via phandle.
For instance, in following node
 	spbtle-rf@0 {
 		compatible = "st,spbtle-rf";
 		reg = <0>;
		reset-gpios = <&gpioa 8 0>;
 	};
We'll be able to generate:
 #define ST_STM32_SPI_...LE_RF_0_RESET_GPIOS_CONTROLLER	"GPIOA"
 #define ST_STM32_SPI_...PBTLE_RF_0_RESET_GPIOS_FLAGS_0		0
 #define ST_STM32_SPI_..._SPBTLE_RF_0_RESET_GPIOS_PIN_0		8

Only impact for this whole change is for NXP clocks which were the
only ones using 'cell_string' attribute with a value different than
the default one.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-05-10 10:38:23 -05:00

59 lines
1.7 KiB
Text

---
title: <Title should describe what node you are describing>
version: 0.1
description: >
Describe in free form text w/ spanning lines what you
are describing
< parent | child >:
# parent/child is used to document implicit relation between nodes.
# This information is required to generate parent related bits in child
# attributes.
# In case parent has 'bus', slave inherits some information from master.
# parent and child should share same bus-type value.
bus: <bus-type>
# properties will be the contents of the device tree node
# property names must match the property names in the DT
properties:
# A typical property entry will look like the following
# <name of property as it is in device tree>
# category: <required | optional>
# type: <string | int | array>
# description: <description of property>
# generation: <define | structure>
# At a minimum, the compatible is required for matching nodes
compatible: <list of string compatible matches>
category: required
type: string
description: compatible of node
# reg is used to denote mmio registers
reg:
type: array
description: mmio register space
generation: define
category: required
# interrupts specifies the interrupts that the driver may utilize
interrupts:
type: array
category: required
description: required interrupts
generation: define
# If a node is a interrupt controller, gpio controller, pinmux device
# or any device which is referenced via phandle plus some number of cells
# then the cell fiels below must be present.
"#cells":
- cell0 # name of first cell
- cell1 # name of second cell
- cell2 # name of third cell
- and so on and so forth
...