soc: nordic: common: poweroff: Set VPR to remain in its reset state

CM33 must write MEMCONF.POWER[VPR].RET = 0 before entering System OFF.
This bit drives the vprSavedCtx input to VPR. Forcing it low will
disable the Hibernate wake feature in VPR, so that VPR will remain
in its reset state when waking from OFF.

Signed-off-by: Jakub Zymelka <jakub.zymelka@nordicsemi.no>
This commit is contained in:
Jakub Zymelka 2025-04-17 13:21:49 +02:00 committed by Benjamin Cabé
commit f87f2dc9b2

View file

@ -16,12 +16,18 @@
#endif #endif
#if defined(CONFIG_SOC_SERIES_NRF54LX) #if defined(CONFIG_SOC_SERIES_NRF54LX)
#include <helpers/nrfx_reset_reason.h> #include <helpers/nrfx_reset_reason.h>
#include <hal/nrf_memconf.h>
#endif #endif
#if defined(CONFIG_HAS_NORDIC_RAM_CTRL) #if defined(CONFIG_HAS_NORDIC_RAM_CTRL)
#include <helpers/nrfx_ram_ctrl.h> #include <helpers/nrfx_ram_ctrl.h>
#endif #endif
#if defined(CONFIG_SOC_SERIES_NRF54LX)
#define VPR_POWER_IDX 1
#define VPR_RET_BIT MEMCONF_POWER_RET_MEM0_Pos
#endif
void z_sys_poweroff(void) void z_sys_poweroff(void)
{ {
#if defined(CONFIG_HAS_NORDIC_RAM_CTRL) #if defined(CONFIG_HAS_NORDIC_RAM_CTRL)
@ -59,6 +65,9 @@ void z_sys_poweroff(void)
#endif #endif
#if defined(CONFIG_SOC_SERIES_NRF54LX) #if defined(CONFIG_SOC_SERIES_NRF54LX)
/* Set VPR to remain in its reset state when waking from OFF */
nrf_memconf_ramblock_ret_enable_set(NRF_MEMCONF, VPR_POWER_IDX, VPR_RET_BIT, false);
nrfx_reset_reason_clear(UINT32_MAX); nrfx_reset_reason_clear(UINT32_MAX);
#endif #endif
#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X) #if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_SERIES_NRF52X)