Skip to content

axelkar/dt-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e9d8985 Â· Apr 21, 2025

History

50 Commits
Apr 21, 2025
Jul 30, 2024
Mar 26, 2025
Mar 23, 2025
Apr 21, 2025
Mar 12, 2024
Mar 26, 2025
Mar 26, 2025
Apr 7, 2025
Apr 21, 2025
Apr 10, 2025
Mar 1, 2024
Mar 1, 2024
Mar 26, 2025
Apr 7, 2025
Apr 21, 2025
Apr 21, 2025
Aug 24, 2024
Aug 24, 2024
Aug 24, 2024
Jul 26, 2024

Repository files navigation

Devicetree tools

🚧 NOTE: dt-tools is very experimental and is currently ongoing a rewrite!

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 and items (like nodes and properties)
    • Macros must be parseable on their own. This is not allowed:
      #define SPECIAL_SYNTAX ) + (
      
      / {
        prop = (1 SPECIAL_SYNTAX 2);
      };
      
    • #include directives can only be used outside of nodes (note that this may change)
    • Conditionals can only wrap nodoes, properties and other preprocessor directives
      • 🚧 Currently fully unimplemented
      • Can only check for definition, equality or ordering
  • Extensive unit and integration tests written in Rust
  • Possibly in the future:
    • Comparing DTS or DTB files
    • Comparing Android dt and dtbo partitions with /sys/firmware/fdt

Crates

Screenshots

Syntax error resiliency showcase in Neovim

Lint showcase in Neovim

Help needed

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

Contributing

Please read CONTRIBUTING.md.

LSP

The VSCode extension's documentation can be found here.

The language server is also packaged for Neovim with the ./crates/dt-lsp/lsp.lua script.

cd ./crates/dt-lsp
nvim -S lsp.lua ../../lint_showcase.dts

Features:

  • Fast and safe parser and linter
  • (TODO) View binding documentation straight from DTS!
  • (TODO) Binding errors integrated into linter

License

Licensed under either of

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.