From 0d8d7b8a6f7b3d1f8fb22aa990e1c24371aff1f2 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Mon, 2 Dec 2024 12:36:26 +0100 Subject: [PATCH] [nrf fromlist] soc: nordic: nrf54l: add preliminary workaround for nRF54L anomaly 31 This workaround will be replaced with a variant executed at SystemInit() level, once MDK implements it. Upstream PR #: 82268 Signed-off-by: Nikodem Kastelik --- soc/nordic/nrf54l/soc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/soc/nordic/nrf54l/soc.c b/soc/nordic/nrf54l/soc.c index 56e48800ed4..d96679b8e85 100644 --- a/soc/nordic/nrf54l/soc.c +++ b/soc/nordic/nrf54l/soc.c @@ -38,6 +38,7 @@ #endif #include +#include #include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -154,6 +155,13 @@ static inline void power_and_clock_configuration(void) } #if (DT_PROP(DT_NODELABEL(vregmain), regulator_initial_mode) == NRF5X_REG_MODE_DCDC) +#if NRF54L_ERRATA_31_ENABLE_WORKAROUND + /* Workaround for Errata 31 */ + if (nrf54l_errata_31()) { + *((volatile uint32_t *)0x50120624ul) = 20 | 1<<5; + *((volatile uint32_t *)0x5012063Cul) &= ~(1<<19); + } +#endif nrf_regulators_vreg_enable_set(NRF_REGULATORS, NRF_REGULATORS_VREG_MAIN, true); #endif