🚧 NOTE:
dt-toolsis experimental
dt-tools helps you to write, debug and read Devicetree files more efficiently with advanced tooling!
- IDE integration
- Linting
- Devicetree binding validation
- Preprocessor features with some restrictions:
- Macros can only substitute references (
&-syntax), name definitions of nodes, properties and labels, property values, cell values, nodes and properties. - Macros must be individually parseable. This is not allowed:
#define SPECIAL_SYNTAX ) + ( #define SUM1 1 + 2 #define SUM2 (1 + 2) / { prop = (1 SPECIAL_SYNTAX 2); equal = (SUM1 * 2), (SUM2 * 2); // The C preprocessor would not evaluate these to the same value }; #includedirectives can only be used outside of nodes (🚧 note that this may change)- Conditionals can only wrap nodes, properties and other preprocessor directives
- Macros can only substitute references (
- Extensive unit and integration tests written in Rust
- Possibly in the future:
- Comparing DTS or DTB files
- Comparing Android
dtanddtbopartitions with/sys/firmware/fdt
dt-tools-parserimplements an error-resistant parser inspired by rust-analyzerdt-tools-analyzeris a source file analyzerdt-tools-lspis a language server. It basically adds IDE support.dt-tools-lintis a linter for DTSdt-tools-bindingis a crate supposed to validate and match devicetree binding YAMLs
Any kinds of contributions are welcome! Just spreading awareness helps!
See the GitHub issues, especially the ones tagged with help wanted or good first issue.
If you can, take care of code containing TODO, FIXME, todo!(, unimplemented!( or similar
Please read CONTRIBUTING.md.
The VSCode extension's documentation can be found here.
The language server is also packaged for Neovim with the Lua script in ./crates/dt-tools-lsp/lsp.lua.
cargo build -p dt-tools-lsp
nvim --cmd 'luafile ./crates/dt-tools-lsp/lsp.lua' lint_showcase.dtsFeatures:
- Fast and safe parser and linter
- (TODO) View binding documentation straight from DTS!
- (TODO) Binding errors integrated into linter
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

