From 8437ab10eb2efb1083704ee696818c1a7f93cb39 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Thu, 4 Jul 2019 09:48:53 -0500 Subject: [PATCH] cmake: DT: Add support for overlays that reference board-provided dtsi The Particle mesh feather boards provide device-tree overlays that allow individual applications to select the SPI peripheral to be used for the pins associated with a specific labelled SPI device. This is necessary because different peripheral instances have slightly different properties. Add BOARD_DIR to DTS_ROOTS so these shared files can be located when included from application-specific overlays. Signed-off-by: Peter A. Bigot --- cmake/dts.cmake | 5 +++-- doc/application/index.rst | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/dts.cmake b/cmake/dts.cmake index a9c69cccb72..97f66f6a9ff 100644 --- a/cmake/dts.cmake +++ b/cmake/dts.cmake @@ -19,11 +19,12 @@ set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts) set_ifndef(DTS_COMMON_OVERLAYS ${ZEPHYR_BASE}/dts/common/common.dts) # 'DTS_ROOT' is a list of directories where a directory tree with DT -# files may be found. It always includes the application directory and -# ${ZEPHYR_BASE}. +# files may be found. It always includes the application directory, +# the board directory, and ${ZEPHYR_BASE}. list(APPEND DTS_ROOT ${APPLICATION_SOURCE_DIR} + ${BOARD_DIR} ${ZEPHYR_BASE} ) diff --git a/doc/application/index.rst b/doc/application/index.rst index ae1eec728e8..758f759ce4c 100644 --- a/doc/application/index.rst +++ b/doc/application/index.rst @@ -701,13 +701,15 @@ You can also define the ``SOC_ROOT`` variable in the application DeviceTree Definitions ====================== -Additional DeviceTree directory trees, or DTS_ROOTs, can be added by -creating this directory tree:: +DeviceTree directory trees are found in ``APPLICATION_SOURCE_DIR``, +``BOARD_DIR``, and ``ZEPHYR_BASE``, but additional trees, or DTS_ROOTs, +can be added by creating this directory tree:: - dts/bindings/ + include/ dts/common/ dts/arm/ - include/ + dts/ + dts/bindings/ Where 'arm' is changed to the appropriate architecture. Each directory is optional. The binding directory contains bindings and the other