From 9b1969a20698a0903d9a63da46de2f948aa022fe Mon Sep 17 00:00:00 2001 From: Paul Schaetzle Date: Mon, 5 May 2025 13:35:42 +0200 Subject: [PATCH] doc: dts: explain the usage of pre_dt_shield.cmake Mention the possible use of pre_dt_shield.cmake in the devicetree and shield documentation. Signed-off-by: Paul Schaetzle --- doc/build/dts/intro-input-output.rst | 3 +++ doc/hardware/porting/shields.rst | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/build/dts/intro-input-output.rst b/doc/build/dts/intro-input-output.rst index d069ae4660c..8da215ab800 100644 --- a/doc/build/dts/intro-input-output.rst +++ b/doc/build/dts/intro-input-output.rst @@ -112,6 +112,9 @@ this: list(APPEND EXTRA_DTC_FLAGS "-Wno-simple_bus_reg") +Shield directories can contain a file named :file:`pre_dt_shield.cmake` which +has the same functionality as the aforementioned :file:`pre_dt_board.cmake`. + .. _dt-outputs: Output files diff --git a/doc/hardware/porting/shields.rst b/doc/hardware/porting/shields.rst index 6f3dff1be5f..d93a4354063 100644 --- a/doc/hardware/porting/shields.rst +++ b/doc/hardware/porting/shields.rst @@ -19,7 +19,8 @@ under :zephyr_file:`boards/shields`: boards/shields/ ├── .overlay ├── Kconfig.shield - └── Kconfig.defconfig + ├── Kconfig.defconfig + └── pre_dt_shield.cmake These files provides shield configuration as follows: @@ -37,6 +38,9 @@ These files provides shield configuration as follows: shield configuration should be done by keeping in mind that features activation is application responsibility. +* **pre_dt_shield.cmake**: This optional file can be used to pass additional + arguments to the devicetree compiler ``dtc``. + Besides, in order to avoid name conflicts with devices that may be defined at board level, it is advised, specifically for shields devicetree descriptions, to provide a device nodelabel is the form _, for instance: