|
| 1 | +# SPDX-License-Identifier: Apache-2.0 |
| 2 | + |
| 3 | +zephyr_library() |
| 4 | + |
| 5 | +if(CONFIG_ARM) |
| 6 | + set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "SoC Linker script") |
| 7 | +endif() |
| 8 | + |
| 9 | +zephyr_library_sources( |
| 10 | + ${ZEPHYR_BASE}/soc/nordic/validate_base_addresses.c |
| 11 | + ${ZEPHYR_BASE}/soc/nordic/validate_binding_headers.c |
| 12 | + ${ZEPHYR_BASE}/soc/nordic/validate_enabled_instances.c |
| 13 | +) |
| 14 | + |
| 15 | +# Include dt-bindings headers into the build. This lets us validate all required |
| 16 | +# DT values against the MDK, without having to conditionally include different |
| 17 | +# headers for different SoCs. |
| 18 | +set(dt_binding_includes ${DTS_INCLUDE_FILES}) |
| 19 | +list(FILTER dt_binding_includes INCLUDE REGEX "/dt-bindings/.*\.h$") |
| 20 | +list(TRANSFORM dt_binding_includes PREPEND "-include;") |
| 21 | +set_source_files_properties( |
| 22 | + validate_binding_headers.c |
| 23 | + DIRECTORY ${CMAKE_CURRENT_LIST_DIR} |
| 24 | + PROPERTIES COMPILE_OPTIONS "${dt_binding_includes}" |
| 25 | +) |
| 26 | + |
| 27 | +if(CONFIG_SOC_HAS_TIMING_FUNCTIONS AND NOT CONFIG_BOARD_HAS_TIMING_FUNCTIONS) |
| 28 | + if(CONFIG_TIMING_FUNCTIONS) |
| 29 | + # Use nRF-specific timing calculations only if DWT is not present |
| 30 | + if(NOT CONFIG_CORTEX_M_DWT) |
| 31 | + zephyr_library_sources(${ZEPHYR_BASE}/soc/nordic/timing.c) |
| 32 | + endif() |
| 33 | + endif() |
| 34 | +endif() |
| 35 | + |
| 36 | +if(CONFIG_BUILD_WITH_TFM) |
| 37 | + set_property(TARGET zephyr_property_target |
| 38 | + APPEND PROPERTY TFM_CMAKE_OPTIONS -DHAL_NORDIC_PATH=${ZEPHYR_HAL_NORDIC_MODULE_DIR} |
| 39 | + APPEND PROPERTY TFM_CMAKE_OPTIONS -DZEPHYR_BASE=${ZEPHYR_BASE} |
| 40 | + APPEND PROPERTY TFM_CMAKE_OPTIONS -DNRF_NS_STORAGE=${CONFIG_TFM_NRF_NS_STORAGE} |
| 41 | + ) |
| 42 | +endif() |
| 43 | + |
| 44 | +add_subdirectory(${SOC_SERIES}) |
| 45 | +include_directories(${ZEPHYR_BASE}/soc/nordic/common) |
0 commit comments