Please sign in to comment.
dts: Add new DTS/binding parser
Add a new DTS/binding parser to scripts/dts/ for generating generated_dts_board.conf and generated_dts_board_unfixed.h. The old code is kept to generate some deprecated defines, using the --deprecated-only flag. It will be removed later. The new parser is implemented in three files in scripts/dts/: dtlib.py: A low-level .dts parsing library. This is similar to devicetree.py in the old code, but is a general robust DTS parser that doesn't rely on preprocessing. edtlib.py (e for extended): A library built on top of dtlib.py that brings together data from DTS files and bindings and creates Device instances with all the data for a device. gen_defines.py: A script that uses edtlib.py to generate generated_dts_board.conf and generated_dts_board_unfixed.h. Corresponds to extract_dts_includes.py and the files in extract/ in the old code. testdtlib.py: Test suite for dtlib.py. Can be run directly as a script. testedtlib.py (uses test.dts and test-bindings/): Test suite for edtlib.py. Can be run directly as a script. The test suites will be run automatically in CI. The new code turns some things that were warnings (or not checked) in the old code into errors, like missing properties that are specified with 'category: required' in the binding for the node. The code includes lots of documentation and tries to give helpful error messages instead of Python errors. Co-authored-by: Kumar Gala <firstname.lastname@example.org> Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- Loading branch information...
Showing with 6,662 additions and 4 deletions.
- +1 −0 CODEOWNERS
- +28 −4 cmake/dts.cmake
- +2 −0 include/generated_dts_board.h
- +1,689 −0 scripts/dts/dtlib.py
- +1,639 −0 scripts/dts/edtlib.py
- +619 −0 scripts/dts/gen_defines.py
- +14 −0 scripts/dts/test-bindings/child.yaml
- +14 −0 scripts/dts/test-bindings/clock-1-cell.yaml
- +15 −0 scripts/dts/test-bindings/clock-2-cell.yaml
- +14 −0 scripts/dts/test-bindings/fixed-clock.yaml
- +14 −0 scripts/dts/test-bindings/gpio-1-cell.yaml
- +15 −0 scripts/dts/test-bindings/gpio-2-cell.yaml
- +15 −0 scripts/dts/test-bindings/grandchild.yaml
- +14 −0 scripts/dts/test-bindings/interrupt-1-cell.yaml
- +15 −0 scripts/dts/test-bindings/interrupt-2-cell.yaml
- +16 −0 scripts/dts/test-bindings/interrupt-3-cell.yaml
- +19 −0 scripts/dts/test-bindings/parent.yaml
- +26 −0 scripts/dts/test-bindings/props.yaml
- +11 −0 scripts/dts/test-bindings/pwm-0-cell.yaml
- +14 −0 scripts/dts/test-bindings/pwm-1-cell.yaml
- +21 −0 scripts/dts/test-bindings/sub-node-parent.yaml
- +299 −0 scripts/dts/test.dts
- +2,025 −0 scripts/dts/testdtlib.py
- +123 −0 scripts/dts/testedtlib.py
Oops, something went wrong.