Skip to content

Commit 4be1e6a

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 4be1e6a

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
@@ -96,6 +96,11 @@ 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+
bool "Disable all GPIO pin retention on boot"
101+
default y
102+
depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD
103+
99104
config SOC_NRF54H20_CPURAD
100105
select SOC_NRF54H20_CPURAD_COMMON
101106

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)