Skip to content

Commit f195f48

Browse files
committed
[nrf fromtree] soc: arm: nordic_nrf: add support for poweroff
Implement the z_sys_poweroff() hook and select HAS_POWEROFF. Signed-off-by: Gerard Marull-Paretas <[email protected]> (cherry picked from commit 526a7bb)
1 parent 4e22e52 commit f195f48

File tree

6 files changed

+21
-0
lines changed

6 files changed

+21
-0
lines changed

soc/arm/nordic_nrf/common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
zephyr_library_sources_ifdef(CONFIG_SOC_FAMILY_NRF soc_nrf_common.S)
5+
zephyr_library_sources_ifdef(CONFIG_POWEROFF poweroff.c)
56
zephyr_include_directories(.)
67

78
if (CONFIG_TFM_PARTITION_PLATFORM)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/sys/poweroff.h>
7+
#include <zephyr/toolchain.h>
8+
9+
#include <hal/nrf_power.h>
10+
11+
void z_sys_poweroff(void)
12+
{
13+
nrf_power_system_off(NRF_POWER);
14+
15+
CODE_UNREACHABLE;
16+
}

soc/arm/nordic_nrf/nrf51/Kconfig.series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ config SOC_SERIES_NRF51X
1313
select HAS_NRFX
1414
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
1515
select HAS_PM
16+
select HAS_POWEROFF
1617
help
1718
Enable support for NRF51 MCU series

soc/arm/nordic_nrf/nrf52/Kconfig.series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ config SOC_SERIES_NRF52X
1616
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
1717
select HAS_SWO
1818
select HAS_PM
19+
select HAS_POWEROFF
1920
help
2021
Enable support for NRF52 MCU series

soc/arm/nordic_nrf/nrf53/Kconfig.soc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config SOC_NRF5340_CPUAPP
1010
select CPU_HAS_FPU
1111
select ARMV8_M_DSP
1212
select HAS_PM
13+
select HAS_POWEROFF
1314

1415
config SOC_NRF5340_CPUNET
1516
bool

soc/arm/nordic_nrf/nrf91/Kconfig.series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ config SOC_SERIES_NRF91X
1717
select HAS_NRFX
1818
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
1919
select HAS_PM
20+
select HAS_POWEROFF
2021
help
2122
Enable support for NRF91 MCU series

0 commit comments

Comments
 (0)