soc: arm: nordic_nrf: drop PM hooks

Nordic SoCs do all power management automagically when going to idle (ie
k_cpu_idle()). The only extra state, system off, is now handled via
sys_shutdown(), so there's no need to support the PM subsystem.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2023-07-20 12:35:59 +02:00 committed by Carles Cufí
commit 96b3827313
13 changed files with 0 additions and 214 deletions

View file

@ -28,9 +28,6 @@ config SYS_CLOCK_TICKS_PER_SEC
config ARCH_HAS_CUSTOM_BUSY_WAIT
default y if !QEMU_TARGET
config PM
default y if SYS_CLOCK_EXISTS && MULTITHREADING && HAS_PM
config BUILD_OUTPUT_HEX
default y

View file

@ -6,10 +6,6 @@ zephyr_library_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/arm/include

View file

@ -12,7 +12,6 @@ config SOC_SERIES_NRF51X
select XIP
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

@ -1,47 +0,0 @@
/*
* Copyright (c) 2017 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/pm/pm.h>
#include <hal/nrf_power.h>
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */
void pm_state_set(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
nrf_power_system_off(NRF_POWER);
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
}
/* Handle SOC specific activity after Low Power Mode Exit */
void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
/* Nothing to do. */
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
/*
* System is now in active mode. Reenable interrupts which were disabled
* when OS started idling code.
*/
irq_unlock(0);
}

View file

@ -6,10 +6,6 @@ zephyr_library_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)
zephyr_library_include_directories(
${ZEPHYR_BASE}/kernel/include
${ZEPHYR_BASE}/arch/arm/include

View file

@ -15,7 +15,6 @@ config SOC_SERIES_NRF52X
select HAS_NORDIC_DRIVERS
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

@ -1,47 +0,0 @@
/*
* Copyright (c) 2017 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/pm/pm.h>
#include <hal/nrf_power.h>
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */
void pm_state_set(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
nrf_power_system_off(NRF_POWER);
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
}
/* Handle SOC specific activity after Low Power Mode Exit */
void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
/* Nothing to do. */
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
/*
* System is now in active mode. Reenable interrupts which were disabled
* when OS started idling code.
*/
irq_unlock(0);
}

View file

@ -4,10 +4,6 @@ zephyr_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)
zephyr_library_sources_ifdef(CONFIG_NRF53_SYNC_RTC
sync_rtc.c
)

View file

@ -9,7 +9,6 @@ config SOC_NRF5340_CPUAPP
select CPU_HAS_NRF_IDAU
select CPU_HAS_FPU
select ARMV8_M_DSP
select HAS_PM
select HAS_POWEROFF
config SOC_NRF5340_CPUNET

View file

@ -1,49 +0,0 @@
/*
* Copyright (c) 2017 Intel Corporation.
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/pm/pm.h>
#include <hal/nrf_regulators.h>
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */
void pm_state_set(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
nrf_regulators_system_off(NRF_REGULATORS);
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
}
/* Handle SOC specific activity after Low Power Mode Exit */
void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
/* Nothing to do. */
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
/*
* System is now in active mode. Reenable interrupts which were disabled
* when OS started idling code.
*/
irq_unlock(0);
}

View file

@ -3,7 +3,3 @@
zephyr_sources(
soc.c
)
zephyr_library_sources_ifdef(CONFIG_PM
power.c
)

View file

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

View file

@ -1,48 +0,0 @@
/*
* Copyright (c) 2017 Intel Corporation.
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/pm/pm.h>
#include <hal/nrf_regulators.h>
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* Invoke Low Power/System Off specific Tasks */
void pm_state_set(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
nrf_regulators_system_off(NRF_REGULATORS);
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
}
/* Handle SOC specific activity after Low Power Mode Exit */
void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
{
ARG_UNUSED(substate_id);
switch (state) {
case PM_STATE_SOFT_OFF:
/* Nothing to do. */
break;
default:
LOG_DBG("Unsupported power state %u", state);
break;
}
/*
* System is now in active mode. Reenable interrupts which were disabled
* when OS started idling code.
*/
irq_unlock(0);
}