Page MenuHomeFreeBSD

sys: harmonize FDT/DTS include paths
Needs ReviewPublic

Authored by mhorne on Jul 2 2025, 7:52 PM.
Tags
None
Referenced Files
F132256508: D51134.diff
Wed, Oct 15, 6:09 AM
F132192695: D51134.id157856.diff
Tue, Oct 14, 3:52 PM
Unknown Object (File)
Thu, Oct 9, 8:00 PM
Unknown Object (File)
Thu, Oct 9, 8:00 PM
Unknown Object (File)
Thu, Oct 9, 5:17 PM
Unknown Object (File)
Mon, Oct 6, 5:30 AM
Unknown Object (File)
Thu, Oct 2, 5:42 PM
Unknown Object (File)
Thu, Oct 2, 5:43 AM
Subscribers

Details

Summary

The motivation is to make these include paths available to kmod builds;
currently they are not.

Many source files assume this. For example, in tegra124_clk_pll.c:

#include <dt-bindings/clock/tegra124-car.h>

This omits the lengthy path prefix 'contrib/device-tree/include'.

The secondary aim is to consolidate where these paths are defined for the
kernel, as they are currently spread across arch-specific Makefiles.

Test Plan

Check that kmod builds can pick up headers in these directories.

Ensure tinderbox succeeds.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 65182
Build 62065: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Jul 2 2025, 7:52 PM
sys/conf/kern.pre.mk
73–77

Some notes on the conditionals usage here and below:

  • OPT_FDT is only available to kmod builds.
  • MK_FDT is never "yes" on amd64 (BROKEN_OPTION), but it does need the libfdt include path for the old experiment in sys/x86/x86/fdt_machdep.c.

In the name of simplicity I'd even lean towards including all of these unconditionally for all builds, but I have done what seems "proper" here.

This prompted a secondary question of whether the x86 FDT experiment bits can be removed outright (sys/x86/x86/fdt_machdep.c).

amd64 cannot be built with options FDT, for several reasons. And I cannot imagine it is being used today, if it ever was.

However, it is a low priority.