From 32d0c8d8e5c76039ea64e7101b6e7c1a0b56264c Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Tue, 17 Oct 2023 17:06:01 +0200 Subject: [PATCH] nrf53: Refactor sync RTC options to their own file So they can be reused by the simulated board Signed-off-by: Alberto Escolar Piedras --- soc/arm/nordic_nrf/nrf53/Kconfig.soc | 74 +--------------------- soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc | 77 +++++++++++++++++++++++ 2 files changed, 78 insertions(+), 73 deletions(-) create mode 100644 soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.soc b/soc/arm/nordic_nrf/nrf53/Kconfig.soc index 2cd934af324..f6a2c019f5f 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.soc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.soc @@ -188,78 +188,6 @@ config BUILD_WITH_TFM # TF-M nRF53 platform enables the cache unconditionally. select NRF_ENABLE_CACHE if SOC_NRF5340_CPUAPP -config NRF53_SYNC_RTC - bool "RTC clock synchronization" - default y if LOG && !LOG_MODE_MINIMAL - depends on NRF_RTC_TIMER - select NRFX_DPPI - select MBOX if !IPM +rsource "Kconfig.sync_rtc" -if NRF53_SYNC_RTC - -module = SYNC_RTC -module-str = Synchronized RTC -source "subsys/logging/Kconfig.template.log_config" - -config NRF53_SYNC_RTC_INIT_PRIORITY - int "nRF53 Synchronized RTC init priority" - default APPLICATION_INIT_PRIORITY - help - nRF53 Synchronized RTC initialization priority. - -config NRF_RTC_TIMER_USER_CHAN_COUNT - default 2 if NRF_802154_RADIO_DRIVER && SOC_NRF5340_CPUNET - default 3 if NRF_802154_RADIO_DRIVER - default 1 - -config NRF53_SYNC_RTC_LOG_TIMESTAMP - bool "Use Synchronized RTC for logging timestamp" - default y - -config NRF53_SYNC_RTC_IPM_OUT - int "IPM channel from APP to NET" - range 0 15 - default 7 if SOC_NRF5340_CPUAPP - default 8 - -config NRF53_SYNC_RTC_IPM_IN - int "IPM channel from APP to NET" - range 0 15 - default 8 if SOC_NRF5340_CPUAPP - default 7 - -ipm_num = 0 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 1 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 2 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 3 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 4 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 5 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 6 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 7 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 8 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 9 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 10 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 11 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 12 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 13 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 14 -rsource "Kconfig.sync_rtc_ipm" -ipm_num = 15 -rsource "Kconfig.sync_rtc_ipm" - -endif # NRF53_SYNC_RTC endif # SOC_SERIES_NRF53X diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc b/soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc new file mode 100644 index 00000000000..631e1db67df --- /dev/null +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc @@ -0,0 +1,77 @@ +# Copyright (c) 2019 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config NRF53_SYNC_RTC + bool "RTC clock synchronization" + default y if LOG && !LOG_MODE_MINIMAL + depends on NRF_RTC_TIMER + select NRFX_DPPI + select MBOX if !IPM + +if NRF53_SYNC_RTC + +module = SYNC_RTC +module-str = Synchronized RTC +source "subsys/logging/Kconfig.template.log_config" + +config NRF53_SYNC_RTC_INIT_PRIORITY + int "nRF53 Synchronized RTC init priority" + default APPLICATION_INIT_PRIORITY + help + nRF53 Synchronized RTC initialization priority. + +config NRF_RTC_TIMER_USER_CHAN_COUNT + default 2 if NRF_802154_RADIO_DRIVER && SOC_NRF5340_CPUNET + default 3 if NRF_802154_RADIO_DRIVER + default 1 + +config NRF53_SYNC_RTC_LOG_TIMESTAMP + bool "Use Synchronized RTC for logging timestamp" + default y + +config NRF53_SYNC_RTC_IPM_OUT + int "IPM channel from APP to NET" + range 0 15 + default 7 if SOC_NRF5340_CPUAPP + default 8 + +config NRF53_SYNC_RTC_IPM_IN + int "IPM channel from APP to NET" + range 0 15 + default 8 if SOC_NRF5340_CPUAPP + default 7 + +ipm_num = 0 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 1 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 2 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 3 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 4 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 5 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 6 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 7 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 8 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 9 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 10 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 11 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 12 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 13 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 14 +rsource "Kconfig.sync_rtc_ipm" +ipm_num = 15 +rsource "Kconfig.sync_rtc_ipm" + +endif # NRF53_SYNC_RTC