Skip to content

Commit cbc5ce9

Browse files
jonathannilsenmstasiaknordic
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 <jonathan.nilsen@nordicsemi.no> (cherry picked from commit fa2b950)
1 parent a2bce9d commit cbc5ce9

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

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_PM_S2RAM_OVERRIDE
105105
help
106106
Override Nordic s2ram implementation.
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
@@ -15,6 +15,7 @@
1515
#include <zephyr/logging/log_frontend_stmesp.h>
1616
#endif
1717

18+
#include <hal/nrf_gpio.h>
1819
#include <hal/nrf_hsfll.h>
1920
#include <hal/nrf_lrcconf.h>
2021
#include <hal/nrf_spu.h>
@@ -134,6 +135,17 @@ void soc_early_init_hook(void)
134135
DT_PROP_OR(DT_NODELABEL(nfct), nfct_pins_as_gpios, 0)) {
135136
nrf_nfct_pad_config_enable_set(NRF_NFCT, false);
136137
}
138+
139+
/* This is a workaround for not yet having upstream patches for properly handling
140+
* pin retention. It should be removed as part of the next upmerge.
141+
*/
142+
if (IS_ENABLED(CONFIG_SOC_NRF54H20_DISABLE_ALL_GPIO_RETENTION_WORKAROUND)) {
143+
NRF_GPIO_Type *gpio_regs[GPIO_COUNT] = GPIO_REG_LIST;
144+
145+
for (int i = 0; i < NRFX_ARRAY_SIZE(gpio_regs); i++) {
146+
nrf_gpio_port_retain_set(gpio_regs[i], 0);
147+
}
148+
}
137149
}
138150

139151
#if defined(CONFIG_SOC_LATE_INIT_HOOK)

0 commit comments

Comments
 (0)