zephyr/scripts/dts
Ulf Magnusson 4c6ea2d160 scripts: edtlib: Skip fully loading bindings in more cases
As a slightly hairy but important optimization inherited from the old
scripts, the binding loading code only looks at binding files whose raw
text contains one of the compatible strings from the devicetree. For
such files, a second pass parses the file as YAML and tries to extract a
compatible string, and skips the file if it fails (e.g. due to spurious
text matches in 'include'd binding fragments).

Until now, the binding would always get fully loaded (have 'include'd
files merged in, checks run, etc.) if the second pass managed to extract
a compatible.

Do slightly better by only fully loading the binding if the extracted
compatible from the second pass appears in the devicetree. This gets rid
of unnecessary binding loading in rare cases.

Discovered by test-bindings/deprecated.yaml getting loaded even when
everything that referenced it in test.dts was commented out, because it
happened to mention 'child-binding' in a comment.

Also add a check for YAML errors in the second pass, to be slightly more
robust. Print a warning if a file that isn't valid YAML is found.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-22 09:17:53 -05:00
..
extract scripts: dts: Replace 'sub-node:' with more general 'child-binding:' 2019-09-19 08:39:22 -05:00
test-bindings scripts: dts: Replace 'sub-node:' with more general 'child-binding:' 2019-09-19 08:39:22 -05:00
test-bindings-2 scripts: dts: Simplify and improve 'compatible' matching 2019-09-07 10:25:02 -05:00
devicetree.py scripts: dts: devicetree.py: Fix pylint warning for iffy \w escape 2019-09-07 10:25:02 -05:00
dtlib.py scripts: dtlib: Suppress _init_tokens() pylint warning 2019-09-07 10:25:02 -05:00
edtlib.py scripts: edtlib: Skip fully loading bindings in more cases 2019-09-22 09:17:53 -05:00
extract_dts_includes.py scripts: dts: Change 'child/parent: bus: ...' to 'child/parent-bus:' 2019-09-17 14:37:43 -05:00
gen_defines.py kconfig: Convert device tree chosen properties to new kconfigfunctions 2019-09-13 11:42:34 -05:00
test-multidir.dts scripts: dts: Add test for multiple binding directories 2019-08-03 14:17:49 -04:00
test.dts scripts: edtlib: Add a Device.children attribute with child Devices 2019-09-21 09:10:36 -05:00
testdtlib.py scripts: edtlib: Add a Device.children attribute with child Devices 2019-09-21 09:10:36 -05:00
testedtlib.py scripts: edtlib: Add a Device.children attribute with child Devices 2019-09-21 09:10:36 -05:00