diff --git a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp index f2e0343d6350d..674b5433c1479 100644 --- a/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp +++ b/soc/nordic/nrf54h/Kconfig.defconfig.nrf54h20_cpuapp @@ -15,6 +15,6 @@ config POWER_DOMAIN default y config CODE_DATA_RELOCATION - default y if PM || POWEROFF + default y if (PM || POWEROFF) && !MCUBOOT endif # SOC_NRF54H20_CPUAPP diff --git a/soc/nordic/nrf54h/power.c b/soc/nordic/nrf54h/power.c index 3a23a6050605f..c72cb6e834e59 100644 --- a/soc/nordic/nrf54h/power.c +++ b/soc/nordic/nrf54h/power.c @@ -88,7 +88,12 @@ void nrf_poweroff(void) CODE_UNREACHABLE; } -static __attribute__((__used__, noinline)) void cache_retain_and_sleep(void) +#if CONFIG_MCUBOOT +static __ramfunc +#else +static __attribute__((__used__, noinline)) +#endif +void cache_retain_and_sleep(void) { nrf_cache_task_trigger(NRF_DCACHE, NRF_CACHE_TASK_SAVE); nrf_cache_task_trigger(NRF_ICACHE, NRF_CACHE_TASK_SAVE);