Skip to content

Commit 20d89eb

Browse files
jonathannilsenbjarki-andreasen
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]>
1 parent 59e6864 commit 20d89eb

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
@@ -95,6 +95,11 @@ config SOC_NRF54H20_CPURAD_ENABLE_CHECK_VTOR
9595
help
9696
Verify that VTOR is not 0xFFFFFFFF before booting the Radiocore.
9797

98+
config SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND
99+
bool "Disable all GPIO pin retention on boot"
100+
default y
101+
depends on SOC_NRF54H20_CPUAPP || SOC_NRF54H20_CPURAD
102+
98103
config SOC_NRF54H20_CPURAD
99104
select SOC_NRF54H20_CPURAD_COMMON
100105

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)