From c092964dd2a02ec7ecf52a438c6a12174ee5fbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Wed, 25 Sep 2024 10:51:01 +0200 Subject: [PATCH] modules: hal_nordic: Add new PDM instances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New PDM, some present on nRF54L15 FP1, instances have been added. Modified condfiguration file for nRF5340, which now requires PDM0 instance. Signed-off-by: MichaƂ Stasiak --- modules/hal_nordic/nrfx/Kconfig | 10 ++++++++++ modules/hal_nordic/nrfx/nrfx_config.h | 10 ++++++++-- .../hal_nordic/nrfx/nrfx_config_nrf5340_application.h | 9 +++++++++ soc/nordic/common/Kconfig.peripherals | 6 ++++++ soc/nordic/validate_base_addresses.c | 2 ++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/modules/hal_nordic/nrfx/Kconfig b/modules/hal_nordic/nrfx/Kconfig index 65894d48712..83ce3f157cc 100644 --- a/modules/hal_nordic/nrfx/Kconfig +++ b/modules/hal_nordic/nrfx/Kconfig @@ -169,6 +169,16 @@ config NRFX_PDM0 depends on $(dt_nodelabel_has_compat,pdm0,$(DT_COMPAT_NORDIC_NRF_PDM)) select NRFX_PDM +config NRFX_PDM20 + bool "PDM20 driver instance" + depends on $(dt_nodelabel_has_compat,pdm20,$(DT_COMPAT_NORDIC_NRF_PDM)) + select NRFX_PDM + +config NRFX_PDM21 + bool "PDM21 driver instance" + depends on $(dt_nodelabel_has_compat,pdm21,$(DT_COMPAT_NORDIC_NRF_PDM)) + select NRFX_PDM + config NRFX_POWER bool "POWER driver" depends on $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_POWER)) diff --git a/modules/hal_nordic/nrfx/nrfx_config.h b/modules/hal_nordic/nrfx/nrfx_config.h index 56e59879563..9b664c24374 100644 --- a/modules/hal_nordic/nrfx/nrfx_config.h +++ b/modules/hal_nordic/nrfx/nrfx_config.h @@ -209,11 +209,17 @@ #ifdef CONFIG_NRFX_PDM #define NRFX_PDM_ENABLED 1 #endif +#ifdef CONFIG_NRFX_PDM_LOG +#define NRFX_PDM_CONFIG_LOG_ENABLED 1 +#endif #ifdef CONFIG_NRFX_PDM0 #define NRFX_PDM0_ENABLED 1 #endif -#ifdef CONFIG_NRFX_PDM_LOG -#define NRFX_PDM_CONFIG_LOG_ENABLED 1 +#ifdef CONFIG_NRFX_PDM20 +#define NRFX_PDM20_ENABLED 1 +#endif +#ifdef CONFIG_NRFX_PDM21 +#define NRFX_PDM21_ENABLED 1 #endif #ifdef CONFIG_NRFX_POWER diff --git a/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h b/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h index a5dbcaa3db8..ab04db03f15 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h +++ b/modules/hal_nordic/nrfx/nrfx_config_nrf5340_application.h @@ -596,6 +596,15 @@ #define NRFX_PDM_CONFIG_LOG_LEVEL 3 #endif +/** + * @brief NRFX_PDM0_ENABLED + * + * Boolean. Accepted values 0 and 1. + */ +#ifndef NRFX_PDM0_ENABLED +#define NRFX_PDM0_ENABLED 0 +#endif + /** * @brief NRFX_POWER_ENABLED * diff --git a/soc/nordic/common/Kconfig.peripherals b/soc/nordic/common/Kconfig.peripherals index 57c90b05ef7..8ba97b225b9 100644 --- a/soc/nordic/common/Kconfig.peripherals +++ b/soc/nordic/common/Kconfig.peripherals @@ -129,6 +129,12 @@ config HAS_HW_NRF_OSCILLATORS config HAS_HW_NRF_PDM0 def_bool $(dt_nodelabel_enabled_with_compat,pdm0,$(DT_COMPAT_NORDIC_NRF_PDM)) +config HAS_HW_NRF_PDM20 + def_bool $(dt_nodelabel_enabled_with_compat,pdm20,$(DT_COMPAT_NORDIC_NRF_PDM)) + +config HAS_HW_NRF_PDM21 + def_bool $(dt_nodelabel_enabled_with_compat,pdm21,$(DT_COMPAT_NORDIC_NRF_PDM)) + config HAS_HW_NRF_POWER def_bool $(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_POWER)) diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index 84d773159bc..07ae94a233b 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -222,6 +222,8 @@ CHECK_DT_REG(nfct, NRF_NFCT); CHECK_DT_REG(nrf_mpu, NRF_MPU); CHECK_DT_REG(oscillators, NRF_OSCILLATORS); CHECK_DT_REG(pdm0, NRF_PDM0); +CHECK_DT_REG(pdm20, NRF_PDM20); +CHECK_DT_REG(pdm21, NRF_PDM21); CHECK_DT_REG(power, NRF_POWER); CHECK_DT_REG(ppi, NRF_PPI); CHECK_DT_REG(pwm0, NRF_PWM0);