soc: arm: nordic_nrf: Clean up and unify a bit cmake code

Consistently use `zephyr_library*` cmake functions for all nRF Series
and set the Cortex-M linker script in a common place for all of them.
Remove no longer needed include directories.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2024-01-09 16:16:27 +01:00 committed by David Leach
commit eb78b71914
7 changed files with 13 additions and 42 deletions

View file

@ -1,9 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
add_subdirectory(${SOC_SERIES})
add_subdirectory(common)
zephyr_sources(
zephyr_library_sources(
validate_base_addresses.c
validate_enabled_instances.c
)

View file

@ -3,10 +3,13 @@
zephyr_library_sources_ifdef(CONFIG_SOC_FAMILY_NRF soc_nrf_common.S)
zephyr_library_sources_ifdef(CONFIG_POWEROFF poweroff.c)
zephyr_include_directories(.)
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
if (CONFIG_TFM_PARTITION_PLATFORM)
zephyr_sources(soc_secure.c)
zephyr_library_sources(soc_secure.c)
zephyr_library_include_directories(
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/api_ns/interface/include
)

View file

@ -1,14 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_sources(
soc.c
)
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/arm/include
)
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
zephyr_library_sources(soc.c)

View file

@ -1,15 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library()
zephyr_library_sources(
soc.c
)
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/arm/include
)
zephyr_library_sources(soc.c)
if(CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 AND CONFIG_SPI_NRFX_SPIM)
message(WARNING "Both SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58 and an NRF SPIM driver are enabled, therefore PAN 58 will apply if RXD.MAXCNT == 1 and TXD.MAXCNT <= 1")
@ -22,5 +13,3 @@ if(CONFIG_SOC_NRF52832)
endif()
endif()
endif()
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

View file

@ -1,12 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources(
soc.c
)
zephyr_library_sources(soc.c)
zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC
sync_rtc.c
)
zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC sync_rtc.c)
if (CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED AND
NOT CONFIG_SYS_CLOCK_EXISTS)
@ -19,5 +15,3 @@ if (CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED AND
At your own risk, you can suppress this warning by setting
CONFIG_SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED=n.")
endif()
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")

View file

@ -1,12 +1,10 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
zephyr_sources(
zephyr_library_sources(
soc.c
../validate_rram_partitions.c)
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
if (CONFIG_ELV_GRTC_LFXO_ALLOWED)
message(WARNING "WARNING! ELV mode feature is EXPERIMENTAL and may brick your device!")
endif()

View file

@ -1,7 +1,3 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_sources(
soc.c
)
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
zephyr_library_sources(soc.c)