Skip to content

Commit f9102d0

Browse files
jonathannilsenjukkar
authored andcommitted
[nrf noup] soc: nrf54h: work around missing power domain handling
This patch should be dropped as part of the next upmerge. The upcoming release of IronSide SE no longer disables RETAIN in all GPIO instances on boot, so the application must be able to handle the hardware default state of RETAIN being enabled. The GPIO retention is properly handled by changes that are currently only upstream and will be pulled in by the next upmerge. This patch exists a workaround to be able to integrate IronSide SE before the proper solution is pulled in. Signed-off-by: Jonathan Nilsen <[email protected]> (cherry picked from commit 20d89eb)
1 parent 774830f commit f9102d0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

soc/nordic/nrf54h/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ config SOC_NRF54H20_CPURAD_ENABLE_DEBUG_WAIT
105105

106106
endif # SOC_NRF54H20_CPURAD_ENABLE
107107

108+
config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND
109+
bool "Disable all GPIO pin retention on boot"
110+
default y
111+
depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD
112+
108113
config SOC_NRF54H20_CPURAD
109114
select SOC_NRF54H20_CPURAD_COMMON
110115

soc/nordic/nrf54h/soc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <zephyr/logging/log_frontend_stmesp.h>
1515
#endif
1616

17+
#include <hal/nrf_gpio.h>
1718
#include <hal/nrf_hsfll.h>
1819
#include <hal/nrf_lrcconf.h>
1920
#include <hal/nrf_spu.h>
@@ -173,6 +174,17 @@ void soc_early_init_hook(void)
173174
DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) {
174175
nrf_nfct_pad_config_enable_set(NRF_NFCT, false);
175176
}
177+
178+
/* This is a workaround for not yet having upstream patches for properly handling
179+
* pin retention. It should be removed as part of the next upmerge.
180+
*/
181+
if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) {
182+
NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST;
183+
184+
for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) {
185+
nrf_gpio_port_retain_set(gpio_regs[i], 0);
186+
}
187+
}
176188
}
177189

178190
#if defined(CONFIG_SOC_LATE_INIT_HOOK)

0 commit comments

Comments
 (0)