Skip to content

The guidelines for whether something should be in DTS or Kconfig are too vague #7230

@SebastianBoe

Description

@SebastianBoe

We need improved guidelines for determining if a configuration knob belongs in Kconfig or DTS.
The existing guidelines are attached below.

From the guidelines one can read that DTS should be used for:

  • HW description
  • Zephyr-specific configuration
  • Some of the use-cases where Kconfig is currently applied
  • Not all of the use-cases where CMSIS (and similair) is currently applied

This is pretty vague in my opinion.

Zephyr DTS guidelines

In Zephyr, device tree is used to not only describe hardware, but also to describe Zephyr-specific configuration information. The Zephyr-specific information is intended to augment the device tree descriptions. The main reason for this is to leverage existing device tree files that a SoC vendor may already have defined for a given platform.

Today, configuration in Zephyr comes from a number of different places. It can come from Kconfig files, CMSIS header files, vendor header files, prj.conf files, and other miscellaneous sources. The intent of using device tree is to replace or curtail the use of Kconfig files throughout the system, and instead use device tree files to describe the configuration of device nodes. CMSIS and vendor header files can be used in conjunction with the device tree to fully describe hardware. Device tree is not intended to replace CMSIS or vendor include files.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions