devicetree: drop support for dts_fixup.h files

Devicetree fixup files existed previous to the current stable Devicetree
API. While they served their purpose, they are no longer necessary nor
used in-tree. This patch drops support for this legacy feature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-08-04 16:54:47 +02:00 committed by Carles Cufí
commit b2520b09a7
8 changed files with 1114 additions and 57 deletions

View file

@ -496,35 +496,6 @@ add_custom_command(
)
add_custom_target(version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/version.h)
set_ifndef( DTS_BOARD_FIXUP_FILE ${BOARD_DIR}/dts_fixup.h)
set_ifndef( DTS_SOC_FIXUP_FILE ${SOC_DIR}/${ARCH}/${SOC_PATH}/dts_fixup.h)
set( DTS_APP_FIXUP_FILE ${APPLICATION_SOURCE_DIR}/dts_fixup.h)
set_ifndef(DTS_CAT_OF_FIXUP_FILES ${ZEPHYR_BINARY_DIR}/include/generated/devicetree_fixups.h)
# Concatenate the fixups into a single header file for easy
# #include'ing
file(WRITE ${DTS_CAT_OF_FIXUP_FILES}.new "/* May only be included by devicetree.h */\n\n")
set(DISCOVERED_FIXUP_FILES)
foreach(fixup_file
${DTS_BOARD_FIXUP_FILE}
${DTS_SOC_FIXUP_FILE}
${DTS_APP_FIXUP_FILE}
${shield_dts_fixups}
)
if(EXISTS ${fixup_file})
file(READ ${fixup_file} contents)
file(APPEND ${DTS_CAT_OF_FIXUP_FILES}.new "${contents}")
string(APPEND DISCOVERED_FIXUP_FILES "- ${fixup_file}\n")
endif()
endforeach()
zephyr_file_copy(${DTS_CAT_OF_FIXUP_FILES}.new ${DTS_CAT_OF_FIXUP_FILES} ONLY_IF_DIFFERENT)
file(REMOVE ${DTS_CAT_OF_FIXUP_FILES}.new)
if (DISCOVERED_FIXUP_FILES)
message(WARNING "One or more dts_fixup.h files detected:\n${DISCOVERED_FIXUP_FILES}Use of these files is deprecated; use the devicetree.h API instead.")
endif()
# Unfortunately, the order in which CMakeLists.txt code is processed
# matters so we need to be careful about how we order the processing
# of subdirectories. One example is "Compiler flags added late in the

View file

@ -80,11 +80,6 @@ foreach(root ${BOARD_ROOT})
${SHIELD_DIR_${s}}/${s}.overlay
)
list(APPEND
shield_dts_fixups
${SHIELD_DIR_${s}}/dts_fixup.h
)
list(APPEND
SHIELD_DIRS
${SHIELD_DIR_${s}}

1116
doc/build/cmake/build-config-phase.svg generated vendored

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Before After
Before After

View file

@ -107,12 +107,6 @@ Devicetree
The above is just a brief overview. For more information on devicetree, see
:ref:`dt-guide`.
Devicetree fixups
Files named :file:`dts_fixup.h` from the targets architecture, SoC, board,
and application directories are concatenated into a single
:file:`devicetree_fixups.h` file. :file:`dts_fixup.h` files are a legacy
feature which should not be used in new code.
Kconfig
:file:`Kconfig` files define available configuration options for for the
target architecture, SoC, board, and application, as well as dependencies

View file

@ -589,12 +589,6 @@ the contents of devicetree sources, includes, and overlays in a way that allows
the build system to generate C macros usable by device drivers and
applications. The :file:`dts/bindings` directory contains bindings.
Zephyr currently uses :file:`dts_fixup.h` files to rename macros in
:file:`devicetree_unfixed.h` to names that are currently in use by C code. The
build system looks for fixup files in the :file:`zephyr/boards/` and
:file:`zephyr/soc/` directories by default. Fixup files exist for historical
reasons. New code should generally avoid them.
.. _dt-scripts:
Scripts and tools
@ -648,10 +642,6 @@ These are created in your application's build directory.
The generated macros and additional comments describing the devicetree.
Included by ``devicetree.h``.
:file:`<build>/zephyr/include/generated/devicetree_fixups.h`
The concatenated contents of any :file:`dts_fixup.h` files.
Included by ``devicetree.h``.
:file:`<build>/zephyr/zephyr.dts`
The final merged devicetree. This file is output by :file:`gen_defines.py`.
It is useful for debugging any issues. If the devicetree compiler ``dtc`` is

View file

@ -2,8 +2,7 @@
;
; This does *not* cover macros pulled out of DT via Kconfig,
; like CONFIG_SRAM_BASE_ADDRESS, etc. It only describes the
; ones that start with DT_ and are directly generated, not
; defined in a dts_fixup.h file.
; ones that start with DT_ and are directly generated.
; --------------------------------------------------------------------
; dt-macro: the top level nonterminal for a devicetree macro

View file

@ -1105,7 +1105,6 @@ Zephyr board, and provide the following files::
board.h
CMakeLists.txt
doc/
dts_fixup.h
Kconfig.board
Kconfig.defconfig
pinmux.c

View file

@ -17,7 +17,6 @@
#define DEVICETREE_H
#include <devicetree_unfixed.h>
#include <devicetree_fixups.h>
#include <zephyr/sys/util.h>