diff --git a/drivers/counter/counter_nrfx_rtc.c b/drivers/counter/counter_nrfx_rtc.c index 203f980e78d..f6d7a936dba 100644 --- a/drivers/counter/counter_nrfx_rtc.c +++ b/drivers/counter/counter_nrfx_rtc.c @@ -387,7 +387,9 @@ static int ppi_setup(const struct device *dev, uint8_t chan) nrfy_rtc_event_enable(rtc, NRF_RTC_CHANNEL_INT_MASK(chan)); #ifdef DPPI_PRESENT - result = nrfx_dppi_channel_alloc(&data->ppi_ch); + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); + + result = nrfx_dppi_channel_alloc(&dppi, &data->ppi_ch); if (result != NRFX_SUCCESS) { ERR("Failed to allocate PPI channel."); return -ENODEV; @@ -395,7 +397,7 @@ static int ppi_setup(const struct device *dev, uint8_t chan) nrfy_rtc_subscribe_set(rtc, NRF_RTC_TASK_CLEAR, data->ppi_ch); nrfy_rtc_publish_set(rtc, evt, data->ppi_ch); - (void)nrfx_dppi_channel_enable(data->ppi_ch); + (void)nrfx_dppi_channel_enable(&dppi, data->ppi_ch); #else /* DPPI_PRESENT */ uint32_t evt_addr; uint32_t task_addr; @@ -429,11 +431,12 @@ static void ppi_free(const struct device *dev, uint8_t chan) nrfy_rtc_event_disable(rtc, NRF_RTC_CHANNEL_INT_MASK(chan)); #ifdef DPPI_PRESENT nrf_rtc_event_t evt = NRF_RTC_CHANNEL_EVENT_ADDR(chan); + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); - (void)nrfx_dppi_channel_disable(ppi_ch); + (void)nrfx_dppi_channel_disable(&dppi, ppi_ch); nrfy_rtc_subscribe_clear(rtc, NRF_RTC_TASK_CLEAR); nrfy_rtc_publish_clear(rtc, evt); - (void)nrfx_dppi_channel_free(ppi_ch); + (void)nrfx_dppi_channel_free(&dppi, ppi_ch); #else /* DPPI_PRESENT */ (void)nrfx_ppi_channel_disable(ppi_ch); (void)nrfx_ppi_channel_free(ppi_ch); diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 83ce3f157cc..16729bf68ae 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -26,8 +26,77 @@ config NRFX_COMP depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_COMP)) config NRFX_DPPI - bool "DPPI allocator" - depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + bool + +config NRFX_DPPI0 + bool "DPPI0 driver instance" + depends on $(dt_nodelabel_has_compat,dppic,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI00 + bool "DPPI00 driver instance" + depends on $(dt_nodelabel_has_compat,dppic00,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI10 + bool "DPPI10 driver instance" + depends on $(dt_nodelabel_has_compat,dppic10,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI20 + bool "DPPI20 driver instance" + depends on $(dt_nodelabel_has_compat,dppic20,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI30 + bool "DPPI30 driver instance" + depends on $(dt_nodelabel_has_compat,dppic30,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI020 + bool "DPPI020 driver instance" + depends on $(dt_nodelabel_has_compat,dppic020,$(DT_COMPAT_NORDIC_NRF_DPPIC_LOCAL)) + select NRFX_DPPI + +config NRFX_DPPI120 + bool "DPPI120 driver instance" + depends on $(dt_nodelabel_has_compat,dppic120,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI + +config NRFX_DPPI130 + bool "DPPI130 driver instance" + depends on $(dt_nodelabel_has_compat,dppic130,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI + +config NRFX_DPPI131 + bool "DPPI131 driver instance" + depends on $(dt_nodelabel_has_compat,dppic131,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI + +config NRFX_DPPI132 + bool "DPPI132 driver instance" + depends on $(dt_nodelabel_has_compat,dppic132,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI + +config NRFX_DPPI133 + bool "DPPI133 driver instance" + depends on $(dt_nodelabel_has_compat,dppic133,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI + +config NRFX_DPPI134 + bool "DPPI134 driver instance" + depends on $(dt_nodelabel_has_compat,dppic134,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI + +config NRFX_DPPI135 + bool "DPPI135 driver instance" + depends on $(dt_nodelabel_has_compat,dppic135,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI + +config NRFX_DPPI136 + bool "DPPI136 driver instance" + depends on $(dt_nodelabel_has_compat,dppic136,$(DT_COMPAT_NORDIC_NRF_DPPIC_GLOBAL)) + select NRFX_DPPI config NRFX_EGU bool diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 58e938492ff..92e5c71ee92 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -84,6 +84,48 @@ #ifdef CONFIG_NRFX_DPPI_LOG #define NRFX_DPPI_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_DPPI0 +#define NRFX_DPPI0_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI00 +#define NRFX_DPPI00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI10 +#define NRFX_DPPI10_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI20 +#define NRFX_DPPI20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI30 +#define NRFX_DPPI30_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI020 +#define NRFX_DPPI020_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI120 +#define NRFX_DPPI120_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI130 +#define NRFX_DPPI130_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI131 +#define NRFX_DPPI131_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI132 +#define NRFX_DPPI132_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI133 +#define NRFX_DPPI133_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI134 +#define NRFX_DPPI134_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI135 +#define NRFX_DPPI135_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_DPPI136 +#define NRFX_DPPI136_ENABLED 1 +#endif #ifdef CONFIG_NRFX_EGU #define NRFX_EGU_ENABLED 1 diff --git a/modules/hal_nordic/nrfx/nrfx_config_common.h b/modules/hal_nordic/nrfx/nrfx_config_common.h index e04a11c6df8..0cf80068038 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_common.h +++ b/modules/hal_nordic/nrfx/nrfx_config_common.h @@ -18,7 +18,7 @@ /** @brief Symbol specifying minor version of the nrfx API to be used. */ #ifndef NRFX_CONFIG_API_VER_MINOR -#define NRFX_CONFIG_API_VER_MINOR 7 +#define NRFX_CONFIG_API_VER_MINOR 8 #endif /** @brief Symbol specifying micro version of the nrfx API to be used. */ diff --git a/soc/nordic/nrf53/sync_rtc.c b/soc/nordic/nrf53/sync_rtc.c index 94616ee3a0c..724453583b3 100644 --- a/soc/nordic/nrf53/sync_rtc.c +++ b/soc/nordic/nrf53/sync_rtc.c @@ -107,13 +107,14 @@ static void ppi_rtc_to_ipc(union rtc_sync_channels channels, bool setup) /* Free DPPI and RTC channels */ static void free_resources(union rtc_sync_channels channels) { + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); nrfx_err_t err; nrfx_gppi_channels_disable(BIT(channels.ch.ppi)); z_nrf_rtc_timer_chan_free(channels.ch.rtc); - err = nrfx_dppi_channel_free(channels.ch.ppi); + err = nrfx_dppi_channel_free(&dppi, channels.ch.ppi); __ASSERT_NO_MSG(err == NRFX_SUCCESS); } @@ -224,12 +225,13 @@ static int mbox_rx_init(void *user_data) /* Setup RTC synchronization. */ static int sync_rtc_setup(void) { + nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0); nrfx_err_t err; union rtc_sync_channels channels; int32_t sync_rtc_ch; int rv; - err = nrfx_dppi_channel_alloc(&channels.ch.ppi); + err = nrfx_dppi_channel_alloc(&dppi, &channels.ch.ppi); if (err != NRFX_SUCCESS) { rv = -ENODEV; goto bail; @@ -237,7 +239,7 @@ static int sync_rtc_setup(void) sync_rtc_ch = z_nrf_rtc_timer_chan_alloc(); if (sync_rtc_ch < 0) { - nrfx_dppi_channel_free(channels.ch.ppi); + nrfx_dppi_channel_free(&dppi, channels.ch.ppi); rv = sync_rtc_ch; goto bail; } diff --git a/west.yml b/west.yml index 9d3e7c6ff0f..e3c82b44821 100644 --- a/west.yml +++ b/west.yml @@ -188,7 +188,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 5c8d109371ebb740fbef1f440a3b59e488a36717 + revision: 2dbb2ed6cf461062bbac59a65b6e9d4576656350 path: modules/hal/nordic groups: - hal