From 3b243adbb4419a246099484fd5e21948364d063b 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] 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. 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 7fc492c56f58e22..6bd6d563f305e22 100644 --- a/drivers/pwm/Kconfig.nrf_sw +++ b/drivers/pwm/Kconfig.nrf_sw @@ -8,8 +8,7 @@ config PWM_NRF_SW default y 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 d44c1ab7e02619f..8bc3f6c5e2cdc55 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 6cbe63958e95744..e14d85eb43cacdc 100644 --- a/modules/hal_nordic/nrfx/CMakeLists.txt +++ b/modules/hal_nordic/nrfx/CMakeLists.txt @@ -109,7 +109,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) @@ -193,7 +193,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 348f52caf05ff23..436dd61281447ae 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -30,71 +30,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 @@ -192,6 +206,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)) @@ -257,6 +277,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 @@ -264,41 +285,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 67d02ef981bfc3a..776090f5bd23d0a 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 d4f0c29699f8806..224fa224132ab0a 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 ecf7c112e82f009..9fc9d7a9df09c70 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 475db911c672732..b960465e44275b6 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