From 9834fabe2dfd091c2e3687af19165de411a37e14 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Wed, 18 Oct 2023 09:01:17 +0200 Subject: [PATCH] nrf53: Correct sync_rtc kconfig dependencies for simulation Let's make the sync_rtc kconfig depend on the SOC_COMPATIBLE options which are set both by the real and simulated targets, so this code works in the same way for both. Signed-off-by: Alberto Escolar Piedras --- soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc | 6 +++--- soc/arm/nordic_nrf/nrf53/sync_rtc.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc b/soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc index 631e1db67df..475db911c67 100644 --- a/soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc +++ b/soc/arm/nordic_nrf/nrf53/Kconfig.sync_rtc @@ -21,7 +21,7 @@ config NRF53_SYNC_RTC_INIT_PRIORITY nRF53 Synchronized RTC initialization priority. config NRF_RTC_TIMER_USER_CHAN_COUNT - default 2 if NRF_802154_RADIO_DRIVER && SOC_NRF5340_CPUNET + default 2 if NRF_802154_RADIO_DRIVER && SOC_COMPATIBLE_NRF5340_CPUNET default 3 if NRF_802154_RADIO_DRIVER default 1 @@ -32,13 +32,13 @@ config NRF53_SYNC_RTC_LOG_TIMESTAMP config NRF53_SYNC_RTC_IPM_OUT int "IPM channel from APP to NET" range 0 15 - default 7 if SOC_NRF5340_CPUAPP + default 7 if SOC_COMPATIBLE_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 8 if SOC_COMPATIBLE_NRF5340_CPUAPP default 7 ipm_num = 0 diff --git a/soc/arm/nordic_nrf/nrf53/sync_rtc.c b/soc/arm/nordic_nrf/nrf53/sync_rtc.c index 235e9f26001..031f93244f7 100644 --- a/soc/arm/nordic_nrf/nrf53/sync_rtc.c +++ b/soc/arm/nordic_nrf/nrf53/sync_rtc.c @@ -119,7 +119,7 @@ static void free_resources(union rtc_sync_channels channels) int z_nrf_rtc_timer_nrf53net_offset_get(void) { - if (!IS_ENABLED(CONFIG_SOC_NRF5340_CPUNET)) { + if (!IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET)) { return -ENOSYS; } @@ -135,7 +135,7 @@ static void rtc_cb(int32_t id, uint64_t cc_value, void *user_data) channels.raw = (uint32_t)user_data; ppi_rtc_to_ipc(channels, false); - if (IS_ENABLED(CONFIG_SOC_NRF5340_CPUAPP)) { + if (IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP)) { /* APP: Synchronized completed */ free_resources(channels); } else { @@ -165,7 +165,7 @@ static void remote_callback(void *user_data) /* Clear previous task,event */ ppi_ipc_to_rtc(channels, false); - if (IS_ENABLED(CONFIG_SOC_NRF5340_CPUAPP)) { + if (IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP)) { /* Setup new connection from RTC to IPC and set RTC to a new * interval that contains captured offset. */ @@ -258,7 +258,7 @@ static int sync_rtc_setup(void) nrfx_gppi_channels_enable(BIT(channels.ch.ppi)); - if (IS_ENABLED(CONFIG_SOC_NRF5340_CPUAPP)) { + if (IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF5340_CPUAPP)) { ppi_ipc_to_rtc(channels, true); } else { ppi_rtc_to_ipc(channels, true);