Lines Matching +full:child +full:- +full:prop
7 ; --------------------------------------------------------------------
8 ; dt-macro: the top level nonterminal for a devicetree macro
10 ; A dt-macro starts with uppercase "DT_", and is one of:
12 ; - a <node-macro>, generated for a particular node
13 ; - some <other-macro>, a catch-all for other types of macros
14 dt-macro = node-macro / other-macro
16 ; --------------------------------------------------------------------
17 ; node-macro: a macro related to a node
20 node-macro = property-macro
22 node-macro =/ pinctrl-macro
24 node-macro =/ gpiohogs-macro
26 node-macro =/ %s"DT_N" path-id %s"_EXISTS"
28 ; The additional dt-name suffix is added to match that node's bus type;
29 ; the dt-name in this case is something like "spi" or "i2c".
30 node-macro =/ %s"DT_N" path-id %s"_BUS" ["_" dt-name]
32 node-macro =/ %s"DT_N" path-id %s"_REG_NUM"
33 node-macro =/ %s"DT_N" path-id %s"_REG_IDX_" DIGIT "_EXISTS"
34 node-macro =/ %s"DT_N" path-id %s"_REG_IDX_" DIGIT
36 node-macro =/ %s"DT_N" path-id %s"_REG_NAME_" dt-name
39 node-macro =/ %s"DT_N" path-id %s"_IRQ_NUM"
40 node-macro =/ %s"DT_N" path-id %s"_IRQ_IDX_" DIGIT "_EXISTS"
41 node-macro =/ %s"DT_N" path-id %s"_IRQ_IDX_" DIGIT
42 %s"_VAL_" dt-name [ %s"_EXISTS" ]
43 node-macro =/ %s"DT_N" path-id %s"_IRQ_NAME_" dt-name
44 %s"_VAL_" dt-name [ %s"_EXISTS" ]
46 node-macro =/ %s"DT_N" path-id %s"_RANGES_NUM"
47 node-macro =/ %s"DT_N" path-id %s"_RANGES_IDX_" DIGIT "_EXISTS"
48 node-macro =/ %s"DT_N" path-id %s"_RANGES_IDX_" DIGIT
51 node-macro =/ %s"DT_N" path-id %s"_RANGES_IDX_" DIGIT
53 node-macro =/ %s"DT_N" path-id %s"_FOREACH_RANGE"
54 ; Subnodes of the fixed-partitions compatible get macros which contain
56 node-macro =/ %s"DT_N" path-id %s"_PARTITION_ID" DIGIT
58 ; dt-name in this case is something like "vnd_device".
59 node-macro =/ %s"DT_N" path-id %s"_COMPAT_MATCHES_" dt-name
60 node-macro =/ %s"DT_N" path-id %s"_COMPAT_VENDOR_IDX_" DIGIT "_EXISTS"
61 node-macro =/ %s"DT_N" path-id %s"_COMPAT_VENDOR_IDX_" DIGIT
62 node-macro =/ %s"DT_N" path-id %s"_COMPAT_MODEL_IDX_" DIGIT "_EXISTS"
63 node-macro =/ %s"DT_N" path-id %s"_COMPAT_MODEL_IDX_" DIGIT
64 ; Every non-root node gets one of these macros, which expands to the node
66 node-macro =/ %s"DT_N" path-id %s"_PARENT"
69 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM"
70 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM_SEP"
71 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM_VARGS"
72 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM_SEP_VARGS"
74 ; each child node.
75 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD"
76 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_SEP"
77 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_VARGS"
78 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_SEP_VARGS"
80 ; over each child node with status "okay".
81 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY"
82 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY_SEP"
83 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY_VARGS"
84 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS"
85 ; The node's zero-based index in the list of it's parent's child nodes.
86 node-macro =/ %s"DT_N" path-id %s"_CHILD_IDX"
87 ; The node's status macro; dt-name in this case is something like "okay"
89 node-macro =/ %s"DT_N" path-id %s"_STATUS_" dt-name
90 ; The node's dependency ordinal. This is a non-negative integer
92 node-macro =/ %s"DT_N" path-id %s"_ORD"
94 node-macro =/ %s"DT_N" path-id %s"_PATH"
95 ; The node's name@unit-addr, as a string literal
96 node-macro =/ %s"DT_N" path-id %s"_FULL_NAME"
98 node-macro =/ %s"DT_N" path-id %s"_REQUIRES_ORDS"
100 node-macro =/ %s"DT_N" path-id %s"_SUPPORTS_ORDS"
102 ; --------------------------------------------------------------------
103 ; pinctrl-macro: a macro related to the pinctrl properties in a node
106 ; but the array indexes correspond to pinctrl-DIGIT properties in a node.
113 ; pinctrl-0 = <&bar>;
114 ; pinctrl-1 = <&baz>;
115 ; pinctrl-names = "default", "sleep";
118 ; Total number of pinctrl-DIGIT properties in the node. May be zero.
121 pinctrl-macro = %s"DT_N" path-id %s"_PINCTRL_NUM"
122 ; A given pinctrl-DIGIT property exists.
126 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_IDX_" DIGIT %s"_EXISTS"
131 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_NAME_" dt-name %s"_EXISTS"
136 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_NAME_" dt-name %s"_IDX"
142 ; covered by property-macro. We only need this because the map from
144 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_NAME_" dt-name %s"_IDX_" DIGIT %s"_PH"
146 ; --------------------------------------------------------------------
147 ; gpiohogs-macro: a macro related to GPIO hog nodes
153 ; #gpio-cells = <2>;
155 ; node-1 {
156 ; gpio-hog;
158 ; output-high;
161 ; node-2 {
162 ; gpio-hog;
164 ; output-low;
170 ; gpio-cells:
171 ; - pin
172 ; - flags
176 ; #define DT_N_<node-1 path>_GPIO_HOGS_EXISTS 1
177 ; #define DT_N_<node-2 path>_GPIO_HOGS_EXISTS 1
178 gpioshogs-macro = %s"DT_N" path-id %s"_GPIO_HOGS_EXISTS"
181 ; #define DT_N_<node-1 path>_GPIO_HOGS_NUM 2
182 ; #define DT_N_<node-2 path>_GPIO_HOGS_NUM 1
183 gpioshogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_NUM"
186 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_EXISTS 1
187 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_EXISTS 1
188 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_EXISTS 1
189 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_EXISTS"
193 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_PH <node id for 'gpio1'>
194 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_PH <node id for 'gpio1'>
195 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_PH <node id for 'gpio1'>
196 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_PH"
199 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_pin_EXISTS 1
200 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_pin_EXISTS 1
201 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_pin_EXISTS 1
202 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_pin_EXISTS"
205 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_pin 0
206 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_pin 1
207 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_pin 2
208 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_pin"
211 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_flags_EXISTS 1
212 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_flags_EXISTS 1
213 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_flags_EXISTS 1
214 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_flags_EXISTS"
217 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_flags 0x10
218 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_flags 0x20
219 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_flags 0x30
220 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_flags"
222 ; --------------------------------------------------------------------
223 ; property-macro: a macro related to a node property
225 ; These combine a node identifier with a "lowercase-and-underscores form"
229 ; The optional prop-suf suffix is when there's some specialized
233 ; The "plain vanilla" macro for a property's value, with no prop-suf,
240 ; - path-id: node's devicetree path converted to a C token
241 ; - prop-id: node's property name converted to a C token
242 ; - prop-suf: an optional property-specific suffix
243 property-macro = %s"DT_N" path-id %s"_P_" prop-id [prop-suf]
245 ; --------------------------------------------------------------------
246 ; path-id: a node's path-based macro identifier
248 ; This in "lowercase-and-underscores" form. I.e. it is
251 ; - each slash (/) to _S_
252 ; - all letters to lowercase
253 ; - non-alphanumerics characters to underscores
255 ; For example, the leaf node "bar-BAZ" in this devicetree:
259 ; bar-BAZ {};
263 ; has path-id "_S_foo_123_S_bar_baz".
264 path-id = 1*( %s"_S_" dt-name )
266 ; ----------------------------------------------------------------------
267 ; prop-id: a property identifier
271 ; - all letters to lowercase
272 ; - non-alphanumeric characters to underscores
281 ; The 'zephyr,console' property has prop-id 'zephyr_console'.
282 ; 'WHY,AM_I_SHOUTING' has prop-id 'why_am_i_shouting'.
283 prop-id = dt-name
285 ; ----------------------------------------------------------------------
286 ; prop-suf: a property-specific macro suffix
290 ; - that are special to the specification ("reg", "interrupts", etc.)
291 ; - with array types (uint8-array, phandle-array, etc.)
292 ; - with "enum:" in their bindings
293 ; - that have zephyr device API specific macros for phandle-arrays
294 ; - related to phandle specifier names ("foo-names")
298 ; - _EXISTS: property, index or name existence flag
299 ; - _SIZE: logical property length
300 ; - _IDX_<i>: values of individual array elements
301 ; - _IDX_<DIGIT>_VAL_<dt-name>: values of individual specifier
303 ; - _ADDR_<i>: for reg properties, the i-th register block address
304 ; - _LEN_<i>: for reg properties, the i-th register block length
309 prop-suf = 1*( "_" gen-name ["_" dt-name] )
311 ; --------------------------------------------------------------------
312 ; other-macro: grab bag for everything that isn't a node-macro.
315 other-macro = %s"DT_N_" alternate-id
317 other-macro =/ %s"DT_N_INST_" dt-name %s"_NUM_OKAY"
320 other-macro =/ %s"DT_FOREACH_HELPER"
321 other-macro =/ %s"DT_FOREACH_OKAY_HELPER"
324 other-macro =/ %s"DT_FOREACH_OKAY_" dt-name
325 other-macro =/ %s"DT_FOREACH_OKAY_VARGS_" dt-name
328 other-macro =/ %s"DT_FOREACH_OKAY_INST_" dt-name
329 other-macro =/ %s"DT_FOREACH_OKAY_INST_VARGS_" dt-name
331 other-macro =/ %s"DT_CHOSEN_" dt-name
336 other-macro =/ %s"DT_COMPAT_" dt-name %s"_BUS_" dt-name
341 other-macro =/ %s"DT_COMPAT_HAS_OKAY_" dt-name
342 ; Currently used to allow mapping a lowercase-and-underscores "label"
343 ; property to a fixed-partitions node. See the flash map API docs
345 other-macro =/ %s"DT_COMPAT_" dt-name %s"_LABEL_" dt-name
347 ; --------------------------------------------------------------------
348 ; alternate-id: another way to specify a node besides a path-id
364 ; Node device@123 has these alternate-id values:
366 ; - ALIAS_dev
367 ; - NODELABEL_dev_1
368 ; - INST_0_vnd_device
370 ; The full alternate-id macros are:
376 ; These mainly exist to allow pasting an alternate-id macro onto a
377 ; "_P_<prop-id>" to access node properties given a node's alias, etc.
379 ; Notice that "inst"-type IDs have a leading instance identifier,
381 ; alternate-id begin immediately with names taken from the devicetree.
382 alternate-id = ( %s"ALIAS" / %s"NODELABEL" ) dt-name
383 alternate-id =/ %s"INST_" 1*DIGIT "_" dt-name
385 ; --------------------------------------------------------------------
388 ; A dt-name is one or more:
389 ; - lowercase ASCII letters (a-z)
390 ; - numbers (0-9)
391 ; - underscores ("_")
395 ; lowercasing letters (in practice, this is a no-op) and converting
396 ; non-alphanumeric characters to underscores.
398 ; You'll see these referred to as "lowercase-and-underscores" forms of
400 dt-name = 1*( lower / DIGIT / "_" )
402 ; gen-name is used as a stand-in for a component of a generated macro
403 ; name which does not come from devicetree (dt-name covers that case).
405 ; - uppercase ASCII letters (a-z)
406 ; - numbers (0-9)
407 ; - underscores ("_")
408 gen-name = upper 1*( upper / DIGIT / "_" )
411 ; in RFC-7405 syntax.
414 lower = %x61-7A
416 ; "uppercase ASCII letter" in RFC-7405 syntax
417 upper = %x41-5A