Lines Matching +full:baz +full:- +full:cells

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
38 node-macro =/ %s"DT_N" path-id %s"_REG_NAME_" dt-name "_EXISTS"
40 node-macro =/ %s"DT_N" path-id %s"_IRQ_NUM"
41 node-macro =/ %s"DT_N" path-id %s"_IRQ_LEVEL"
42 node-macro =/ %s"DT_N" path-id %s"_IRQ_IDX_" DIGIT "_EXISTS"
43 node-macro =/ %s"DT_N" path-id %s"_IRQ_IDX_" DIGIT
44 %s"_VAL_" dt-name [ %s"_EXISTS" ]
45 node-macro =/ %s"DT_N" path-id %s"_CONTROLLER"
46 node-macro =/ %s"DT_N" path-id %s"_IRQ_NAME_" dt-name
47 %s"_VAL_" dt-name [ %s"_EXISTS" ]
48 node-macro =/ %s"DT_N" path-id %s"_IRQ_NAME_" dt-name "_CONTROLLER"
50 node-macro =/ %s"DT_N" path-id %s"_RANGES_NUM"
51 node-macro =/ %s"DT_N" path-id %s"_RANGES_IDX_" DIGIT "_EXISTS"
52 node-macro =/ %s"DT_N" path-id %s"_RANGES_IDX_" DIGIT
55 node-macro =/ %s"DT_N" path-id %s"_RANGES_IDX_" DIGIT
57 node-macro =/ %s"DT_N" path-id %s"_FOREACH_RANGE"
58 ; Subnodes of the fixed-partitions compatible get macros which contain
60 node-macro =/ %s"DT_N" path-id %s"_PARTITION_ID" DIGIT
62 ; dt-name in this case is something like "vnd_device".
63 node-macro =/ %s"DT_N" path-id %s"_COMPAT_MATCHES_" dt-name
64 node-macro =/ %s"DT_N" path-id %s"_COMPAT_VENDOR_IDX_" DIGIT "_EXISTS"
65 node-macro =/ %s"DT_N" path-id %s"_COMPAT_VENDOR_IDX_" DIGIT
66 node-macro =/ %s"DT_N" path-id %s"_COMPAT_MODEL_IDX_" DIGIT "_EXISTS"
67 node-macro =/ %s"DT_N" path-id %s"_COMPAT_MODEL_IDX_" DIGIT
68 ; Every non-root node gets one of these macros, which expands to the node
70 node-macro =/ %s"DT_N" path-id %s"_PARENT"
73 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM"
74 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM_SEP"
75 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM_VARGS"
76 node-macro =/ %s"DT_N" path-id %s"_P_" prop-id %s"_FOREACH_PROP_ELEM_SEP_VARGS"
78 node-macro =/ %s"DT_N" path-id %s"_CHILD_NUM"
79 node-macro =/ %s"DT_N" path-id %s"_CHILD_NUM_STATUS_OKAY"
82 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD"
83 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_SEP"
84 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_VARGS"
85 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_SEP_VARGS"
88 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY"
89 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY_SEP"
90 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY_VARGS"
91 node-macro =/ %s"DT_N" path-id %s"_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS"
94 node-macro =/ %s"DT_N" path-id %s"_FOREACH_NODELABEL" [ %s"_VARGS" ]
96 node-macro =/ %s"DT_N" path-id %s"_NODELABEL_NUM"
97 ; The node's zero-based index in the list of it's parent's child nodes.
98 node-macro =/ %s"DT_N" path-id %s"_CHILD_IDX"
99 ; The node's status macro; dt-name in this case is something like "okay"
101 node-macro =/ %s"DT_N" path-id %s"_STATUS_" dt-name
102 ; The node's dependency ordinal. This is a non-negative integer
104 node-macro =/ %s"DT_N" path-id %s"_ORD"
106 node-macro =/ %s"DT_N" path-id %s"_PATH"
107 ; The node's name@unit-addr, as a string literal
108 node-macro =/ %s"DT_N" path-id %s"_FULL_NAME"
110 node-macro =/ %s"DT_N" path-id %s"_REQUIRES_ORDS"
112 node-macro =/ %s"DT_N" path-id %s"_SUPPORTS_ORDS"
114 ; --------------------------------------------------------------------
115 ; pinctrl-macro: a macro related to the pinctrl properties in a node
118 ; but the array indexes correspond to pinctrl-DIGIT properties in a node.
125 ; pinctrl-0 = <&bar>;
126 ; pinctrl-1 = <&baz>;
127 ; pinctrl-names = "default", "sleep";
130 ; Total number of pinctrl-DIGIT properties in the node. May be zero.
133 pinctrl-macro = %s"DT_N" path-id %s"_PINCTRL_NUM"
134 ; A given pinctrl-DIGIT property exists.
138 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_IDX_" DIGIT %s"_EXISTS"
143 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_NAME_" dt-name %s"_EXISTS"
148 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_NAME_" dt-name %s"_IDX"
154 ; covered by property-macro. We only need this because the map from
156 pinctrl-macro =/ %s"DT_N" path-id %s"_PINCTRL_NAME_" dt-name %s"_IDX_" DIGIT %s"_PH"
158 ; --------------------------------------------------------------------
159 ; gpiohogs-macro: a macro related to GPIO hog nodes
165 ; #gpio-cells = <2>;
167 ; node-1 {
168 ; gpio-hog;
170 ; output-high;
173 ; node-2 {
174 ; gpio-hog;
176 ; output-low;
182 ; gpio-cells:
183 ; - pin
184 ; - flags
188 ; #define DT_N_<node-1 path>_GPIO_HOGS_EXISTS 1
189 ; #define DT_N_<node-2 path>_GPIO_HOGS_EXISTS 1
190 gpioshogs-macro = %s"DT_N" path-id %s"_GPIO_HOGS_EXISTS"
193 ; #define DT_N_<node-1 path>_GPIO_HOGS_NUM 2
194 ; #define DT_N_<node-2 path>_GPIO_HOGS_NUM 1
195 gpioshogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_NUM"
198 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_EXISTS 1
199 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_EXISTS 1
200 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_EXISTS 1
201 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_EXISTS"
205 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_PH <node id for 'gpio1'>
206 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_PH <node id for 'gpio1'>
207 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_PH <node id for 'gpio1'>
208 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_PH"
211 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_pin_EXISTS 1
212 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_pin_EXISTS 1
213 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_pin_EXISTS 1
214 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_pin_EXISTS"
217 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_pin 0
218 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_pin 1
219 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_pin 2
220 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_pin"
223 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_flags_EXISTS 1
224 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_flags_EXISTS 1
225 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_flags_EXISTS 1
226 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_flags_EXISTS"
229 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_0_VAL_flags 0x10
230 ; #define DT_N_<node-1 path>_GPIO_HOGS_IDX_1_VAL_flags 0x20
231 ; #define DT_N_<node-2 path>_GPIO_HOGS_IDX_0_VAL_flags 0x30
232 gpiohogs-macro =/ %s"DT_N" path-id %s"_GPIO_HOGS_IDX_" DIGIT %s"_VAL_flags"
234 ; --------------------------------------------------------------------
235 ; property-macro: a macro related to a node property
237 ; These combine a node identifier with a "lowercase-and-underscores form"
241 ; The optional prop-suf suffix is when there's some specialized
245 ; The "plain vanilla" macro for a property's value, with no prop-suf,
252 ; - path-id: node's devicetree path converted to a C token
253 ; - prop-id: node's property name converted to a C token
254 ; - prop-suf: an optional property-specific suffix
255 property-macro = %s"DT_N" path-id %s"_P_" prop-id [prop-suf]
257 ; --------------------------------------------------------------------
258 ; path-id: a node's path-based macro identifier
260 ; This in "lowercase-and-underscores" form. I.e. it is
263 ; - each slash (/) to _S_
264 ; - all letters to lowercase
265 ; - non-alphanumerics characters to underscores
267 ; For example, the leaf node "bar-BAZ" in this devicetree:
271 ; bar-BAZ {};
275 ; has path-id "_S_foo_123_S_bar_baz".
276 path-id = 1*( %s"_S_" dt-name )
278 ; ----------------------------------------------------------------------
279 ; prop-id: a property identifier
283 ; - all letters to lowercase
284 ; - non-alphanumeric characters to underscores
293 ; The 'zephyr,console' property has prop-id 'zephyr_console'.
294 ; 'WHY,AM_I_SHOUTING' has prop-id 'why_am_i_shouting'.
295 prop-id = dt-name
297 ; ----------------------------------------------------------------------
298 ; prop-suf: a property-specific macro suffix
302 ; - that are special to the specification ("reg", "interrupts", etc.)
303 ; - with array types (uint8-array, phandle-array, etc.)
304 ; - with "enum:" in their bindings
305 ; - that have zephyr device API specific macros for phandle-arrays
306 ; - related to phandle specifier names ("foo-names")
310 ; - _EXISTS: property, index or name existence flag
311 ; - _SIZE: logical property length
312 ; - _IDX_<i>: values of individual array elements
313 ; - _IDX_<DIGIT>_VAL_<dt-name>: values of individual specifier
314 ; cells within a phandle array
315 ; - _ADDR_<i>: for reg properties, the i-th register block address
316 ; - _LEN_<i>: for reg properties, the i-th register block length
321 prop-suf = 1*( "_" gen-name ["_" dt-name] )
323 ; --------------------------------------------------------------------
324 ; other-macro: grab bag for everything that isn't a node-macro.
327 other-macro = %s"DT_N_" alternate-id
329 other-macro =/ %s"DT_N_INST_" dt-name %s"_NUM_OKAY"
332 other-macro =/ %s"DT_FOREACH_HELPER"
333 other-macro =/ %s"DT_FOREACH_OKAY_HELPER"
336 other-macro =/ %s"DT_FOREACH_OKAY_" dt-name
337 other-macro =/ %s"DT_FOREACH_OKAY_VARGS_" dt-name
340 other-macro =/ %s"DT_FOREACH_OKAY_INST_" dt-name
341 other-macro =/ %s"DT_FOREACH_OKAY_INST_VARGS_" dt-name
343 other-macro =/ %s"DT_CHOSEN_" dt-name
348 other-macro =/ %s"DT_COMPAT_" dt-name %s"_BUS_" dt-name
353 other-macro =/ %s"DT_COMPAT_HAS_OKAY_" dt-name
354 ; Currently used to allow mapping a lowercase-and-underscores "label"
355 ; property to a fixed-partitions node. See the flash map API docs
357 other-macro =/ %s"DT_COMPAT_" dt-name %s"_LABEL_" dt-name
359 ; --------------------------------------------------------------------
360 ; alternate-id: another way to specify a node besides a path-id
376 ; Node device@123 has these alternate-id values:
378 ; - ALIAS_dev
379 ; - NODELABEL_dev_1
380 ; - INST_0_vnd_device
382 ; The full alternate-id macros are:
388 ; These mainly exist to allow pasting an alternate-id macro onto a
389 ; "_P_<prop-id>" to access node properties given a node's alias, etc.
391 ; Notice that "inst"-type IDs have a leading instance identifier,
393 ; alternate-id begin immediately with names taken from the devicetree.
394 alternate-id = ( %s"ALIAS" / %s"NODELABEL" ) dt-name
395 alternate-id =/ %s"INST_" 1*DIGIT "_" dt-name
397 ; --------------------------------------------------------------------
400 ; A dt-name is one or more:
401 ; - lowercase ASCII letters (a-z)
402 ; - numbers (0-9)
403 ; - underscores ("_")
407 ; lowercasing letters (in practice, this is a no-op) and converting
408 ; non-alphanumeric characters to underscores.
410 ; You'll see these referred to as "lowercase-and-underscores" forms of
412 dt-name = 1*( lower / DIGIT / "_" )
414 ; gen-name is used as a stand-in for a component of a generated macro
415 ; name which does not come from devicetree (dt-name covers that case).
417 ; - uppercase ASCII letters (a-z)
418 ; - numbers (0-9)
419 ; - underscores ("_")
420 gen-name = upper 1*( upper / DIGIT / "_" )
423 ; in RFC-7405 syntax.
426 lower = %x61-7A
428 ; "uppercase ASCII letter" in RFC-7405 syntax
429 upper = %x41-5A