doc: dts: Explain better how devicetree and Kconfig fit together
It's cryptic that some identifiers for devicetree-related stuff start with DT_*, while others start with CONFIG_*. Explain what's going on, and link to the Kconfig preprocessor documentation. Also remove an early mention of bindings that might be confusing. Bindings are much more about checking devicetree conformance than about controlling output, though they do some of that too. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
ca0c6a79d6
commit
5b497cf7ce
1 changed files with 13 additions and 7 deletions
|
@ -23,12 +23,15 @@ This figure shows how devicetree fits into the Zephyr build system:
|
|||
|
||||
Devicetree build flow
|
||||
|
||||
Zephyr's build system can use a devicetree to generate C language code. This
|
||||
code generation uses rules in additional files called :ref:`devicetree bindings
|
||||
<bindings>` to control how devicetree data is converted to C definitions. The
|
||||
generated code can be included by Zephyr :ref:`device drivers <device_drivers>`
|
||||
and other C sources. The C macros generated by this process all begin with
|
||||
``DT_``.
|
||||
Zephyr's build system generates C preprocessor macros from devicetree
|
||||
definitions. These macros can be referenced in :ref:`device drivers
|
||||
<device_drivers>` and other C code. All macro identifiers that are directly
|
||||
generated by the devicetree scripts start with ``DT_*``.
|
||||
|
||||
Some devicetree-related identifiers also start with ``CONFIG_*``, which is the
|
||||
identifier prefix used by :ref:`Kconfig <kconfig>`. This happens when
|
||||
devicetree-related information is referenced from Kconfig symbol definitions,
|
||||
via the :ref:`Kconfig preprocessor <kconfig-functions>`.
|
||||
|
||||
This differs significantly from how devicetree is used on Linux. The
|
||||
Linux kernel would instead read the entire devicetree data structure in its
|
||||
|
@ -470,7 +473,10 @@ to ``uart1`` in this board:
|
|||
zephyr,shell-uart = &uart1;
|
||||
};
|
||||
|
||||
The full set of Zephyr-specific ``chosen`` nodes follows:
|
||||
The table below lists Zephyr-specific ``chosen`` properties. The macro
|
||||
identifiers that start with ``CONFIG_*`` are generated from Kconfig symbols
|
||||
that reference devicetree data via the :ref:`Kconfig preprocessor
|
||||
<kconfig-functions>`.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue