From def5f8ee07a6bf159481a9006d09aa0947d2ef76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Stasiak?= Date: Fri, 14 Mar 2025 09:16:44 +0100 Subject: [PATCH] soc: nordic: allow use of TWIM frequency workaround MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added Kconfig options to allow use of TWIM frequency workaround in NRFX for nRF52 and nRF53. Signed-off-by: MichaƂ Stasiak --- modules/hal_nordic/nrfx/nrfx_kconfig.h | 6 ++++++ soc/nordic/nrf52/Kconfig | 8 ++++++++ soc/nordic/nrf53/Kconfig | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/modules/hal_nordic/nrfx/nrfx_kconfig.h b/modules/hal_nordic/nrfx/nrfx_kconfig.h index d36b3617b07..250e1ae941d 100644 --- a/modules/hal_nordic/nrfx/nrfx_kconfig.h +++ b/modules/hal_nordic/nrfx/nrfx_kconfig.h @@ -776,6 +776,12 @@ #ifdef CONFIG_NRFX_TWIM137 #define NRFX_TWIM137_ENABLED 1 #endif +#ifdef CONFIG_NRF52_ANOMALY_219_WORKAROUND +#define NRFX_TWIM_NRF52_ANOMALY_219_WORKAROUND_ENABLED 1 +#endif +#ifdef CONFIG_SOC_NRF53_ANOMALY_47_WORKAROUND +#define NRFX_TWIM_NRF53_ANOMALY_47_WORKAROUND_ENABLED 1 +#endif #ifdef CONFIG_NRFX_TWIS #define NRFX_TWIS_ENABLED 1 diff --git a/soc/nordic/nrf52/Kconfig b/soc/nordic/nrf52/Kconfig index edc2b70d667..9e68fe0df2c 100644 --- a/soc/nordic/nrf52/Kconfig +++ b/soc/nordic/nrf52/Kconfig @@ -120,4 +120,12 @@ config NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE help EGU instance used by the nRF52 Anomaly 109 workaround for PWM. +config NRF52_ANOMALY_219_WORKAROUND + bool "Anomaly 219 workaround" + depends on NRFX_TWIM + help + Due to Anomaly 219 the low period of SCL clock is too short to meet + the I2C specification at 400 kHz. This workaround configures the I2C + frequency to 390 kHz instead of 400 kHz. + endif # SOC_SERIES_NRF52X diff --git a/soc/nordic/nrf53/Kconfig b/soc/nordic/nrf53/Kconfig index 856330992d2..33c938384cc 100644 --- a/soc/nordic/nrf53/Kconfig +++ b/soc/nordic/nrf53/Kconfig @@ -41,6 +41,14 @@ if SOC_SERIES_NRF53X VREGMAIN_PATH := $(dt_nodelabel_path,vregmain) VREGRADIO_PATH := $(dt_nodelabel_path,vregradio) +config SOC_NRF53_ANOMALY_47_WORKAROUND + bool "Anomaly 47 workaround" + depends on NRFX_TWIM + help + Due to Anomaly 47 the low period of SCL clock is too short to meet + the I2C specification at 400 kHz. This workaround configures the I2C + frequency to 390 kHz instead of 400 kHz. + config SOC_NRF53_ANOMALY_160_WORKAROUND_NEEDED bool "Workaround for nRF5340 anomaly 160" imply SOC_NRF53_ANOMALY_160_WORKAROUND