Skip to content

Commit

Permalink
dts: drop HAS_DTS
Browse files Browse the repository at this point in the history
HAS_DTS has become a redundant option. All Zephyr architectures now
select this option, meaning devicetree has become a de-facto
requirement.  In fact, if any board does not provide a devicetree
source, the build system uses an empty stub, meaning the devicetree
machinery always runs.

Signed-off-by: Gerard Marull-Paretas <[email protected]>
  • Loading branch information
gmarull authored and mbolivar-ampere committed Oct 20, 2023
1 parent e1137a3 commit 915cb05
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 30 deletions.
10 changes: 0 additions & 10 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ source "$(ARCH_DIR)/$(ARCH)/Kconfig"
config ARC
bool
select ARCH_IS_SET
select HAS_DTS
imply XIP
select ARCH_HAS_THREAD_LOCAL_STORAGE
select ARCH_SUPPORTS_ROM_START
Expand All @@ -30,7 +29,6 @@ config ARM
bool
select ARCH_IS_SET
select ARCH_SUPPORTS_COREDUMP if CPU_CORTEX_M
select HAS_DTS
# FIXME: current state of the code for all ARM requires this, but
# is really only necessary for Cortex-M with ARM MPU!
select GEN_PRIV_STACKS
Expand All @@ -43,7 +41,6 @@ config ARM64
bool
select ARCH_IS_SET
select 64BIT
select HAS_DTS
select ARCH_SUPPORTS_COREDUMP
select HAS_ARM_SMCCC
select ARCH_HAS_THREAD_LOCAL_STORAGE
Expand All @@ -58,14 +55,12 @@ config MIPS
bool
select ARCH_IS_SET
select ATOMIC_OPERATIONS_C
select HAS_DTS
help
MIPS architecture

config SPARC
bool
select ARCH_IS_SET
select HAS_DTS
select USE_SWITCH
select USE_SWITCH_SUPPORTED
select BIG_ENDIAN
Expand All @@ -80,7 +75,6 @@ config X86
bool
select ARCH_IS_SET
select ATOMIC_OPERATIONS_BUILTIN
select HAS_DTS
select ARCH_SUPPORTS_COREDUMP
select ARCH_SUPPORTS_ROM_START if !X86_64
select CPU_HAS_MMU
Expand All @@ -102,7 +96,6 @@ config NIOS2
bool
select ARCH_IS_SET
select ATOMIC_OPERATIONS_C
select HAS_DTS
imply XIP
select ARCH_HAS_TIMING_FUNCTIONS
help
Expand All @@ -111,7 +104,6 @@ config NIOS2
config RISCV
bool
select ARCH_IS_SET
select HAS_DTS
select ARCH_SUPPORTS_COREDUMP
select ARCH_SUPPORTS_ROM_START if !SOC_SERIES_ESP32C3
select ARCH_HAS_CODE_DATA_RELOCATION
Expand All @@ -128,7 +120,6 @@ config RISCV
config XTENSA
bool
select ARCH_IS_SET
select HAS_DTS
select USE_SWITCH
select USE_SWITCH_SUPPORTED
select IRQ_OFFLOAD_NESTED if IRQ_OFFLOAD
Expand All @@ -141,7 +132,6 @@ config XTENSA
config ARCH_POSIX
bool
select ARCH_IS_SET
select HAS_DTS
select ATOMIC_OPERATIONS_BUILTIN
select ARCH_HAS_CUSTOM_SWAP_TO_MAIN
select ARCH_HAS_CUSTOM_BUSY_WAIT
Expand Down
5 changes: 0 additions & 5 deletions cmake/modules/dts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ include(pre_dt)
find_package(HostTools)
find_package(Dtc 1.4.6)

# Zephyr code is usually configured using devicetree, but this is
# still technically optional (see e.g. CONFIG_HAS_DTS).
#
# This module makes information from the devicetree available to
# various build stages, as well as to other arbitrary Python scripts:
#
Expand Down Expand Up @@ -125,8 +122,6 @@ set(DTS_CMAKE ${PROJECT_BINARY_DIR}/dts.cmake)
# modules.
set(VENDOR_PREFIXES dts/bindings/vendor-prefixes.txt)

# TODO: What to do about non-posix platforms where NOT CONFIG_HAS_DTS (xtensa)?
# Drop support for NOT CONFIG_HAS_DTS perhaps?
set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)
if(EXISTS ${DTS_SOURCE})
# We found a devicetree. Check for a board revision overlay.
Expand Down
6 changes: 0 additions & 6 deletions dts/Kconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# SPDX-License-Identifier: Apache-2.0

config HAS_DTS
bool
help
This option specifies that the target platform supports device tree
configuration.

menu "Devicetree Info"

osource "$(KCONFIG_BINARY_DIR)/Kconfig.dts"
Expand Down
2 changes: 0 additions & 2 deletions include/zephyr/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,6 @@ static inline bool z_impl_device_is_ready(const struct device *dev)
\
Z_DEVICE_INIT_ENTRY_DEFINE(node_id, dev_id, init_fn, level, prio)

#if defined(CONFIG_HAS_DTS) || defined(__DOXYGEN__)
/**
* @brief Declare a device for each status "okay" devicetree node.
*
Expand All @@ -1020,7 +1019,6 @@ static inline bool z_impl_device_is_ready(const struct device *dev)
extern const struct device DEVICE_DT_NAME_GET(node_id);

DT_FOREACH_STATUS_OKAY_NODE(Z_MAYBE_DEVICE_DECLARE_INTERNAL)
#endif /* CONFIG_HAS_DTS */

/** @endcond */

Expand Down
2 changes: 0 additions & 2 deletions include/zephyr/drivers/emul.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,9 @@ const struct emul *emul_get_binding(const char *name);
* @}
*/

#if defined(CONFIG_HAS_DTS) || defined(__DOXYGEN__)
#define Z_MAYBE_EMUL_DECLARE_INTERNAL(node_id) extern const struct emul EMUL_DT_NAME_GET(node_id);

DT_FOREACH_STATUS_OKAY_NODE(Z_MAYBE_EMUL_DECLARE_INTERNAL);
#endif /* CONFIG_HAS_DTS || __DOXYGEN__ */

#ifdef __cplusplus
}
Expand Down
3 changes: 0 additions & 3 deletions include/zephyr/drivers/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1260,8 +1260,6 @@ static inline int64_t sensor_value_to_micro(const struct sensor_value *val)
* @}
*/

#if defined(CONFIG_HAS_DTS) || defined(__DOXYGEN__)

/**
* @brief Get the decoder name for the current driver
*
Expand Down Expand Up @@ -1309,7 +1307,6 @@ static inline int64_t sensor_value_to_micro(const struct sensor_value *val)
())

DT_FOREACH_STATUS_OKAY_NODE(Z_MAYBE_SENSOR_DECODER_DECLARE_INTERNAL)
#endif /* defined(CONFIG_HAS_DTS) || defined(__DOXYGEN__) */

#ifdef __cplusplus
}
Expand Down
3 changes: 1 addition & 2 deletions subsys/shell/backends/Kconfig.backends
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ config SHELL_BACKEND_SERIAL
bool "Serial backend"
# Serial (UART) requires interrupts and the RTT backend cannot be used from an ISR context.
default n if SHELL_BACKEND_RTT
default "$(dt_chosen_enabled,$(DT_CHOSEN_Z_SHELL_UART))" if HAS_DTS
default y if !HAS_DTS
default "$(dt_chosen_enabled,$(DT_CHOSEN_Z_SHELL_UART))"
select SERIAL
select RING_BUFFER
help
Expand Down

0 comments on commit 915cb05

Please sign in to comment.