Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions cmake/modules/dts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,18 @@ set(GEN_EDT_SCRIPT ${DT_SCRIPTS}/gen_edt.py)
# This generates DT information needed by the C macro APIs,
# along with a few other things.
set(GEN_DEFINES_SCRIPT ${DT_SCRIPTS}/gen_defines.py)
# This generates definitions for decimal numbers in the device tree to be used in expr macros.
set(GEN_EXPR_BITS_SCRIPT ${DT_SCRIPTS}/gen_expr_bits.py)
# The edtlib.EDT object in pickle format.
set(EDT_PICKLE ${PROJECT_BINARY_DIR}/edt.pickle)
# The generated file containing the final DTS, for debugging.
set(ZEPHYR_DTS ${PROJECT_BINARY_DIR}/zephyr.dts)
# The generated C header needed by <zephyr/devicetree.h>
set(DEVICETREE_GENERATED_H ${BINARY_DIR_INCLUDE_GENERATED}/devicetree_generated.h)

set(GENERATED_AUTOCONF_H ${BINARY_DIR_INCLUDE_GENERATED}/autoconf.h)
# The file used by <zephyr/sys/util_expr.h>
set(UTIL_EXPR_BITS_GENERATED_H ${BINARY_DIR_INCLUDE_GENERATED}/util_expr_bits_generated.h)
# Generated build system internals.
set(DTS_POST_CPP ${PROJECT_BINARY_DIR}/zephyr.dts.pre)
set(DTS_DEPS ${PROJECT_BINARY_DIR}/zephyr.dts.d)
Expand Down Expand Up @@ -330,6 +336,23 @@ zephyr_file_copy(${DEVICETREE_GENERATED_H}.new ${DEVICETREE_GENERATED_H} ONLY_IF
file(REMOVE ${DEVICETREE_GENERATED_H}.new)
message(STATUS "Generated devicetree_generated.h: ${DEVICETREE_GENERATED_H}")

#
# Run GEN_EXPR_BITS_SCRIPT.
#

set(CMD_GEN_EXPR_BITS ${PYTHON_EXECUTABLE} ${GEN_EXPR_BITS_SCRIPT}
${DEVICETREE_GENERATED_H} ${GENERATED_AUTOCONF_H} --outfile ${UTIL_EXPR_BITS_GENERATED_H}.new
)

execute_process(
COMMAND ${CMD_GEN_EXPR_BITS}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
zephyr_file_copy(${UTIL_EXPR_BITS_GENERATED_H}.new ${UTIL_EXPR_BITS_GENERATED_H} ONLY_IF_DIFFERENT)
file(REMOVE ${UTIL_EXPR_BITS_GENERATED_H}.new)
message(STATUS "Generated expr_bits_generated.h: ${UTIL_EXPR_BITS_GENERATED_H}")

#
# Run GEN_DRIVER_KCONFIG_SCRIPT.
#
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/unittest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ list(APPEND INCL_GENERATED_HEADERS
${INCL_GENERATED_DIR}/offsets.h
${INCL_GENERATED_DIR}/syscall_list.h
${INCL_GENERATED_DIR}/syscall_macros.h
${INCL_GENERATED_DIR}/util_expr_bits_generated.h
${INCL_GENERATED_SYSCALL_DIR}/kernel.h
${INCL_GENERATED_SYSCALL_DIR}/kobject.h
${INCL_GENERATED_SYSCALL_DIR}/log_core.h
Expand Down
1 change: 1 addition & 0 deletions drivers/adc/adc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <soc.h>
#include <zephyr/pm/device.h>
#include <zephyr/pm/policy.h>
#include <zephyr/sys/util_macro_expr.h>
#include <stm32_ll_adc.h>
#include <stm32_ll_system.h>
#if defined(CONFIG_SOC_SERIES_STM32N6X) || \
Expand Down
1 change: 1 addition & 0 deletions drivers/clock_control/clock_stm32_ll_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <zephyr/arch/cpu.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/drivers/clock_control/stm32_clock_control.h>
#include "clock_stm32_ll_common.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/counter/counter_nrfx_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <zephyr/devicetree.h>
#include <hal/nrf_timer.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/sys/util_macro_expr.h>

#define LOG_LEVEL CONFIG_COUNTER_LOG_LEVEL
#define LOG_MODULE_NAME counter_timer
Expand Down
1 change: 1 addition & 0 deletions drivers/dma/dma_mcux_edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <zephyr/kernel.h>
#include <zephyr/devicetree.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/sys/util_macro_expr.h>
#include <zephyr/drivers/dma.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/sys/barrier.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/flash/flash_nxp_s32_qspi_nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LOG_MODULE_REGISTER(nxp_s32_qspi_nor, CONFIG_FLASH_LOG_LEVEL);
#include <zephyr/kernel.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>

#include <Qspi_Ip.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/gpio_renesas_rz.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "r_ioport.h"
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio/gpio_utils.h>
#include <zephyr/sys/util_macro_expr.h>
#include "gpio_renesas_rz.h"
#include <zephyr/logging/log.h>
#if defined(CONFIG_SOC_SERIES_RZN2L)
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/gpio_rzt2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <zephyr/drivers/gpio/gpio_utils.h>
#include <zephyr/drivers/syscon.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>
#include <zephyr/sys/errno_private.h>
#include <zephyr/dt-bindings/gpio/renesas-rzt2m-gpio.h>
#include <soc.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/interrupt_controller/intc_exti_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <stm32_ll_system.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>
#include <zephyr/dt-bindings/pinctrl/stm32-pinctrl-common.h> /* For STM32L0 series */
#include <zephyr/drivers/interrupt_controller/gpio_intc_stm32.h>
#include <zephyr/drivers/clock_control/stm32_clock_control.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/interrupt_controller/intc_gpio_stm32wb0.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <zephyr/irq.h>
#include <zephyr/device.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/drivers/interrupt_controller/gpio_intc_stm32.h>
#include <zephyr/dt-bindings/pinctrl/stm32-pinctrl-common.h> /* For PORTA/PORTB defines */
Expand Down
1 change: 1 addition & 0 deletions drivers/interrupt_controller/intc_plic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <zephyr/device.h>
#include <zephyr/devicetree/interrupt_controller.h>
#include <zephyr/shell/shell.h>
#include <zephyr/sys/util_macro_expr.h>

#include <zephyr/sw_isr_table.h>
#include <zephyr/drivers/interrupt_controller/riscv_plic.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/mbox/mbox_nrf_bellboard_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <zephyr/devicetree.h>
#include <zephyr/drivers/mbox.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>
#include <zephyr/sys/__assert.h>

#include <hal/nrf_bellboard.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/memc/memc_nxp_flexram.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <zephyr/devicetree.h>
#include <zephyr/init.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>
#include <errno.h>
#include <zephyr/irq.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/memc/memc_nxp_s32_qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LOG_MODULE_REGISTER(nxp_s32_qspi_memc, CONFIG_MEMC_LOG_LEVEL);
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/sys/util.h>
#include <zephyr/dt-bindings/qspi/nxp-s32-qspi.h>
#include <zephyr/sys/util_macro_expr.h>

#include <soc.h>
#include "memc_nxp_s32_qspi.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/mipi_dbi/mipi_dbi_stm32_fmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <zephyr/sys/barrier.h>
#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util_macro_expr.h>

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(mipi_dbi_stm32_fmc, CONFIG_MIPI_DBI_LOG_LEVEL);
Expand Down
1 change: 1 addition & 0 deletions drivers/pwm/pwm_mcux_ftm.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <errno.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/irq.h>
#include <zephyr/sys/util_macro_expr.h>
#include <soc.h>
#include <fsl_ftm.h>
#include <fsl_clock.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/pwm/pwm_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <zephyr/cache.h>
#include <zephyr/mem_mgmt/mem_attr.h>
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
#include <zephyr/sys/util_macro_expr.h>
#ifdef CONFIG_SOC_NRF54H20_GPD
#include <nrf/gpd.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <hal/nrf_uarte.h>
#include <nrfx_timer.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>
#include <zephyr/kernel.h>
#include <zephyr/cache.h>
#include <soc.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi_dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ LOG_MODULE_REGISTER(spi_dw);

#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>

#ifdef CONFIG_IOAPIC
#include <zephyr/drivers/interrupt_controller/ioapic.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/spi/spi_nrfx_spim.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/mem_mgmt/mem_attr.h>
#include <zephyr/sys/util_macro_expr.h>
#include <soc.h>
#ifdef CONFIG_SOC_NRF54H20_GPD
#include <nrf/gpd.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/usb_c/tcpc/ucpd_numaker.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/adc.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util_macro_expr.h>

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(tcpc_numaker, CONFIG_USBC_LOG_LEVEL);
Expand Down
1 change: 1 addition & 0 deletions include/zephyr/devicetree.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#endif

#include <zephyr/sys/util.h>
#include <zephyr/sys/util_macro_expr.h>

/**
* @brief devicetree.h API
Expand Down
1 change: 1 addition & 0 deletions include/zephyr/devicetree/interrupt_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extern "C" {

#include <zephyr/devicetree.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/sys/util_macro_expr.h>

/**
* @defgroup devicetree-interrupt_controller Devicetree Interrupt Controller API
Expand Down
1 change: 1 addition & 0 deletions include/zephyr/drivers/adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <zephyr/device.h>
#include <zephyr/dt-bindings/adc/adc.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util_macro_expr.h>

#ifdef __cplusplus
extern "C" {
Expand Down
Loading
Loading