soc: arm: nordic_nrf: add support for poweroff

Implement the z_sys_poweroff() hook and select HAS_POWEROFF.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2023-07-20 12:05:26 +02:00 committed by Carles Cufí
commit 526a7bb20d
6 changed files with 21 additions and 0 deletions

View file

@ -2,6 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library_sources_ifdef(CONFIG_SOC_FAMILY_NRF soc_nrf_common.S)
zephyr_library_sources_ifdef(CONFIG_POWEROFF poweroff.c)
zephyr_include_directories(.)
if (CONFIG_TFM_PARTITION_PLATFORM)

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/sys/poweroff.h>
#include <zephyr/toolchain.h>
#include <hal/nrf_power.h>
void z_sys_poweroff(void)
{
nrf_power_system_off(NRF_POWER);
CODE_UNREACHABLE;
}

View file

@ -13,5 +13,6 @@ config SOC_SERIES_NRF51X
select HAS_NRFX
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
select HAS_PM
select HAS_POWEROFF
help
Enable support for NRF51 MCU series

View file

@ -16,5 +16,6 @@ config SOC_SERIES_NRF52X
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
select HAS_SWO
select HAS_PM
select HAS_POWEROFF
help
Enable support for NRF52 MCU series

View file

@ -10,6 +10,7 @@ config SOC_NRF5340_CPUAPP
select CPU_HAS_FPU
select ARMV8_M_DSP
select HAS_PM
select HAS_POWEROFF
config SOC_NRF5340_CPUNET
bool

View file

@ -17,5 +17,6 @@ config SOC_SERIES_NRF91X
select HAS_NRFX
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
select HAS_PM
select HAS_POWEROFF
help
Enable support for NRF91 MCU series