cmake: dts: look for allowed dts overlays file presence in board/
Hardware model v2 allows the usage of <board>_<revision>.overlay and any valid <board>_<identifier>_<revision>.overlay dts overlays in the board/ directory but CMake was only looking for the most specific <board>_<identifier>_<revision>.overlay overlay file. This commit allows CMake to look for the presence of any allowed overlay file to fix this issue. Tested by building the hello_world sample with the Olimex board lora_stm32wl_devkit revision C. The following line wasn't appearing before in build log and now does: "-- Found devicetree overlay: <path>/olimex_lora_stm32wl_devkit_C.overlay" Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
This commit is contained in:
parent
e2058a9537
commit
69648c17d7
1 changed files with 12 additions and 10 deletions
|
@ -133,16 +133,18 @@ if(NOT DEFINED DTS_SOURCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(EXISTS ${DTS_SOURCE})
|
if(EXISTS ${DTS_SOURCE})
|
||||||
# We found a devicetree. Check for a board revision overlay.
|
# We found a devicetree. Append all relevant dts overlays we can find...
|
||||||
if(DEFINED BOARD_REVISION)
|
zephyr_file(CONF_FILES ${BOARD_DIR} DTS DTS_SOURCE)
|
||||||
zephyr_build_string(dts_board_string BOARD ${BOARD}
|
|
||||||
BOARD_IDENTIFIER ${BOARD_IDENTIFIER}
|
zephyr_file(
|
||||||
BOARD_REVISION ${BOARD_REVISION}
|
CONF_FILES ${BOARD_DIR}
|
||||||
)
|
DTS no_rev_suffix_dts_board_overlays
|
||||||
if(EXISTS ${BOARD_DIR}/${dts_board_string}.overlay)
|
BOARD ${BOARD}
|
||||||
list(APPEND DTS_SOURCE ${BOARD_DIR}/${dts_board_string}.overlay)
|
BOARD_IDENTIFIER ${BOARD_IDENTIFIER}
|
||||||
endif()
|
)
|
||||||
endif()
|
|
||||||
|
# ...but remove the ones that do not include the revision suffix
|
||||||
|
list(REMOVE_ITEM DTS_SOURCE ${no_rev_suffix_dts_board_overlays})
|
||||||
else()
|
else()
|
||||||
# If we don't have a devicetree, provide an empty stub
|
# If we don't have a devicetree, provide an empty stub
|
||||||
set(DTS_SOURCE ${ZEPHYR_BASE}/boards/common/stub.dts)
|
set(DTS_SOURCE ${ZEPHYR_BASE}/boards/common/stub.dts)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue