During yaml collapse step, convert inherited 'id' key to 'node_type'.
With this new 'node_type', it's is more easy to apply common treatment
to all bindings that include the same base yaml file but might not
have similar bindings/constraint naming convention.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Prepare to split extract_dts_includes in modules.
extract_dts_includes design is based on globals. Every module must be
able to use (import) them.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Moving logical parts into dedicated functions for clarity.
Factorizing a bit the code for potential future changes (more
'zephyr,xxxx' directives related to CONFIG_ option).
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thus no need to parse twice the .dtsi, .dts and .yaml files.
Simplify provided arguments relevancy, letting argparse generating usage
message by itself.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mandated by Python PEP-8.
(And normalize the way we write python in dts scripts also)
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
We should be able to run the script without requiring a zephyr,flash
property in the choosen node. Qualify insert based on having the
choosen property.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When building in Windows, extract_dts_includes.py failed with an
exception on boards that have dts sensor bindings. This was caused by
path handling to search for i2c-device.yaml that worked in Linux, but
not in Windows.
Affected boards were disco_l475_iot1, frdm_k64f, frdm_kw41z, and
hexiwear_k64.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
When we determine the address and size cells to determine how to parse a
reg property, we need to stop at the parent of the node, not at the node
itself. If we have #address-cells or #size-cells in a node its meant
for the children of that node and not the node itself.
Fixes#4568
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Added a label for soc-nv-flash nodes. Made some updates to the
generation to maintain creating defines for properties like
erase-block-size and write-block-size so they we get both
FLASH_ERASE_BLOCK_SIZE and FLASH_${LABEL}_ERASE_BLOCK_SIZE (same for
WRITE_BLOCK_SIZE).
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Its possible we have dashes in interrupt names that we need to convert
to underscores when we generate defines. Make sure we do that otherwise
things aren't going to build.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When node has 'bus' as 'parent' attribute, change base label to
include parent address in label prefix.
Besides, generates a "_BUS_NAME" define which equals parent label.
Signed-Off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
According to yaml syntaxic rules, 'properties' described in dts
bindings yaml files could be seen as 'mapping'(key/value couple),
instead of 'series' (list of single elements).
yaml 'mappings' will then be converted by yaml python library as
python 'dict' which will ease treatment (instead of current list
as were before this commit).
Same treatment is applied to 'inherits'.
script extract_dts_inlcude is updated to take change of yaml_list
structre into account. This allows some code simplification. Largest
impact is yaml_collapse function which works now allow complete
overload method on all the attributes of a yaml nodes.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Cleanup how we find the yaml files for device tree bindings. Move to a
recursive dir search of the dts/ dir. This will be useful for
supporting re-organizing of the yaml files to match binding dir
structure.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Allow the script to take multiple -f (fixup) file options. We output
the fixup files in order that the -f options are passed. This will
allow us to have a common soc fixup and board fixup if we desire.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If there's any key in the alias which length is larger than other keys
in the node, the include file will be incorrect, there will be no tab
between the key and value.
We need to take into account the max length of alias keys.
Signed-off-by: Aska Wu <aska.wu@linaro.org>