Skip to content

Devicetree DTS and YAML format improvements#491

Closed
KenVanHoeylandt wants to merge 10 commits intomainfrom
dts-improvements
Closed

Devicetree DTS and YAML format improvements#491
KenVanHoeylandt wants to merge 10 commits intomainfrom
dts-improvements

Conversation

@KenVanHoeylandt
Copy link
Contributor

@KenVanHoeylandt KenVanHoeylandt commented Feb 8, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for default values on binding properties, allowing optional configuration with predefined fallbacks.
  • Improvements

    • Enhanced error handling with clearer error messages and proper exit codes for improved automation integration.
    • Strengthened validation of device properties and bindings.
  • Platform Bindings Updates

    • Made I2C properties (port, clock-frequency, pin-sda, pin-scl) mandatory.
    • Made I2S pin properties optional with defaults where applicable.
    • Added default values to SPI and UART pin and configuration properties.

@coderabbitai
Copy link

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a custom DevicetreeException type and adds support for default values on binding properties throughout the DevicetreeCompiler. Changes include replacing generic exceptions with the custom type across multiple modules, adding a default field to the BindingProperty dataclass, enhancing the main function with explicit exit codes and error handling, and updating binding YAML files to specify required properties and default values. The compile.py script now propagates exit codes properly. Documentation is updated by removing completed implementation tasks. Validation logic is strengthened to check device properties against binding specifications and supply defaults where appropriate.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Devicetree DTS and YAML format improvements' directly aligns with the changeset, which introduces custom exception handling, default value support for binding properties, and updates to multiple YAML binding files with new required flags and defaults.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dts-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@KenVanHoeylandt KenVanHoeylandt deleted the dts-improvements branch February 8, 2026 22:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
Buildscripts/DevicetreeCompiler/source/exception.py (1)

1-3: The __init__ override is redundant.

Exception.__init__ already handles the message argument, so the constructor just duplicates built-in behavior. You could simplify to pass as the body, though this is purely a nit.

Suggested simplification
 class DevicetreeException(Exception):
-    def __init__(self, message):
-        super().__init__(message)
+    pass
Buildscripts/DevicetreeCompiler/source/generator.py (1)

86-92: Consider extracting system property names into a constant.

Minor nit: "compatible" appears as a filter on line 90 and again on line 96. A shared constant (e.g., SYSTEM_PROPERTIES = {"compatible"}) would keep these in sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant