Skip to content

Commit 616465e

Browse files
[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]>
1 parent c1bf433 commit 616465e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

soc/nordic/nrf54h/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ config SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR
9696
help
9797
Verify that VTOR is not 0xFFFFFFFF before booting the Radiocore.
9898

99+
config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND
100+
def_bool SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD
101+
99102
config SOC_NRF54H20_CPURAD
100103
select SOC_NRF54H20_CPURAD_COMMON
101104

soc/nordic/nrf54h/soc.c

Lines changed: 15 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,20 @@ 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+
/* Some pins may not be owned by this core, depending on the configuration. The effect of
185+
* this should be that retention is disabled only for the pins owned by this core.
186+
*/
187+
for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) {
188+
nrf_gpio_port_retain_set(gpio_regs[i], 0);
189+
}
190+
}
176191
}
177192

178193
#if defined(CONFIG_SOC_LATE_INIT_HOOK)

0 commit comments

Comments
 (0)