Skip to content
Permalink
Browse files

soc: nrf: Conditionally enable clock control and timer

The CONFIG_CLOCK_CONTROL and CONFIG_NRF_RTC_TIMER were
unconditionally selected when enabling any nRF SoC. But since
timers can be disabled in the kernel, depend instead on
CONFIG_SYS_CLOCK_EXISTS, which is only defined when kernel
timer support is included.

Note that ideally we would enable CONFIG_NRF_RTC_TIMER only, and
that would select CONFIG_CLOCK_CONTROL (on which the RTC timer
depends) but there is a circular Kconfig dependency that prevents
us from doing so.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
  • Loading branch information...
carlescufi committed May 9, 2019
1 parent 201fdf0 commit 5ec96b176689e192d205d4952df8ef23b17f1511
@@ -9,6 +9,15 @@ if SOC_FAMILY_NRF

source "soc/arm/nordic_nrf/*/Kconfig.defconfig.series"

if SYS_CLOCK_EXISTS
# If the kernel has timer support, enable both clock control and timer
config CLOCK_CONTROL
default y

config NRF_RTC_TIMER
default y
endif # SYS_CLOCK_EXISTS

config SYS_CLOCK_HW_CYCLES_PER_SEC
int
default 32768
@@ -20,6 +29,9 @@ config SYS_CLOCK_TICKS_PER_SEC
config ARCH_HAS_CUSTOM_BUSY_WAIT
default y

config SYS_POWER_MANAGEMENT
default y

config BUILD_OUTPUT_HEX
default y

@@ -13,9 +13,6 @@ source "soc/arm/nordic_nrf/nrf51/Kconfig.defconfig.nrf51*"
config SOC_SERIES
default "nrf51"

config SYS_POWER_MANAGEMENT
default y

config NUM_IRQS
int
default 26
@@ -10,8 +10,6 @@ config SOC_SERIES_NRF51X
bool "Nordic Semiconductor nRF51 series MCU"
select CPU_CORTEX_M0
select SOC_FAMILY_NRF
select NRF_RTC_TIMER
select CLOCK_CONTROL
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_CMSIS
@@ -12,9 +12,6 @@ source "soc/arm/nordic_nrf/nrf52/Kconfig.defconfig.nrf52*"
config SOC_SERIES
default "nrf52"

config SYS_POWER_MANAGEMENT
default y

config TEMP_NRF5
default SENSOR

@@ -11,8 +11,6 @@ config SOC_SERIES_NRF52X
select CPU_CORTEX_M4
select CPU_HAS_ARM_MPU
select SOC_FAMILY_NRF
select NRF_RTC_TIMER
select CLOCK_CONTROL
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_CMSIS
@@ -12,7 +12,4 @@ source "soc/arm/nordic_nrf/nrf91/Kconfig.defconfig.nrf91*"
config SOC_SERIES
default "nrf91"

config SYS_POWER_MANAGEMENT
default y

endif # SOC_SERIES_NRF91X
@@ -13,8 +13,6 @@ config SOC_SERIES_NRF91X
select CPU_HAS_FPU
select ARMV8_M_DSP
select SOC_FAMILY_NRF
select NRF_RTC_TIMER
select CLOCK_CONTROL
select HAS_SYS_POWER_STATE_DEEP_SLEEP_1
select XIP
select HAS_CMSIS

0 comments on commit 5ec96b1

Please sign in to comment.
You can’t perform that action at this time.