Skip to content

Commit c99243c

Browse files
wearyzennashif
authored andcommitted
arch: arm: cleanup of soc flags in arch
What is changed? Use CMSIS SystemCoreClock via a dedicated flag instead of using soc flags. Why do we need this change? This change is part of cleaning soc specific code out of arch folder. Signed-off-by: Sudan Landge <[email protected]>
1 parent 14117b4 commit c99243c

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

arch/arm/core/cortex_m/timing.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
*/
2929
static inline uint64_t z_arm_dwt_freq_get(void)
3030
{
31-
#if defined(CONFIG_SOC_FAMILY_NORDIC_NRF) || \
32-
defined(CONFIG_SOC_SERIES_IMXRT6XX)
31+
#if defined(CONFIG_CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK)
3332
/*
3433
* DWT frequency is taken directly from the
3534
* System Core clock (CPU) frequency, if the

modules/cmsis/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ config CMSIS_M_CHECK_DEVICE_DEFINES
2828
help
2929
This options enables the validation of CMSIS configuration flags.
3030

31+
config CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK
32+
bool
33+
help
34+
Enable this option if CMSIS SystemCoreClock symbols is available.
35+
3136
endif

soc/nordic/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
config SOC_FAMILY_NORDIC_NRF
1010
select SOC_COMPATIBLE_NRF
1111
select SOC_RESET_HOOK if ARM
12+
select CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK if ARM
1213

1314
if SOC_FAMILY_NORDIC_NRF
1415

soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
if SOC_SERIES_IMXRT6XX
77

8+
config CMSIS_CORE_HAS_SYSTEM_CORE_CLOCK
9+
bool
10+
default y
11+
812
# alias for hal
913
config SOC_SERIES_IMX_RT6XX
1014
bool

0 commit comments

Comments
 (0)