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 <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2019-07-04 09:48:53 -05:00 committed by Kumar Gala
commit 8437ab10eb
2 changed files with 9 additions and 6 deletions

View file

@ -19,11 +19,12 @@ set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)
set_ifndef(DTS_COMMON_OVERLAYS ${ZEPHYR_BASE}/dts/common/common.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 # 'DTS_ROOT' is a list of directories where a directory tree with DT
# files may be found. It always includes the application directory and # files may be found. It always includes the application directory,
# ${ZEPHYR_BASE}. # the board directory, and ${ZEPHYR_BASE}.
list(APPEND list(APPEND
DTS_ROOT DTS_ROOT
${APPLICATION_SOURCE_DIR} ${APPLICATION_SOURCE_DIR}
${BOARD_DIR}
${ZEPHYR_BASE} ${ZEPHYR_BASE}
) )

View file

@ -701,13 +701,15 @@ You can also define the ``SOC_ROOT`` variable in the application
DeviceTree Definitions DeviceTree Definitions
====================== ======================
Additional DeviceTree directory trees, or DTS_ROOTs, can be added by DeviceTree directory trees are found in ``APPLICATION_SOURCE_DIR``,
creating this directory tree:: ``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/common/
dts/arm/ dts/arm/
include/ dts/
dts/bindings/
Where 'arm' is changed to the appropriate architecture. Each directory Where 'arm' is changed to the appropriate architecture. Each directory
is optional. The binding directory contains bindings and the other is optional. The binding directory contains bindings and the other