From 69b6c7e864d5f01649eabcfbaca62fed80c6f100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Tue, 29 Jul 2025 09:13:19 +0200 Subject: [PATCH 1/2] [nrf fromtree] soc: nordic: Extend address validation to cover GPREGRET MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extension of the validate_base_addresses.c file to cover GPREGRET in all Nordic SoCs. Signed-off-by: Karol Lasończyk (cherry picked from commit 8f2d3e7623d6abdaaccae8fe42a93230f53ae05f) (cherry picked from commit d45132712f2f0a846c04f0c171ec9fcbd43d8d1a) --- soc/nordic/validate_base_addresses.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/soc/nordic/validate_base_addresses.c b/soc/nordic/validate_base_addresses.c index f3c9c8bf214..7426364417f 100644 --- a/soc/nordic/validate_base_addresses.c +++ b/soc/nordic/validate_base_addresses.c @@ -73,13 +73,19 @@ #define NRF_WDT0 NRF_WDT #endif +#if !defined(NRF_POWER_GPREGRET1) && defined(NRF_POWER) #if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) -#if !defined(NRF_POWER_GPREGRET1) && defined(NRF_POWER_BASE) -#define NRF_POWER_GPREGRET1 (0x51c + NRF_POWER_BASE) +#define NRF_POWER_GPREGRET1 (&NRF_POWER->GPREGRET) +#else +#define NRF_POWER_GPREGRET1 (&NRF_POWER->GPREGRET[0]) +#endif #endif -#if !defined(NRF_POWER_GPREGRET2) && defined(NRF_POWER_BASE) -#define NRF_POWER_GPREGRET2 (0x520 + NRF_POWER_BASE) +#if !defined(NRF_POWER_GPREGRET2) && defined(NRF_POWER) +#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) +#define NRF_POWER_GPREGRET2 (&NRF_POWER->GPREGRET2) +#else +#define NRF_POWER_GPREGRET2 (&NRF_POWER->GPREGRET[1]) #endif #endif @@ -367,9 +373,5 @@ CHECK_DT_REG(cpurad_wdt010, NRF_RADIOCORE_WDT010); CHECK_DT_REG(cpurad_wdt011, NRF_RADIOCORE_WDT011); CHECK_DT_REG(wdt131, NRF_WDT131); CHECK_DT_REG(wdt132, NRF_WDT132); - -/* nRF51/nRF52-specific addresses */ -#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) CHECK_DT_REG(gpregret1, NRF_POWER_GPREGRET1); CHECK_DT_REG(gpregret2, NRF_POWER_GPREGRET2); -#endif From 8f5f5ed30ac4b7b4f4004791288636d7a71878af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Laso=C5=84czyk?= Date: Tue, 29 Jul 2025 09:12:23 +0200 Subject: [PATCH 2/2] [nrf fromtree] dts: nordic: Fix GPREGRET addresses for nRF54LM20A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for wrongly addressed GPREGRET space. Signed-off-by: Karol Lasończyk (cherry picked from commit d55ee09e1a1491172ffecb75ea4595a19e13c08b) (cherry picked from commit b57c64b8fcf5a7e5e3b7a501074d364d36471f18) --- dts/vendor/nordic/nrf54lm20a.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dts/vendor/nordic/nrf54lm20a.dtsi b/dts/vendor/nordic/nrf54lm20a.dtsi index d673ae94e50..d1e6d1b0d28 100644 --- a/dts/vendor/nordic/nrf54lm20a.dtsi +++ b/dts/vendor/nordic/nrf54lm20a.dtsi @@ -800,19 +800,19 @@ #address-cells = <1>; #size-cells = <1>; - gpregret1: gpregret1@51c { + gpregret1: gpregret1@500 { #address-cells = <1>; #size-cells = <1>; compatible = "nordic,nrf-gpregret"; - reg = <0x51c 0x1>; + reg = <0x500 0x1>; status = "disabled"; }; - gpregret2: gpregret2@520 { + gpregret2: gpregret2@504 { #address-cells = <1>; #size-cells = <1>; compatible = "nordic,nrf-gpregret"; - reg = <0x520 0x1>; + reg = <0x504 0x1>; status = "disabled"; }; };