Skip to content

Commit

Permalink
[nrf fromlist] modules: hal_nordic: add NRFX_GPPI config
Browse files Browse the repository at this point in the history
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: zephyrproject-rtos/zephyr#79857
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
  • Loading branch information
e-rk committed Oct 23, 2024
1 parent 4c63e2e commit d707d70
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 16 deletions.
3 changes: 1 addition & 2 deletions drivers/pwm/Kconfig.nrf_sw
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 2 additions & 4 deletions drivers/serial/Kconfig.nrfx_uart_instance
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions modules/hal_nordic/nrfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,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)
Expand Down Expand Up @@ -196,7 +196,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()
Expand Down
29 changes: 29 additions & 0 deletions modules/hal_nordic/nrfx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 "Enable 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))
Expand Down Expand Up @@ -261,48 +281,57 @@ 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
bool

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

Expand Down
6 changes: 0 additions & 6 deletions samples/boards/nordic/nrfx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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 || \
Expand Down
1 change: 1 addition & 0 deletions samples/boards/nordic/nrfx/prj.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_GPIO=n
CONFIG_LOG=y
CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100
CONFIG_NRFX_GPPI=y
2 changes: 1 addition & 1 deletion soc/nordic/nrf53/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion soc/nordic/nrf53/Kconfig.sync_rtc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d707d70

Please sign in to comment.