cmake: modules: dts: use devicetree stub file
By providing a devicetree stub file, we make sure some internal macros required by devicetree.h are generated in devicetree_generated.h. This makes sure that systems without devicetree can continue working without extra ifdeffery. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
a4e9aed68d
commit
e1137a3e5e
14
boards/common/stub.dts
Normal file
14
boards/common/stub.dts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* empty stub file provided for systems not using devicetree */
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
|
||||||
|
#include <skeleton.dtsi>
|
||||||
|
|
||||||
|
/ {
|
||||||
|
|
||||||
|
};
|
|
@ -125,10 +125,6 @@ set(DTS_CMAKE ${PROJECT_BINARY_DIR}/dts.cmake)
|
||||||
# modules.
|
# modules.
|
||||||
set(VENDOR_PREFIXES dts/bindings/vendor-prefixes.txt)
|
set(VENDOR_PREFIXES dts/bindings/vendor-prefixes.txt)
|
||||||
|
|
||||||
#
|
|
||||||
# Halt execution early if there is no devicetree.
|
|
||||||
#
|
|
||||||
|
|
||||||
# TODO: What to do about non-posix platforms where NOT CONFIG_HAS_DTS (xtensa)?
|
# TODO: What to do about non-posix platforms where NOT CONFIG_HAS_DTS (xtensa)?
|
||||||
# Drop support for NOT CONFIG_HAS_DTS perhaps?
|
# Drop support for NOT CONFIG_HAS_DTS perhaps?
|
||||||
set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)
|
set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)
|
||||||
|
@ -138,10 +134,8 @@ if(EXISTS ${DTS_SOURCE})
|
||||||
list(APPEND DTS_SOURCE ${BOARD_DIR}/${BOARD}_${BOARD_REVISION_STRING}.overlay)
|
list(APPEND DTS_SOURCE ${BOARD_DIR}/${BOARD}_${BOARD_REVISION_STRING}.overlay)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# If we don't have a devicetree after all, there's not much to do.
|
# If we don't have a devicetree, provide an empty stub
|
||||||
set(header_template ${ZEPHYR_BASE}/misc/generated/generated_header.template)
|
set(DTS_SOURCE ${ZEPHYR_BASE}/boards/common/stub.dts)
|
||||||
zephyr_file_copy(${header_template} ${DEVICETREE_GENERATED_H} ONLY_IF_DIFFERENT)
|
|
||||||
return()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
/* WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY! */
|
|
Loading…
Reference in a new issue