Skip to content

feat: add DTS include support for build-time device tree generation#415

Draft
xuchang-vivo wants to merge 1 commit into
vivoblueos:mainfrom
xuchang-vivo:xc/add_dts_supports
Draft

feat: add DTS include support for build-time device tree generation#415
xuchang-vivo wants to merge 1 commit into
vivoblueos:mainfrom
xuchang-vivo:xc/add_dts_supports

Conversation

@xuchang-vivo
Copy link
Copy Markdown
Contributor

Summary

Integrate the DTS build framework from the build repository into the kernel.

  • BUILD.gn: Added dts_gen dependency (dts_gen_${board}) to both blueos and kernel_unittest targets. Added DTS_OUT_DIR rustenv variable so the generated module path is resolved at compile time via an environment variable instead of a hardcoded path.
  • mod.rs: Added include!(concat!(env!("DTS_OUT_DIR"), "/mod.rs")) to pull in build-time generated device tree constants.

Architecture

The DTS_OUT_DIR env var is set in GN via rustenv and points to root_gen_dir/dts (rebased to absolute path). This removes the hardcoded path dependency and makes the include portable across different build environments.

Test Plan

  • ninja -C out/qemu_riscv64 check_all — all 139 targets pass
  • Unit tests and integration tests pass on qemu_riscv64

Co-authored-by: Claude Haiku 4.5 noreply@anthropic.com

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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