From 9af397ee851d84ede50d20048c1e8fdc1b762217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 15 Oct 2024 11:48:32 +0200 Subject: [PATCH 1/6] [nrf fromlist] manifest: update hal_nordic revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hal_nordic revision was updated to bring in NRFX v3.8.0. Aligned the uses of single-instance API to use multi-instance instead. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/79857 Signed-off-by: Rafał Kuźnia --- drivers/counter/counter_nrfx_rtc.c | 11 +-- modules/hal_nordic/nrfx/Kconfig | 73 +++++++++++++++++++- modules/hal_nordic/nrfx/nrfx_config.h | 42 +++++++++++ modules/hal_nordic/nrfx/nrfx_config_common.h | 2 +- soc/nordic/nrf53/sync_rtc.c | 8 ++- west.yml | 2 +- 6 files changed, 127 insertions(+), 11 deletions(-) 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 9718d25aee9..971ba9716d9 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -30,8 +30,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)) + select NRFX_DPPI + +config NRFX_DPPI120 + bool "DPPI120 driver instance" + depends on $(dt_nodelabel_has_compat,dppic120,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI130 + bool "DPPI130 driver instance" + depends on $(dt_nodelabel_has_compat,dppic130,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI131 + bool "DPPI131 driver instance" + depends on $(dt_nodelabel_has_compat,dppic131,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI132 + bool "DPPI132 driver instance" + depends on $(dt_nodelabel_has_compat,dppic132,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI133 + bool "DPPI133 driver instance" + depends on $(dt_nodelabel_has_compat,dppic133,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI134 + bool "DPPI134 driver instance" + depends on $(dt_nodelabel_has_compat,dppic134,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI135 + bool "DPPI135 driver instance" + depends on $(dt_nodelabel_has_compat,dppic135,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + select NRFX_DPPI + +config NRFX_DPPI136 + bool "DPPI136 driver instance" + depends on $(dt_nodelabel_has_compat,dppic136,$(DT_COMPAT_NORDIC_NRF_DPPIC)) + 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 47a12f90925..b85df4c33a7 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 40c149d4dbd..b84dd40f1ce 100644 --- a/west.yml +++ b/west.yml @@ -188,7 +188,7 @@ manifest: groups: - hal - name: hal_nordic - revision: 5c8d109371ebb740fbef1f440a3b59e488a36717 + revision: pull/232/head path: modules/hal/nordic groups: - hal From 11852e501a23879f4dce049d8e96a568f8066a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 15 Oct 2024 13:13:36 +0200 Subject: [PATCH 2/6] [nrf fromlist] dts: nordic: 54l: Add PPIB device tree nodes and bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a binding description for the PPIB peripheral and added the device tree nodes of the PPIB instances to the nRF54L15 and nRF54L20. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/79857 Signed-off-by: Rafał Kuźnia --- dts/bindings/misc/nordic,nrf-ppib.yaml | 13 +++++++ dts/common/nordic/nrf54l15.dtsi | 48 ++++++++++++++++++++++++++ dts/common/nordic/nrf54l20.dtsi | 48 ++++++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 dts/bindings/misc/nordic,nrf-ppib.yaml diff --git a/dts/bindings/misc/nordic,nrf-ppib.yaml b/dts/bindings/misc/nordic,nrf-ppib.yaml new file mode 100644 index 00000000000..2bacbf28675 --- /dev/null +++ b/dts/bindings/misc/nordic,nrf-ppib.yaml @@ -0,0 +1,13 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +description: | + Nordic PPIB (Programmable Peripheral Interconnect Bridge) + +compatible: "nordic,nrf-ppib" + +include: base.yaml + +properties: + reg: + required: true diff --git a/dts/common/nordic/nrf54l15.dtsi b/dts/common/nordic/nrf54l15.dtsi index d3c0c551823..6299e2f675c 100644 --- a/dts/common/nordic/nrf54l15.dtsi +++ b/dts/common/nordic/nrf54l15.dtsi @@ -113,6 +113,18 @@ status = "disabled"; }; + ppib00: ppib@43000 { + compatible = "nordic,nrf-ppib"; + reg = <0x43000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + spi00: spi@4a000 { /* * This spi node can be either SPIM or SPIS, @@ -186,6 +198,18 @@ status = "disabled"; }; + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + timer10: timer@85000 { compatible = "nordic,nrf-timer"; status = "disabled"; @@ -236,6 +260,24 @@ status = "disabled"; }; + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + i2c20: i2c@c6000 { compatible = "nordic,nrf-twim"; #address-cells = <1>; @@ -524,6 +566,12 @@ status = "disabled"; }; + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + i2c30: i2c@104000 { compatible = "nordic,nrf-twim"; #address-cells = <1>; diff --git a/dts/common/nordic/nrf54l20.dtsi b/dts/common/nordic/nrf54l20.dtsi index dfe8d7b4531..258cc856e5d 100644 --- a/dts/common/nordic/nrf54l20.dtsi +++ b/dts/common/nordic/nrf54l20.dtsi @@ -82,6 +82,18 @@ status = "disabled"; }; + ppib00: ppib@44000 { + compatible = "nordic,nrf-ppib"; + reg = <0x44000 0x1000>; + status = "disabled"; + }; + + ppib01: ppib@45000 { + compatible = "nordic,nrf-ppib"; + reg = <0x45000 0x1000>; + status = "disabled"; + }; + spi00: spi@4d000 { /* * This spi node can be either SPIM or SPIS, @@ -137,6 +149,18 @@ status = "disabled"; }; + ppib10: ppib@83000 { + compatible = "nordic,nrf-ppib"; + reg = <0x83000 0x1000>; + status = "disabled"; + }; + + ppib11: ppib@84000 { + compatible = "nordic,nrf-ppib"; + reg = <0x84000 0x1000>; + status = "disabled"; + }; + timer10: timer@85000 { compatible = "nordic,nrf-timer"; status = "disabled"; @@ -186,6 +210,24 @@ status = "disabled"; }; + ppib20: ppib@c3000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc3000 0x1000>; + status = "disabled"; + }; + + ppib21: ppib@c4000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc4000 0x1000>; + status = "disabled"; + }; + + ppib22: ppib@c5000 { + compatible = "nordic,nrf-ppib"; + reg = <0xc5000 0x1000>; + status = "disabled"; + }; + i2c20: i2c@c6000 { compatible = "nordic,nrf-twim"; #address-cells = <1>; @@ -465,6 +507,12 @@ status = "disabled"; }; + ppib30: ppib@103000 { + compatible = "nordic,nrf-ppib"; + reg = <0x103000 0x1000>; + status = "disabled"; + }; + i2c30: i2c@104000 { compatible = "nordic,nrf-twim"; #address-cells = <1>; From 4c5e370ba22717401896dae06d43422ab2e21987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 15 Oct 2024 13:07:20 +0200 Subject: [PATCH 3/6] [nrf fromlist] modules: hal_nordic: Enable nrfx_ppib drivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new nrfx_ppib driver can now be enabled, when the corrensponding device tree node has the okay status. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/79857 Signed-off-by: Rafał Kuźnia --- modules/hal_nordic/nrfx/CMakeLists.txt | 1 + modules/hal_nordic/nrfx/Kconfig | 43 +++++++++++++++++++++++++ modules/hal_nordic/nrfx/Kconfig.logging | 4 +++ modules/hal_nordic/nrfx/nrfx_config.h | 31 ++++++++++++++++++ 4 files changed, 79 insertions(+) diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index caf7002b30a..9933151fd66 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -135,6 +135,7 @@ zephyr_library_sources_ifdef(CONFIG_NRFX_NVMC ${SRC_DIR}/nrfx_nvmc.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PDM ${SRC_DIR}/nrfx_pdm.c) zephyr_library_sources_ifdef(CONFIG_NRFX_POWER ${SRC_DIR}/nrfx_power.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PPI ${SRC_DIR}/nrfx_ppi.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_PPIB ${SRC_DIR}/nrfx_ppib.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PWM ${SRC_DIR}/nrfx_pwm.c) zephyr_library_sources_ifdef(CONFIG_NRFX_QDEC ${SRC_DIR}/nrfx_qdec.c) zephyr_library_sources_ifdef(CONFIG_NRFX_QSPI ${SRC_DIR}/nrfx_qspi.c) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 971ba9716d9..4c8cc09444e 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -263,6 +263,49 @@ config NRFX_PPI bool "PPI allocator" depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_PPI)) +config NRFX_PPIB + bool + +config NRFX_PPIB00 + bool "PPIB00 driver instance" + depends on $(dt_nodelabel_has_compat,ppib00,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + +config NRFX_PPIB01 + bool "PPIB01 driver instance" + depends on $(dt_nodelabel_has_compat,ppib01,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + +config NRFX_PPIB10 + bool "PPIB10 driver instance" + depends on $(dt_nodelabel_has_compat,ppib10,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + +config NRFX_PPIB11 + bool "PPIB11 driver instance" + depends on $(dt_nodelabel_has_compat,ppib11,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + +config NRFX_PPIB20 + bool "PPIB20 driver instance" + depends on $(dt_nodelabel_has_compat,ppib20,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + +config NRFX_PPIB21 + bool "PPIB21 driver instance" + depends on $(dt_nodelabel_has_compat,ppib21,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + +config NRFX_PPIB22 + bool "PPIB22 driver instance" + depends on $(dt_nodelabel_has_compat,ppib22,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + +config NRFX_PPIB30 + bool "PPIB30 driver instance" + depends on $(dt_nodelabel_has_compat,ppib30,$(DT_COMPAT_NORDIC_NRF_PPIB)) + select NRFX_PPIB + config NRFX_PWM bool diff --git a/modules/hal_nordic/nrfx/Kconfig.logging b/modules/hal_nordic/nrfx/Kconfig.logging index b24d683d3de..2bf24721880 100644 --- a/modules/hal_nordic/nrfx/Kconfig.logging +++ b/modules/hal_nordic/nrfx/Kconfig.logging @@ -64,6 +64,10 @@ config NRFX_PPI_LOG bool "PPI driver logging" depends on NRFX_PPI +config NRFX_PPIB_LOG + bool "PPIB driver logging" + depends on NRFX_PPIB + config NRFX_PRS_LOG bool "PRS driver logging" depends on NRFX_PRS diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index b85df4c33a7..d0d3a671ae2 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -278,6 +278,37 @@ #define NRFX_PPI_CONFIG_LOG_ENABLED 1 #endif +#ifdef CONFIG_NRFX_PPIB +#define NRFX_PPIB_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB_LOG +#define NRFX_PPIB_CONFIG_LOG_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB00 +#define NRFX_PPIB00_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB01 +#define NRFX_PPIB01_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB10 +#define NRFX_PPIB10_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB11 +#define NRFX_PPIB11_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB20 +#define NRFX_PPIB20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB21 +#define NRFX_PPIB21_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB22 +#define NRFX_PPIB22_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PPIB30 +#define NRFX_PPIB30_ENABLED 1 +#endif + #ifdef CONFIG_NRFX_PRS #define NRFX_PRS_ENABLED 1 #endif From 9eb1a91cd04b118399765ba1608a0bb7144d2aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Mon, 21 Oct 2024 08:16:07 +0200 Subject: [PATCH 4/6] [nrf fromlist] modules: hal_nordic: rework resource reservations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resource reservation definitions were moved to a separate header file. The PPIB and DPPI channel and group resources can now be statically allocated for each individual instance. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/79857 Signed-off-by: Rafał Kuźnia --- .../nrfx/nrfx_config_reserved_resources.h | 710 ++++++++++++++++++ modules/hal_nordic/nrfx/nrfx_glue.h | 110 +-- 2 files changed, 711 insertions(+), 109 deletions(-) create mode 100644 modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h new file mode 100644 index 00000000000..132ba4cd89a --- /dev/null +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h @@ -0,0 +1,710 @@ +/* + * Copyright (c) 2024, Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef NRFX_CONFIG_RESERVED_RESOURCES_H__ +#define NRFX_CONFIG_RESERVED_RESOURCES_H__ + +/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE130_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) + +/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside + * of the nrfx library. + */ +#define NRFX_GPIOTE131_CHANNELS_USED \ + (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ + NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) + +/** @brief Bitmask that defines EGU instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_EGUS_USED 0 + +/** @brief Bitmask that defines TIMER instances that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_TIMERS_USED 0 + +/* + * The enabled Bluetooth controller subsystem is responsible for providing + * definitions of the BT_CTLR_USED_* symbols used below in a file named + * bt_ctlr_used_resources.h and for adding its location to global include + * paths so that the file can be included here for all Zephyr libraries that + * are to be built. + */ +#if defined(CONFIG_BT_LL_SW_SPLIT) +#include +#if defined(DPPI_PRESENT) +#if defined(NRF53_SERIES) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#elif defined(LUMOS_XXAA) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif +#else /* defined(DPPI_PRESENT) */ +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS +#endif /* defined(DPPI_PRESENT) */ +#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ + +#if defined(CONFIG_NRF_802154_RADIO_DRIVER) +#if defined(NRF52_SERIES) +#include <../src/nrf_802154_peripherals_nrf52.h> +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK +#elif defined(NRF53_SERIES) +#include <../src/nrf_802154_peripherals_nrf53.h> +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(NRF54L_SERIES) +#include <../src/nrf_802154_peripherals_nrf54l.h> +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#elif defined(NRF54H_SERIES) +#include <../src/nrf_802154_peripherals_nrf54h.h> +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif /* CONFIG_NRF_802154_RADIO_DRIVER */ + +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI0_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI0_GROUPS_USED_BY_MPSL +#define NRFX_DPPI0_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI00_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI00_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI00_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI00_GROUPS_USED_BY_MPSL +#define NRFX_DPPI00_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI10_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI10_GROUPS_USED_BY_MPSL +#define NRFX_DPPI10_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI20_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI20_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI20_GROUPS_USED_BY_MPSL +#define NRFX_DPPI20_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI30_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI30_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI30_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI30_GROUPS_USED_BY_MPSL +#define NRFX_DPPI30_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI020_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI020_GROUPS_USED_BY_MPSL +#define NRFX_DPPI020_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI030_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI030_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI030_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI030_GROUPS_USED_BY_MPSL +#define NRFX_DPPI030_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI120_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI120_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI120_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI120_GROUPS_USED_BY_MPSL +#define NRFX_DPPI120_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI130_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI130_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI130_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI130_GROUPS_USED_BY_MPSL +#define NRFX_DPPI130_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI131_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI131_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI131_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI131_GROUPS_USED_BY_MPSL +#define NRFX_DPPI131_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI132_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI132_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI132_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI132_GROUPS_USED_BY_MPSL +#define NRFX_DPPI132_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI133_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI133_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI133_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI133_GROUPS_USED_BY_MPSL +#define NRFX_DPPI133_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI134_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI134_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI134_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI134_GROUPS_USED_BY_MPSL +#define NRFX_DPPI134_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI135_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI135_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI135_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI135_GROUPS_USED_BY_MPSL +#define NRFX_DPPI135_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR +#define NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR +#define NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV +#define NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_802154_DRV +#define NRFX_DPPI136_GROUPS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_DPPI136_CHANNELS_USED_BY_MPSL +#define NRFX_DPPI136_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_DPPI136_GROUPS_USED_BY_MPSL +#define NRFX_DPPI136_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_BT_CTLR +#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_802154_DRV +#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 +#endif + +#ifndef NRFX_PPI_CHANNELS_USED_BY_MPSL +#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 +#endif +#ifndef NRFX_PPI_GROUPS_USED_BY_MPSL +#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL 0 +#endif + +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV 0 +#endif +#ifndef NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 +#endif + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_CHANNELS_USED \ + (NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI0_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI0_GROUPS_USED \ + (NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI0_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI0_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_CHANNELS_USED \ + (NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI00_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI00_GROUPS_USED \ + (NRFX_DPPI00_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI00_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI00_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_CHANNELS_USED \ + (NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI10_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI10_GROUPS_USED \ + (NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI10_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI10_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_CHANNELS_USED \ + (NRFX_DPPI20_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI20_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI20_GROUPS_USED \ + (NRFX_DPPI20_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI20_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI20_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_CHANNELS_USED \ + (NRFX_DPPI30_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI30_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI30_GROUPS_USED \ + (NRFX_DPPI30_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI30_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI30_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_CHANNELS_USED \ + (NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI020_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI020_GROUPS_USED \ + (NRFX_DPPI020_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI020_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI020_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_CHANNELS_USED \ + (NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI030_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI030_GROUPS_USED \ + (NRFX_DPPI030_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI030_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI030_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_CHANNELS_USED \ + (NRFX_DPPI120_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI120_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI120_GROUPS_USED \ + (NRFX_DPPI120_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI120_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI120_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_CHANNELS_USED \ + (NRFX_DPPI130_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI130_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI130_GROUPS_USED \ + (NRFX_DPPI130_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI130_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI130_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_CHANNELS_USED \ + (NRFX_DPPI131_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI131_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI131_GROUPS_USED \ + (NRFX_DPPI131_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI131_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI131_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_CHANNELS_USED \ + (NRFX_DPPI132_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI132_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI132_GROUPS_USED \ + (NRFX_DPPI132_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI132_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI132_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_CHANNELS_USED \ + (NRFX_DPPI133_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI133_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI133_GROUPS_USED \ + (NRFX_DPPI133_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI133_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI133_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_CHANNELS_USED \ + (NRFX_DPPI134_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI134_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI134_GROUPS_USED \ + (NRFX_DPPI134_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI134_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI134_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_CHANNELS_USED \ + (NRFX_DPPI135_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI135_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI135_GROUPS_USED \ + (NRFX_DPPI135_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI135_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI135_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_CHANNELS_USED \ + (NRFX_DPPI136_CHANNELS_USED_BY_BT_CTLR | NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV | \ + NRFX_DPPI136_CHANNELS_USED_BY_MPSL) + +/** @brief Bitmask that defines DPPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_DPPI136_GROUPS_USED \ + (NRFX_DPPI136_GROUPS_USED_BY_BT_CTLR | NRFX_DPPI136_GROUPS_USED_BY_802154_DRV | \ + NRFX_DPPI136_GROUPS_USED_BY_MPSL) + +/** @brief Bitmask that defines PPI channels that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_CHANNELS_USED \ + (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPI_CHANNELS_USED_BY_MPSL) + +#define NRFX_DPPI_CHANNELS_USED NRFX_DPPI0_CHANNELS_USED +#define NRFX_DPPI_GROUPS_USED NRFX_DPPI0_GROUPS_USED + +/** @brief Bitmask that defines PPI groups that are reserved for use outside + * of the nrfx library. + */ +#define NRFX_PPI_GROUPS_USED \ + (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ + NRFX_PPI_GROUPS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_00_10_CHANNELS_USED \ + (NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_01_20_CHANNELS_USED \ + (NRFX_PPIB_01_20_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_11_21_CHANNELS_USED \ + (NRFX_PPIB_11_21_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_22_30_CHANNELS_USED \ + (NRFX_PPIB_22_30_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_02_03_CHANNELS_USED \ + (NRFX_PPIB_02_03_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_04_12_CHANNELS_USED \ + (NRFX_PPIB_04_12_CHANNELS_USED_BY_BT_CTLR | NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV | \ + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) + +#define NRFX_PPIB_INTERCONNECT_020_030_CHANNELS_USED \ + (NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR | \ + NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV | NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) + +#endif /* NRFX_CONFIG_RESERVED_RESOURCES_H__ */ diff --git a/modules/hal_nordic/nrfx/nrfx_glue.h b/modules/hal_nordic/nrfx/nrfx_glue.h index 72764c66f04..c65318f1fe3 100644 --- a/modules/hal_nordic/nrfx/nrfx_glue.h +++ b/modules/hal_nordic/nrfx/nrfx_glue.h @@ -314,115 +314,7 @@ void nrfx_busy_wait(uint32_t usec_to_wait); /*------------------------------------------------------------------------------*/ -/** @brief Bitmask that defines DPPI channels that are reserved for use outside of the nrfx library. */ -#define NRFX_DPPI_CHANNELS_USED (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL | \ - NRFX_PPI_CHANNELS_USED_BY_NRFE) - -/** @brief Bitmask that defines DPPI groups that are reserved for use outside of the nrfx library. */ -#define NRFX_DPPI_GROUPS_USED (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | \ - NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL | \ - NRFX_PPI_GROUPS_USED_BY_NRFE) - -/** @brief Bitmask that defines PPI channels that are reserved for use outside of the nrfx library. */ -#define NRFX_PPI_CHANNELS_USED (NRFX_PPI_CHANNELS_USED_BY_BT_CTLR | \ - NRFX_PPI_CHANNELS_USED_BY_802154_DRV | \ - NRFX_PPI_CHANNELS_USED_BY_MPSL) - -/** @brief Bitmask that defines PPI groups that are reserved for use outside of the nrfx library. */ -#define NRFX_PPI_GROUPS_USED (NRFX_PPI_GROUPS_USED_BY_BT_CTLR | \ - NRFX_PPI_GROUPS_USED_BY_802154_DRV | \ - NRFX_PPI_GROUPS_USED_BY_MPSL) - -/** @brief Bitmask that defines GPIOTE130 channels reserved for use outside of the nrfx library. */ -#define NRFX_GPIOTE130_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote130), child_owned_channels)) - -/** @brief Bitmask that defines GPIOTE131 channels reserved for use outside of the nrfx library. */ -#define NRFX_GPIOTE131_CHANNELS_USED \ - (~NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), owned_channels) | \ - NRFX_CONFIG_MASK_DT(DT_NODELABEL(gpiote131), child_owned_channels)) - - -#if defined(CONFIG_BT_CTLR) -/* - * The enabled Bluetooth controller subsystem is responsible for providing - * definitions of the BT_CTLR_USED_* symbols used below in a file named - * bt_ctlr_used_resources.h and for adding its location to global include - * paths so that the file can be included here for all Zephyr libraries that - * are to be built. - */ -#include -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS -#else -#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR 0 -#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR 0 -#endif - -#if defined(CONFIG_NRF_802154_RADIO_DRIVER) -#if defined(NRF52_SERIES) -#include <../src/nrf_802154_peripherals_nrf52.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK -#elif defined(NRF53_SERIES) -#include <../src/nrf_802154_peripherals_nrf53.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(NRF54L_SERIES) -#include <../src/nrf_802154_peripherals_nrf54l.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#elif defined(NRF54H_SERIES) -#include <../src/nrf_802154_peripherals_nrf54h.h> -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK -#else -#error Unsupported chip family -#endif -#else // CONFIG_NRF_802154_RADIO_DRIVER -#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV 0 -#define NRFX_PPI_GROUPS_USED_BY_802154_DRV 0 -#endif // CONFIG_NRF_802154_RADIO_DRIVER - -#if defined(CONFIG_MPSL) -#include -#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_RESERVED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#else -#define NRFX_PPI_CHANNELS_USED_BY_MPSL 0 -#define NRFX_PPI_GROUPS_USED_BY_MPSL 0 -#endif - -#if defined(CONFIG_NRFE) -#include -#define NRFX_PPI_CHANNELS_USED_BY_NRFE NRFE_RESERVED_PPI_CHANNELS -#define NRFX_PPI_GROUPS_USED_BY_NRFE 0 -#else -#define NRFX_PPI_CHANNELS_USED_BY_NRFE 0 -#define NRFX_PPI_GROUPS_USED_BY_NRFE 0 -#endif - -#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) -BUILD_ASSERT( - (NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, - "PPI channels used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); - -BUILD_ASSERT( - (NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, - "PPI groups used by the IEEE802.15.4 radio driver overlap with those " - "assigned to the MPSL."); -#endif // NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL - -/** @brief Bitmask that defines EGU instances that are reserved for use outside of the nrfx library. */ -#define NRFX_EGUS_USED 0 - -/** @brief Bitmask that defines TIMER instances that are reserved for use outside of the nrfx library. */ -#define NRFX_TIMERS_USED 0 +#include "nrfx_config_reserved_resources.h" //------------------------------------------------------------------------------ From feb291089246151ed12500f085591e61ac5068cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Tue, 22 Oct 2024 08:55:47 +0200 Subject: [PATCH 5/6] [nrf noup] modules: hal_nordic: adjust nrfx reservations to NCS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added ncs-specific modules to nrfx_config_reserved_resources. The modules are: - mpsl - nrfe Signed-off-by: Rafał Kuźnia --- .../nrfx/nrfx_config_reserved_resources.h | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) diff --git a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h index 132ba4cd89a..7a05f20799e 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h +++ b/modules/hal_nordic/nrfx/nrfx_config_reserved_resources.h @@ -54,6 +54,27 @@ #endif /* defined(DPPI_PRESENT) */ #endif /* defined(CONFIG_BT_LL_SW_SPLIT) */ +#if defined(CONFIG_BT_LL_SOFTDEVICE) +#include +#if defined(NRF52_SERIES) +#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR SDC_PPI_CHANNELS_USED_MASK +#elif defined(NRF53_SERIES) +#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR SDC_DPPI_CHANNELS_USED_MASK +#elif defined(NRF54L_SERIES) +#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI00_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC00_CHANNELS_USED_MASK +#define NRFX_PPIB_00_10_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB00_CHANNELS_USED_MASK | SDC_PPIB10_CHANNELS_USED_MASK) +#elif defined(NRF54H_SERIES) +#define NRFX_DPPI020_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC020_CHANNELS_USED_MASK +#define NRFX_DPPI030_CHANNELS_USED_BY_BT_CTLR SDC_DPPIC030_CHANNELS_USED_MASK +#define NRFX_PPIB_020_030_CHANNELS_USED_BY_BT_CTLR \ + (SDC_PPIB020_CHANNELS_USED_MASK | SDC_PPIB030_CHANNELS_USED_MASK) +#else +#error Unsupported chip family +#endif +#endif /* defined(CONFIG_BT_LL_SOFTDEVICE) */ + #if defined(CONFIG_NRF_802154_RADIO_DRIVER) #if defined(NRF52_SERIES) #include <../src/nrf_802154_peripherals_nrf52.h> @@ -76,6 +97,24 @@ #endif #endif /* CONFIG_NRF_802154_RADIO_DRIVER */ +#if defined(CONFIG_MPSL) +#include +#if defined(NRF52_SERIES) +#define NRFX_PPI_CHANNELS_USED_BY_MPSL MPSL_PPI_CHANNELS_USED_MASK +#elif defined(NRF53_SERIES) +#define NRFX_DPPI0_CHANNELS_USED_BY_MPSL MPSL_DPPIC_CHANNELS_USED_MASK +#elif defined(NRF54L_SERIES) +#define NRFX_DPPI10_CHANNELS_USED_BY_MPSL MPSL_DPPIC10_CHANNELS_USED_MASK +#define NRFX_DPPI20_CHANNELS_USED_BY_MPSL MPSL_DPPIC20_CHANNELS_USED_MASK +#define NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL \ + (MPSL_PPIB11_CHANNELS_USED_MASK | MPSL_PPIB21_CHANNELS_USED_MASK) +#elif defined(NRF54H_SERIES) +#define NRFX_DPPI020_CHANNELS_USED_BY_MPSL MPSL_DPPIC020_CHANNELS_USED_MASK +#else +#error Unsupported chip family +#endif +#endif + #ifndef NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR #define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR 0 #endif @@ -452,6 +491,173 @@ #define NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL 0 #endif +#if defined(NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL) + +BUILD_ASSERT((NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI0_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI0_GROUPS_USED_BY_802154_DRV & NRFX_DPPI0_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI00_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI00_GROUPS_USED_BY_802154_DRV & NRFX_DPPI00_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI10_GROUPS_USED_BY_802154_DRV & NRFX_DPPI10_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI20_GROUPS_USED_BY_802154_DRV & NRFX_DPPI20_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI30_GROUPS_USED_BY_802154_DRV & NRFX_DPPI30_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI020_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI020_GROUPS_USED_BY_802154_DRV & NRFX_DPPI020_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI030_GROUPS_USED_BY_802154_DRV & NRFX_DPPI030_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI120_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI120_GROUPS_USED_BY_802154_DRV & NRFX_DPPI120_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI130_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI130_GROUPS_USED_BY_802154_DRV & NRFX_DPPI130_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI131_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI131_GROUPS_USED_BY_802154_DRV & NRFX_DPPI131_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI132_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI132_GROUPS_USED_BY_802154_DRV & NRFX_DPPI132_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI133_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI133_GROUPS_USED_BY_802154_DRV & NRFX_DPPI133_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI134_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI134_GROUPS_USED_BY_802154_DRV & NRFX_DPPI134_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI135_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI135_GROUPS_USED_BY_802154_DRV & NRFX_DPPI135_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_CHANNELS_USED_BY_802154_DRV & NRFX_DPPI136_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_DPPI136_GROUPS_USED_BY_802154_DRV & NRFX_DPPI136_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_CHANNELS_USED_BY_802154_DRV & NRFX_PPI_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPI_GROUPS_USED_BY_802154_DRV & NRFX_PPI_GROUPS_USED_BY_MPSL) == 0, + "PPI groups used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_00_10_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_00_10_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_01_20_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_01_20_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_11_21_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_11_21_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_22_30_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_22_30_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_02_03_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_02_03_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_04_12_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_04_12_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +BUILD_ASSERT((NRFX_PPIB_020_030_CHANNELS_USED_BY_802154_DRV & + NRFX_PPIB_020_030_CHANNELS_USED_BY_MPSL) == 0, + "PPI channels used by the IEEE802.15.4 radio driver overlap with those " + "assigned to the MPSL."); + +#endif /* NRF_802154_VERIFY_PERIPHS_ALLOC_AGAINST_MPSL */ + /** @brief Bitmask that defines DPPI channels that are reserved for use outside * of the nrfx library. */ From 85ec8b5b5fbe92e664ae51c7a48d12bfb525759a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Wed, 23 Oct 2024 00:35:45 +0200 Subject: [PATCH 6/6] [nrf fromlist] modules: hal_nordic: add NRFX_GPPI config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nrfx_gppi module is an abstraction over nrfx_ppi and nrfx_dppi drivers. It now has a Kconfig option that is separate from nrfx_dppi and by default it enables all PPI/DPPI instances, if available. Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/79857 Signed-off-by: Rafał Kuźnia --- drivers/pwm/Kconfig.nrf_sw | 3 +-- drivers/serial/Kconfig.nrfx_uart_instance | 6 ++--- modules/hal_nordic/nrfx/CMakeLists.txt | 4 ++-- modules/hal_nordic/nrfx/Kconfig | 29 +++++++++++++++++++++++ samples/boards/nordic/nrfx/Kconfig | 6 ----- samples/boards/nordic/nrfx/prj.conf | 1 + soc/nordic/nrf53/Kconfig | 2 +- soc/nordic/nrf53/Kconfig.sync_rtc | 2 +- 8 files changed, 37 insertions(+), 16 deletions(-) diff --git a/drivers/pwm/Kconfig.nrf_sw b/drivers/pwm/Kconfig.nrf_sw index 1d68993db5a..915ceaa8b4a 100644 --- a/drivers/pwm/Kconfig.nrf_sw +++ b/drivers/pwm/Kconfig.nrf_sw @@ -8,8 +8,7 @@ config PWM_NRF_SW default y if !PWM_NRFX depends on DT_HAS_NORDIC_NRF_SW_PWM_ENABLED select NRFX_GPIOTE - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC + select NRFX_GPPI help Enable driver to utilize PWM on the Nordic Semiconductor nRF SoCs. diff --git a/drivers/serial/Kconfig.nrfx_uart_instance b/drivers/serial/Kconfig.nrfx_uart_instance index d44c1ab7e02..8bc3f6c5e2c 100644 --- a/drivers/serial/Kconfig.nrfx_uart_instance +++ b/drivers/serial/Kconfig.nrfx_uart_instance @@ -24,8 +24,7 @@ config UART_$(nrfx_uart_num)_ENHANCED_POLL_OUT default y depends on HAS_HW_NRF_UARTE$(nrfx_uart_num) depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC + select NRFX_GPPI help When enabled, polling out does not trigger interrupt which stops TX. Feature uses a PPI channel. @@ -55,8 +54,7 @@ config UART_$(nrfx_uart_num)_NRF_HW_ASYNC depends on UART_ASYNC_API depends on UART_NRFX_UARTE_LEGACY_SHIM depends on HAS_HW_NRF_PPI || HAS_HW_NRF_DPPIC - select NRFX_PPI if HAS_HW_NRF_PPI - select NRFX_DPPI if HAS_HW_NRF_DPPIC + select NRFX_GPPI help If default driver uses interrupts to count incoming bytes, it is possible that with higher speeds and/or high cpu load some data can be lost. diff --git a/modules/hal_nordic/nrfx/CMakeLists.txt b/modules/hal_nordic/nrfx/CMakeLists.txt index 9933151fd66..876c8fa69ba 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -115,7 +115,7 @@ zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_NRF92X ${MDK_DIR}/system_nrf92.c zephyr_library_sources(nrfx_glue.c) zephyr_library_sources(${HELPERS_DIR}/nrfx_flag32_allocator.c) zephyr_library_sources_ifdef(CONFIG_RETAINED_MEM_NRF_RAM_CTRL ${HELPERS_DIR}/nrfx_ram_ctrl.c) -zephyr_library_sources_ifdef(CONFIG_NRFX_DPPI ${HELPERS_DIR}/nrfx_gppi_dppi.c) +zephyr_library_sources_ifdef(CONFIG_NRFX_GPPI ${HELPERS_DIR}/nrfx_gppi_dppi.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PPI ${HELPERS_DIR}/nrfx_gppi_ppi.c) zephyr_library_sources_ifdef(CONFIG_NRFX_PRS ${SRC_DIR}/prs/nrfx_prs.c) @@ -199,7 +199,7 @@ if(CONFIG_SOC_NRF54L20_ENGA_CPUAPP) zephyr_compile_definitions(NRF_SKIP_TAMPC_SETUP) endif() -if(CONFIG_SOC_SERIES_NRF54LX AND CONFIG_NRFX_DPPI) +if(CONFIG_SOC_SERIES_NRF54LX AND CONFIG_NRFX_GPPI) zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib_lumos.c) zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c) endif() diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 4c8cc09444e..e2382b7da9c 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -34,71 +34,85 @@ config NRFX_DPPI config NRFX_DPPI0 bool "DPPI0 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI00 bool "DPPI00 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic00,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI10 bool "DPPI10 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic10,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI20 bool "DPPI20 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic20,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI30 bool "DPPI30 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic30,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI020 bool "DPPI020 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic020,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI120 bool "DPPI120 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic120,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI130 bool "DPPI130 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic130,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI131 bool "DPPI131 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic131,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI132 bool "DPPI132 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic132,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI133 bool "DPPI133 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic133,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI134 bool "DPPI134 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic134,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI135 bool "DPPI135 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic135,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI config NRFX_DPPI136 bool "DPPI136 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,dppic136,$(DT_COMPAT_NORDIC_NRF_DPPIC)) select NRFX_DPPI @@ -196,6 +210,12 @@ config NRFX_GPIOTE_NUM_OF_EVT_HANDLERS Specifies number of handlers that can be registered to nrfx_gpiote driver by the user. +config NRFX_GPPI + bool "Generic PPI layer" + help + Enable the nrfx_gppi utilities providing unified API for creating PPI + connections across SoC families. + config NRFX_GRTC bool "GRTC driver" depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_GRTC)) @@ -261,6 +281,7 @@ config NRFX_POWER config NRFX_PPI bool "PPI allocator" + default y if NRFX_GPPI depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_PPI)) config NRFX_PPIB @@ -268,41 +289,49 @@ config NRFX_PPIB config NRFX_PPIB00 bool "PPIB00 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib00,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB config NRFX_PPIB01 bool "PPIB01 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib01,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB config NRFX_PPIB10 bool "PPIB10 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib10,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB config NRFX_PPIB11 bool "PPIB11 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib11,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB config NRFX_PPIB20 bool "PPIB20 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib20,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB config NRFX_PPIB21 bool "PPIB21 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib21,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB config NRFX_PPIB22 bool "PPIB22 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib22,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB config NRFX_PPIB30 bool "PPIB30 driver instance" + default y if NRFX_GPPI depends on $(dt_nodelabel_has_compat,ppib30,$(DT_COMPAT_NORDIC_NRF_PPIB)) select NRFX_PPIB diff --git a/samples/boards/nordic/nrfx/Kconfig b/samples/boards/nordic/nrfx/Kconfig index 67d02ef981b..776090f5bd2 100644 --- a/samples/boards/nordic/nrfx/Kconfig +++ b/samples/boards/nordic/nrfx/Kconfig @@ -3,12 +3,6 @@ source "Kconfig.zephyr" -config NRFX_DPPI - default $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_DPPIC)) - -config NRFX_PPI - default $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_PPI)) - config NRFX_GPIOTE0 default y if SOC_SERIES_NRF51X || \ SOC_SERIES_NRF52X || \ diff --git a/samples/boards/nordic/nrfx/prj.conf b/samples/boards/nordic/nrfx/prj.conf index d4f0c29699f..224fa224132 100644 --- a/samples/boards/nordic/nrfx/prj.conf +++ b/samples/boards/nordic/nrfx/prj.conf @@ -1,3 +1,4 @@ CONFIG_GPIO=n CONFIG_LOG=y CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100 +CONFIG_NRFX_GPPI=y diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 823d1be8e2d..f696ab95478 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -82,7 +82,7 @@ config SOC_NRF53_ANOMALY_168_WORKAROUND_FOR_EXECUTION_FROM_RAM config SOC_NRF53_RTC_PRETICK bool "Pre-tick workaround for nRF5340 anomaly 165" depends on (SYS_CLOCK_EXISTS && SOC_NRF5340_CPUNET) || SOC_NRF5340_CPUAPP - select NRFX_DPPI + select NRFX_GPPI select ARM_ON_ENTER_CPU_IDLE_HOOK if SOC_NRF5340_CPUNET select ARM_ON_ENTER_CPU_IDLE_PREPARE_HOOK if SOC_NRF5340_CPUNET help diff --git a/soc/nordic/nrf53/Kconfig.sync_rtc b/soc/nordic/nrf53/Kconfig.sync_rtc index 475db911c67..b960465e442 100644 --- a/soc/nordic/nrf53/Kconfig.sync_rtc +++ b/soc/nordic/nrf53/Kconfig.sync_rtc @@ -5,7 +5,7 @@ config NRF53_SYNC_RTC bool "RTC clock synchronization" default y if LOG && !LOG_MODE_MINIMAL depends on NRF_RTC_TIMER - select NRFX_DPPI + select NRFX_GPPI select MBOX if !IPM if NRF53_SYNC_RTC