Lines Matching +full:dts +full:- +full:bindings
1 # SPDX-License-Identifier: Apache-2.0
18 # - To Zephyr and application source code files, as a C macro API
21 # - To other arbitrary Python scripts (like twister) using a
25 # - To users as a final devicetree source (DTS) file which can
28 # - To CMake files, after this module has finished running, using
31 # - To Kconfig files, both using some Kconfig symbols we generate
39 # files in scripts/dts to make all this work. We also optionally will
47 # - The pre_dt module has been included; refer to its outcome
49 # - DTS_SOURCE: set to the path to the devicetree file which
51 # - ${BINARY_DIR_INCLUDE_GENERATED}/devicetree_generated.h exists
56 # - CACHED_DTS_ROOT_BINDINGS is set in the cache to the
58 # - DTS_ROOT_BINDINGS is set to a ;-list of locations where DT
59 # bindings were found
60 # - ${PROJECT_BINARY_DIR}/zephyr.dts exists
61 # - ${PROJECT_BINARY_DIR}/edt.pickle exists
62 # - ${KCONFIG_BINARY_DIR}/Kconfig.dts exists
63 # - the build system will be regenerated if any devicetree files
65 # - the devicetree extensions in the extensions.cmake module
70 # - BINARY_DIR_INCLUDE_GENERATED: where to put generated include files
71 # - KCONFIG_BINARY_DIR: where to put generated Kconfig files
74 # - BOARD: board name to use when looking for DTS_SOURCE
75 # - BOARD_DIR: board directory to use when looking for DTS_SOURCE
76 # - BOARD_REVISION_STRING: used when looking for a board revision's
78 # - DTC_OVERLAY_FILE: list of devicetree overlay files which will be
80 # - EXTRA_DTC_OVERLAY_FILE: list of extra devicetree overlay files.
84 # - EXTRA_DTC_FLAGS: list of extra command line options to pass to
87 # - DTS_EXTRA_CPPFLAGS: extra command line options to pass to the
89 # - DTS_SOURCE: the devicetree source file to use may be pre-set
91 # ${BOARD_DIR}/${BOARD}.dts
94 # use only, and may be removed, renamed, or re-purposed without prior notice.
97 set(DT_SCRIPTS ${ZEPHYR_BASE}/scripts/dts)
104 # The generated file containing the final DTS, for debugging.
105 set(ZEPHYR_DTS ${PROJECT_BINARY_DIR}/zephyr.dts)
109 set(DTS_POST_CPP ${PROJECT_BINARY_DIR}/zephyr.dts.pre)
110 set(DTS_DEPS ${PROJECT_BINARY_DIR}/zephyr.dts.d)
115 set(DTS_KCONFIG ${KCONFIG_BINARY_DIR}/Kconfig.dts)
121 set(DTS_CMAKE ${PROJECT_BINARY_DIR}/dts.cmake)
126 set(VENDOR_PREFIXES dts/bindings/vendor-prefixes.txt)
132 # TODO: What to do about non-posix platforms where NOT CONFIG_HAS_DTS (xtensa)?
134 set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)
148 # Find all the DTS files we need to concatenate and preprocess, as
149 # well as all the devicetree bindings and vendor prefixes associated
153 zephyr_file(CONF_FILES ${BOARD_EXTENSION_DIRS} DTS board_extension_dts_files)
182 message(STATUS "Found BOARD.dts: ${dts_file}")
192 set(bindings_path ${dts_root}/dts/bindings)
202 list(APPEND EXTRA_GEN_DEFINES_ARGS --vendor-prefixes ${vendor_prefixes})
206 # Cache the location of the root bindings so they can be used by
209 "DT bindings root directories")
218 # challenging is this? Can we cache the dts dependencies?
220 # Run the preprocessor on the DTS input files.
237 # Make sure we re-run CMake if any devicetree sources or transitive
248 # build system to re-run CMake.
263 --dts ${DTS_POST_CPP}
264 --dtc-flags '${EXTRA_DTC_FLAGS_RAW}'
265 --bindings-dirs ${DTS_ROOT_BINDINGS}
266 --header-out ${DEVICETREE_GENERATED_H}.new
267 --dts-out ${ZEPHYR_DTS}.new # for debugging and dtc
268 --edt-pickle-out ${EDT_PICKLE}
284 message(STATUS "Generated zephyr.dts: ${ZEPHYR_DTS}")
294 --kconfig-out ${DTS_KCONFIG}
295 --bindings-dirs ${DTS_ROOT_BINDINGS}
309 --edt-pickle ${EDT_PICKLE}
310 --cmake-out ${DTS_CMAKE}
317 message(STATUS "Including generated dts.cmake file: ${DTS_CMAKE}")
330 check_dtc_flag("-Wunique_unit_address_if_enabled" check)
332 set(DTC_WARN_UNIT_ADDR_IF_ENABLED "-Wunique_unit_address_if_enabled")
336 check_dtc_flag("-Wno-unique_unit_address" check)
338 set(DTC_NO_WARN_UNIT_ADDR "-Wno-unique_unit_address")
352 -O dts
353 -o - # Write output to stdout, which we discard below
354 -b 0
355 -E unit_address_vs_reg