Skip to content

Commit

Permalink
devicetree: drop support for dts_fixup.h files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gmarull authored and carlescufi committed Aug 11, 2022
1 parent fe35e9f commit b2520b0
Show file tree
Hide file tree
Showing 8 changed files with 1,114 additions and 57 deletions.
29 changes: 0 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions cmake/modules/shields.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
1,116 changes: 1,113 additions & 3 deletions doc/build/cmake/build-config-phase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions doc/build/cmake/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 target’s 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
Expand Down
10 changes: 0 additions & 10 deletions doc/build/dts/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions doc/build/dts/macros.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion doc/develop/application/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion include/zephyr/devicetree.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#define DEVICETREE_H

#include <devicetree_unfixed.h>
#include <devicetree_fixups.h>

#include <zephyr/sys/util.h>

Expand Down

0 comments on commit b2520b0

Please sign in to comment.