power: rename Low Power States to Sleep States

There exists SoCs, e.g. STM32L4, where one of the low power modes
reduces CPU frequency and supply voltage but does not stop the CPU. Such
power modes are currently not supported by Zephyr.

To facilitate adding support for such class of power modes in the future
and to ensure the naming convention makes it clear that the currently
supported power modes stop the CPU this commit renames Low Power States
to Slep States and updates the documentation.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
Piotr Mienkowski 2019-02-28 07:20:24 +01:00 committed by Anas Nashif
parent f5c4e369ea
commit 204311d004
26 changed files with 162 additions and 162 deletions

View file

@ -351,25 +351,25 @@ config ARCH_HAS_THREAD_ABORT
# Hidden PM feature configs which are to be selected by # Hidden PM feature configs which are to be selected by
# individual SoC. # individual SoC.
# #
config HAS_STATE_LOW_POWER_1 config HAS_STATE_SLEEP_1
# Hidden # Hidden
bool bool
help help
This option signifies that the target supports the SYS_POWER_STATE_LOW_POWER_1 This option signifies that the target supports the SYS_POWER_STATE_SLEEP_1
configuration option. configuration option.
config HAS_STATE_LOW_POWER_2 config HAS_STATE_SLEEP_2
# Hidden # Hidden
bool bool
help help
This option signifies that the target supports the SYS_POWER_STATE_LOW_POWER_2 This option signifies that the target supports the SYS_POWER_STATE_SLEEP_2
configuration option. configuration option.
config HAS_STATE_LOW_POWER_3 config HAS_STATE_SLEEP_3
# Hidden # Hidden
bool bool
help help
This option signifies that the target supports the SYS_POWER_STATE_LOW_POWER_3 This option signifies that the target supports the SYS_POWER_STATE_SLEEP_3
configuration option. configuration option.
config HAS_STATE_DEEP_SLEEP_1 config HAS_STATE_DEEP_SLEEP_1

View file

@ -24,9 +24,9 @@ Terminology
The CPU and clocks are powered on. This is the normal operating state when The CPU and clocks are powered on. This is the normal operating state when
the system is running. the system is running.
:dfn:`Low Power State` :dfn:`Sleep State`
Refers to any one of the low power states supported by the SoC. The SoC is Some of the SoC clocks are gated. The CPU is stopped but does not lose
usually powered on while the clocks are power gated. execution context. Configuration of the peripherals is preserved.
:dfn:`Deep Sleep State` :dfn:`Deep Sleep State`
The SoC is power gated and loses context. Most peripherals would also be The SoC is power gated and loses context. Most peripherals would also be
@ -172,15 +172,16 @@ The power management subsystem classifies power management schemes
into two categories based on whether the CPU loses execution context during the into two categories based on whether the CPU loses execution context during the
power state transition. power state transition.
* Low Power State * Sleep State
* Deep Sleep State * Deep Sleep State
Low Power State Sleep State
=============== ===========
CPU does not lose execution context. Devices also do not lose power while CPU is stopped but does not lose execution context. Some of the SoC clocks are
entering power states in this category. The wake latencies of power states gated. Configuration of the peripherals is preserved but some of them may be no
in this category are relatively low. longer functional. Execution will resume at the place it stopped. The wake
latencies of power states in this category are relatively low.
Deep Sleep State Deep Sleep State
================ ================
@ -190,7 +191,7 @@ OS startup code or at a resume point determined by a bootloader that supports
deep sleep resume. Depending on the SOC's implementation of the power saving deep sleep resume. Depending on the SOC's implementation of the power saving
feature, it may turn off power to most devices. RAM may be retained by some feature, it may turn off power to most devices. RAM may be retained by some
implementations, while others may remove power from RAM saving considerable implementations, while others may remove power from RAM saving considerable
power. Power states in this category save more power than Low Power states power. Power states in this category save more power than Sleep states
and would have higher wake latencies. and would have higher wake latencies.
Device Power Management Infrastructure Device Power Management Infrastructure
@ -523,9 +524,9 @@ the following configuration flags.
This flag enables the tickless idle power saving feature. This flag enables the tickless idle power saving feature.
:option:`CONFIG_SYS_POWER_LOW_POWER_STATES` :option:`CONFIG_SYS_POWER_SLEEP_STATES`
This flag enables support for the Low Power states. This flag enables support for the Sleep states.
:option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES` :option:`CONFIG_SYS_POWER_DEEP_SLEEP_STATES`

View file

@ -26,17 +26,17 @@ extern "C" {
enum power_states { enum power_states {
SYS_POWER_STATE_AUTO = (-2), SYS_POWER_STATE_AUTO = (-2),
SYS_POWER_STATE_ACTIVE = (-1), SYS_POWER_STATE_ACTIVE = (-1),
#ifdef CONFIG_SYS_POWER_LOW_POWER_STATES #ifdef CONFIG_SYS_POWER_SLEEP_STATES
# ifdef CONFIG_HAS_STATE_LOW_POWER_1 # ifdef CONFIG_HAS_STATE_SLEEP_1
SYS_POWER_STATE_LOW_POWER_1, SYS_POWER_STATE_SLEEP_1,
# endif # endif
# ifdef CONFIG_HAS_STATE_LOW_POWER_2 # ifdef CONFIG_HAS_STATE_SLEEP_2
SYS_POWER_STATE_LOW_POWER_2, SYS_POWER_STATE_SLEEP_2,
# endif # endif
# ifdef CONFIG_HAS_STATE_LOW_POWER_3 # ifdef CONFIG_HAS_STATE_SLEEP_3
SYS_POWER_STATE_LOW_POWER_3, SYS_POWER_STATE_SLEEP_3,
# endif # endif
#endif /* CONFIG_SYS_POWER_LOW_POWER_STATES */ #endif /* CONFIG_SYS_POWER_SLEEP_STATES */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES #ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
# ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1 # ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1
@ -65,29 +65,29 @@ extern unsigned char sys_pm_idle_exit_notify;
*/ */
/** /**
* @brief Check if particular power state is a low power state. * @brief Check if particular power state is a sleep state.
* *
* This function returns true if given power state is a low power state. * This function returns true if given power state is a sleep state.
*/ */
static inline bool sys_pm_is_low_power_state(enum power_states state) static inline bool sys_pm_is_sleep_state(enum power_states state)
{ {
bool ret = true; bool ret = true;
switch (state) { switch (state) {
#ifdef CONFIG_SYS_POWER_LOW_POWER_STATES #ifdef CONFIG_SYS_POWER_SLEEP_STATES
# ifdef CONFIG_HAS_STATE_LOW_POWER_1 # ifdef CONFIG_HAS_STATE_SLEEP_1
case SYS_POWER_STATE_LOW_POWER_1: case SYS_POWER_STATE_SLEEP_1:
break; break;
# endif # endif
# ifdef CONFIG_HAS_STATE_LOW_POWER_2 # ifdef CONFIG_HAS_STATE_SLEEP_2
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
break; break;
# endif # endif
# ifdef CONFIG_HAS_STATE_LOW_POWER_3 # ifdef CONFIG_HAS_STATE_SLEEP_3
case SYS_POWER_STATE_LOW_POWER_3: case SYS_POWER_STATE_SLEEP_3:
break; break;
# endif # endif
#endif /* CONFIG_SYS_POWER_LOW_POWER_STATES */ #endif /* CONFIG_SYS_POWER_SLEEP_STATES */
default: default:
ret = false; ret = false;
break; break;
@ -290,11 +290,11 @@ extern enum power_states sys_suspend(s32_t ticks);
extern void sys_set_power_state(enum power_states state); extern void sys_set_power_state(enum power_states state);
/** /**
* @brief Do any SoC or architecture specific post ops after low power states. * @brief Do any SoC or architecture specific post ops after sleep state exits.
* *
* This function is a place holder to do any operations that may * This function is a place holder to do any operations that may
* be needed to be done after low power exits. Currently it enables * be needed to be done after sleep state exits. Currently it enables
* interrupts after resuming from low power state. In future, the enabling * interrupts after resuming from sleep state. In future, the enabling
* of interrupts may be moved into the kernel. * of interrupts may be moved into the kernel.
*/ */
extern void sys_power_state_post_ops(enum power_states state); extern void sys_power_state_post_ops(enum power_states state);
@ -308,10 +308,10 @@ extern void sys_power_state_post_ops(enum power_states state);
extern void sys_pm_notify_lps_entry(enum power_states state); extern void sys_pm_notify_lps_entry(enum power_states state);
/** /**
* @brief Application defined function for low power state exit * @brief Application defined function for sleep state exit
* *
* Application defined function for doing any target specific operations * Application defined function for doing any target specific operations
* for low power state exit. * for sleep state exit.
*/ */
extern void sys_pm_notify_lps_exit(enum power_states state); extern void sys_pm_notify_lps_exit(enum power_states state);

View file

@ -15,10 +15,9 @@ menuconfig SYS_POWER_MANAGEMENT
timer is due to expire. timer is due to expire.
if SYS_POWER_MANAGEMENT if SYS_POWER_MANAGEMENT
config SYS_POWER_LOW_POWER_STATES config SYS_POWER_SLEEP_STATES
bool "Low Power states" bool "Low Power states"
depends on HAS_STATE_LOW_POWER_1 || HAS_STATE_LOW_POWER_2 || \ depends on HAS_STATE_SLEEP_1 || HAS_STATE_SLEEP_2 || HAS_STATE_SLEEP_3
HAS_STATE_LOW_POWER_3
help help
This option enables the kernel to interface with a power manager This option enables the kernel to interface with a power manager
application. This permits the system to enter a custom CPU low power application. This permits the system to enter a custom CPU low power

View file

@ -26,7 +26,7 @@
*/ */
unsigned char sys_pm_idle_exit_notify; unsigned char sys_pm_idle_exit_notify;
#if defined(CONFIG_SYS_POWER_LOW_POWER_STATES) #if defined(CONFIG_SYS_POWER_SLEEP_STATES)
void __attribute__((weak)) sys_resume(void) void __attribute__((weak)) sys_resume(void)
{ {
} }
@ -74,7 +74,7 @@ static void sys_power_save_idle(void)
#endif #endif
set_kernel_idle_time_in_ticks(ticks); set_kernel_idle_time_in_ticks(ticks);
#if (defined(CONFIG_SYS_POWER_LOW_POWER_STATES) || \ #if (defined(CONFIG_SYS_POWER_SLEEP_STATES) || \
defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES)) defined(CONFIG_SYS_POWER_DEEP_SLEEP_STATES))
sys_pm_idle_exit_notify = 1U; sys_pm_idle_exit_notify = 1U;
@ -104,7 +104,7 @@ static void sys_power_save_idle(void)
void z_sys_power_save_idle_exit(s32_t ticks) void z_sys_power_save_idle_exit(s32_t ticks)
{ {
#if defined(CONFIG_SYS_POWER_LOW_POWER_STATES) #if defined(CONFIG_SYS_POWER_SLEEP_STATES)
/* Some CPU low power states require notification at the ISR /* Some CPU low power states require notification at the ISR
* to allow any operations that needs to be done before kernel * to allow any operations that needs to be done before kernel
* switches task or processes nested interrupts. This can be * switches task or processes nested interrupts. This can be

View file

@ -1,8 +1,8 @@
config NRF5_POWER_MGMT_EXAMPLE config NRF5_POWER_MGMT_EXAMPLE
bool bool
default y default y
select HAS_STATE_LOW_POWER_2 select HAS_STATE_SLEEP_2
select HAS_STATE_LOW_POWER_3 select HAS_STATE_SLEEP_3
help help
Hidden option enabling LPS_1 and LPS_2 low power states. Hidden option enabling LPS_1 and LPS_2 low power states.
This is needed, as these states are implemented by this example. This is needed, as these states are implemented by this example.

View file

@ -18,9 +18,9 @@ enters idle state:
states, which are signaled using LEDs on the development kit: states, which are signaled using LEDs on the development kit:
A. LED1: [X], LED2: [X]: System is active, no low power state is selected. A. LED1: [X], LED2: [X]: System is active, no low power state is selected.
B. LED1: [X], LED2: [ ]: System is idle, and the SYS_POWER_STATE_LOW_POWER_2 B. LED1: [X], LED2: [ ]: System is idle, and the SYS_POWER_STATE_SLEEP_2
state is selected. state is selected.
C. LED1: [ ], LED2: [ ]: System is idle, and the SYS_POWER_STATE_LOW_POWER_3 C. LED1: [ ], LED2: [ ]: System is idle, and the SYS_POWER_STATE_SLEEP_3
state is selected. state is selected.
2. Deep Sleep: This Power State is mapped to SYSTEM OFF state. In this mode 2. Deep Sleep: This Power State is mapped to SYSTEM OFF state. In this mode
@ -68,31 +68,31 @@ nRF52 core output
<-- App doing busy wait for 10 Sec --> <-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 10 Sec --> <-- App going to sleep for 10 Sec -->
--> Entering to SYS_POWER_STATE_LOW_POWER_2 state. --> Entering to SYS_POWER_STATE_SLEEP_2 state.
--> Exited from SYS_POWER_STATE_LOW_POWER_2 state. --> Exited from SYS_POWER_STATE_SLEEP_2 state.
<-- App doing busy wait for 10 Sec --> <-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 30 Sec --> <-- App going to sleep for 30 Sec -->
--> Entering to SYS_POWER_STATE_LOW_POWER_3 state. --> Entering to SYS_POWER_STATE_SLEEP_3 state.
--> Exited from SYS_POWER_STATE_LOW_POWER_3 state. --> Exited from SYS_POWER_STATE_SLEEP_3 state.
<-- Disabling SYS_POWER_STATE_LOW_POWER_3 state ---> <-- Disabling SYS_POWER_STATE_SLEEP_3 state --->
<-- App doing busy wait for 10 Sec --> <-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 10 Sec --> <-- App going to sleep for 10 Sec -->
--> Entering to SYS_POWER_STATE_LOW_POWER_2 state. --> Entering to SYS_POWER_STATE_SLEEP_2 state.
--> Exited from SYS_POWER_STATE_LOW_POWER_2 state. --> Exited from SYS_POWER_STATE_SLEEP_2 state.
<-- App doing busy wait for 10 Sec --> <-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 30 Sec --> <-- App going to sleep for 30 Sec -->
--> Entering to SYS_POWER_STATE_LOW_POWER_2 state. --> Entering to SYS_POWER_STATE_SLEEP_2 state.
--> Exited from SYS_POWER_STATE_LOW_POWER_2 state. --> Exited from SYS_POWER_STATE_SLEEP_2 state.
<-- Enabling SYS_POWER_STATE_LOW_POWER_3 state ---> <-- Enabling SYS_POWER_STATE_SLEEP_3 state --->
<-- Disabling SYS_POWER_STATE_LOW_POWER_2 state ---> <-- Disabling SYS_POWER_STATE_SLEEP_2 state --->
<-- App doing busy wait for 10 Sec --> <-- App doing busy wait for 10 Sec -->
@ -101,11 +101,11 @@ nRF52 core output
<-- App doing busy wait for 10 Sec --> <-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 30 Sec --> <-- App going to sleep for 30 Sec -->
--> Entering to SYS_POWER_STATE_LOW_POWER_3 state. --> Entering to SYS_POWER_STATE_SLEEP_3 state.
--> Exited from SYS_POWER_STATE_LOW_POWER_3 state. --> Exited from SYS_POWER_STATE_SLEEP_3 state.
<-- Enabling SYS_POWER_STATE_LOW_POWER_2 state ---> <-- Enabling SYS_POWER_STATE_SLEEP_2 state --->
<-- Forcing SYS_POWER_STATE_LOW_POWER_3 state ---> <-- Forcing SYS_POWER_STATE_SLEEP_3 state --->
<-- App doing busy wait for 10 Sec --> <-- App doing busy wait for 10 Sec -->

View file

@ -1,10 +1,10 @@
CONFIG_BT=n CONFIG_BT=n
CONFIG_TIMESLICING=n CONFIG_TIMESLICING=n
CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_LOW_POWER_STATES=y CONFIG_SYS_POWER_SLEEP_STATES=y
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
CONFIG_DEVICE_POWER_MANAGEMENT=y CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_SYS_PM_STATE_LOCK=y CONFIG_SYS_PM_STATE_LOCK=y
CONFIG_SYS_PM_LPS_1_MIN_RES=5000 CONFIG_SYS_PM_SLEEP_1_MIN_RES=5000
CONFIG_SYS_PM_LPS_2_MIN_RES=15000 CONFIG_SYS_PM_SLEEP_2_MIN_RES=15000
CONFIG_GPIO=y CONFIG_GPIO=y

View file

@ -1,7 +1,7 @@
CONFIG_NUM_COOP_PRIORITIES=29 CONFIG_NUM_COOP_PRIORITIES=29
CONFIG_NUM_PREEMPT_PRIORITIES=40 CONFIG_NUM_PREEMPT_PRIORITIES=40
CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_LOW_POWER_STATES=y CONFIG_SYS_POWER_SLEEP_STATES=y
CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y CONFIG_SYS_POWER_DEEP_SLEEP_STATES=y
CONFIG_DEVICE_POWER_MANAGEMENT=y CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_TICKLESS_KERNEL=y CONFIG_TICKLESS_KERNEL=y

View file

@ -8,7 +8,7 @@ tests:
harness_config: harness_config:
type: multi_line type: multi_line
regex: regex:
- "--> Entering to SYS_POWER_STATE_LOW_POWER_2 state." - "--> Entering to SYS_POWER_STATE_SLEEP_2 state."
- "--> Exited from SYS_POWER_STATE_LOW_POWER_2 state." - "--> Exited from SYS_POWER_STATE_SLEEP_2 state."
- "--> Entering to SYS_POWER_STATE_LOW_POWER_3 state." - "--> Entering to SYS_POWER_STATE_SLEEP_3 state."
- "--> Exited from SYS_POWER_STATE_LOW_POWER_3 state." - "--> Exited from SYS_POWER_STATE_SLEEP_3 state."

View file

@ -57,28 +57,28 @@ void main(void)
switch (i) { switch (i) {
case 3: case 3:
printk("\n<-- Disabling %s state --->\n", printk("\n<-- Disabling %s state --->\n",
STRINGIFY(SYS_POWER_STATE_LOW_POWER_3)); STRINGIFY(SYS_POWER_STATE_SLEEP_3));
sys_pm_ctrl_disable_state(SYS_POWER_STATE_LOW_POWER_3); sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_3);
break; break;
case 5: case 5:
printk("\n<-- Enabling %s state --->\n", printk("\n<-- Enabling %s state --->\n",
STRINGIFY(SYS_POWER_STATE_LOW_POWER_3)); STRINGIFY(SYS_POWER_STATE_SLEEP_3));
sys_pm_ctrl_enable_state(SYS_POWER_STATE_LOW_POWER_3); sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_3);
printk("<-- Disabling %s state --->\n", printk("<-- Disabling %s state --->\n",
STRINGIFY(SYS_POWER_STATE_LOW_POWER_2)); STRINGIFY(SYS_POWER_STATE_SLEEP_2));
sys_pm_ctrl_disable_state(SYS_POWER_STATE_LOW_POWER_2); sys_pm_ctrl_disable_state(SYS_POWER_STATE_SLEEP_2);
break; break;
case 7: case 7:
printk("\n<-- Enabling %s state --->\n", printk("\n<-- Enabling %s state --->\n",
STRINGIFY(SYS_POWER_STATE_LOW_POWER_2)); STRINGIFY(SYS_POWER_STATE_SLEEP_2));
sys_pm_ctrl_enable_state(SYS_POWER_STATE_LOW_POWER_2); sys_pm_ctrl_enable_state(SYS_POWER_STATE_SLEEP_2);
printk("<-- Forcing %s state --->\n", printk("<-- Forcing %s state --->\n",
STRINGIFY(SYS_POWER_STATE_LOW_POWER_3)); STRINGIFY(SYS_POWER_STATE_SLEEP_3));
sys_pm_force_power_state(SYS_POWER_STATE_LOW_POWER_3); sys_pm_force_power_state(SYS_POWER_STATE_SLEEP_3);
break; break;
default: default:

View file

@ -13,8 +13,8 @@
void sys_pm_notify_lps_entry(enum power_states state) void sys_pm_notify_lps_entry(enum power_states state)
{ {
switch (state) { switch (state) {
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
printk("--> Entering to SYS_POWER_STATE_LOW_POWER_2 state.\n"); printk("--> Entering to SYS_POWER_STATE_SLEEP_2 state.\n");
/* /*
* This power state is implemented by this sample. * This power state is implemented by this sample.
@ -25,8 +25,8 @@ void sys_pm_notify_lps_entry(enum power_states state)
k_cpu_idle(); k_cpu_idle();
break; break;
case SYS_POWER_STATE_LOW_POWER_3: case SYS_POWER_STATE_SLEEP_3:
printk("--> Entering to SYS_POWER_STATE_LOW_POWER_3 state.\n"); printk("--> Entering to SYS_POWER_STATE_SLEEP_3 state.\n");
/* /*
* This power state is implemented by this sample. * This power state is implemented by this sample.
@ -64,16 +64,16 @@ void sys_pm_notify_lps_entry(enum power_states state)
void sys_pm_notify_lps_exit(enum power_states state) void sys_pm_notify_lps_exit(enum power_states state)
{ {
switch (state) { switch (state) {
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
printk("--> Exited from SYS_POWER_STATE_LOW_POWER_2 state.\n"); printk("--> Exited from SYS_POWER_STATE_SLEEP_2 state.\n");
/* Perform exit from the low power state by turning on LEDs */ /* Perform exit from the low power state by turning on LEDs */
gpio_pin_write(gpio_port, LED_1, LED_ON); gpio_pin_write(gpio_port, LED_1, LED_ON);
gpio_pin_write(gpio_port, LED_2, LED_ON); gpio_pin_write(gpio_port, LED_2, LED_ON);
break; break;
case SYS_POWER_STATE_LOW_POWER_3: case SYS_POWER_STATE_SLEEP_3:
printk("--> Exited from SYS_POWER_STATE_LOW_POWER_3 state.\n"); printk("--> Exited from SYS_POWER_STATE_SLEEP_3 state.\n");
/* Perform exit from the low power state by turning on LEDs */ /* Perform exit from the low power state by turning on LEDs */
gpio_pin_write(gpio_port, LED_1, LED_ON); gpio_pin_write(gpio_port, LED_1, LED_ON);

View file

@ -1,7 +1,7 @@
config SOC_QUARK_SE_C1000_SS config SOC_QUARK_SE_C1000_SS
bool "Intel Quark SE C1000- Sensor Sub System" bool "Intel Quark SE C1000- Sensor Sub System"
select HAS_STATE_LOW_POWER_1 select HAS_STATE_SLEEP_1
select HAS_STATE_LOW_POWER_2 select HAS_STATE_SLEEP_2
select HAS_STATE_DEEP_SLEEP_1 select HAS_STATE_DEEP_SLEEP_1
select HAS_STATE_DEEP_SLEEP_2 select HAS_STATE_DEEP_SLEEP_2
select HAS_STATE_DEEP_SLEEP_3 select HAS_STATE_DEEP_SLEEP_3

View file

@ -42,11 +42,11 @@ static void _deep_sleep(enum power_states state)
void sys_set_power_state(enum power_states state) void sys_set_power_state(enum power_states state)
{ {
switch (state) { switch (state) {
#if (defined(CONFIG_SYS_POWER_LOW_POWER_STATES)) #if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
case SYS_POWER_STATE_LOW_POWER_1: case SYS_POWER_STATE_SLEEP_1:
qm_ss_power_cpu_ss1(QM_SS_POWER_CPU_SS1_TIMER_ON); qm_ss_power_cpu_ss1(QM_SS_POWER_CPU_SS1_TIMER_ON);
break; break;
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
qm_ss_power_cpu_ss2(); qm_ss_power_cpu_ss2();
break; break;
#endif #endif
@ -69,14 +69,14 @@ void sys_set_power_state(enum power_states state)
void sys_power_state_post_ops(enum power_states state) void sys_power_state_post_ops(enum power_states state)
{ {
switch (state) { switch (state) {
#if (defined(CONFIG_SYS_POWER_LOW_POWER_STATES)) #if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
{ {
/* Expire the timer as it is disabled in SS2. */ /* Expire the timer as it is disabled in SS2. */
u32_t limit = z_arc_v2_aux_reg_read(_ARC_V2_TMR0_LIMIT); u32_t limit = z_arc_v2_aux_reg_read(_ARC_V2_TMR0_LIMIT);
z_arc_v2_aux_reg_write(_ARC_V2_TMR0_COUNT, limit - 1); z_arc_v2_aux_reg_write(_ARC_V2_TMR0_COUNT, limit - 1);
} }
case SYS_POWER_STATE_LOW_POWER_1: case SYS_POWER_STATE_SLEEP_1:
__builtin_arc_seti(0); __builtin_arc_seti(0);
break; break;
#endif #endif

View file

@ -23,8 +23,8 @@ extern "C" {
/* /*
* Power state map: * Power state map:
* SYS_POWER_STATE_LOW_POWER_1: SS1 state with Timer ON * SYS_POWER_STATE_SLEEP_1: SS1 state with Timer ON
* SYS_POWER_STATE_LOW_POWER_2: SS1 state with Timer ON * SYS_POWER_STATE_SLEEP_2: SS1 state with Timer ON
* SYS_POWER_STATE_DEEP_SLEEP_1: SS2 with LPSS enabled state * SYS_POWER_STATE_DEEP_SLEEP_1: SS2 with LPSS enabled state
* SYS_POWER_STATE_DEEP_SLEEP_2: SLEEP state * SYS_POWER_STATE_DEEP_SLEEP_2: SLEEP state
* SYS_POWER_STATE_DEEP_SLEEP_3: SLEEP state with LPMODE enabled * SYS_POWER_STATE_DEEP_SLEEP_3: SLEEP state with LPMODE enabled

View file

@ -12,9 +12,9 @@ LOG_MODULE_DECLARE(soc, CONFIG_SOC_LOG_LEVEL);
/* /*
* Power state map: * Power state map:
* SYS_POWER_STATE_LOW_POWER_1: EM1 Sleep * SYS_POWER_STATE_SLEEP_1: EM1 Sleep
* SYS_POWER_STATE_LOW_POWER_2: EM2 Deep Sleep * SYS_POWER_STATE_SLEEP_2: EM2 Deep Sleep
* SYS_POWER_STATE_LOW_POWER_3: EM3 Stop * SYS_POWER_STATE_SLEEP_3: EM3 Stop
*/ */
/* Invoke Low Power/System Off specific Tasks */ /* Invoke Low Power/System Off specific Tasks */
@ -35,23 +35,23 @@ void sys_set_power_state(enum power_states state)
irq_unlock(0); irq_unlock(0);
switch (state) { switch (state) {
#ifdef CONFIG_SYS_POWER_LOW_POWER_STATES #ifdef CONFIG_SYS_POWER_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_LOW_POWER_1 #ifdef CONFIG_HAS_STATE_SLEEP_1
case SYS_POWER_STATE_LOW_POWER_1: case SYS_POWER_STATE_SLEEP_1:
EMU_EnterEM1(); EMU_EnterEM1();
break; break;
#endif /* CONFIG_HAS_STATE_LOW_POWER_1 */ #endif /* CONFIG_HAS_STATE_SLEEP_1 */
#ifdef CONFIG_HAS_STATE_LOW_POWER_2 #ifdef CONFIG_HAS_STATE_SLEEP_2
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
EMU_EnterEM2(true); EMU_EnterEM2(true);
break; break;
#endif /* CONFIG_HAS_STATE_LOW_POWER_2 */ #endif /* CONFIG_HAS_STATE_SLEEP_2 */
#ifdef CONFIG_HAS_STATE_LOW_POWER_3 #ifdef CONFIG_HAS_STATE_SLEEP_3
case SYS_POWER_STATE_LOW_POWER_3: case SYS_POWER_STATE_SLEEP_3:
EMU_EnterEM3(true); EMU_EnterEM3(true);
break; break;
#endif /* CONFIG_HAS_STATE_LOW_POWER_3 */ #endif /* CONFIG_HAS_STATE_SLEEP_3 */
#endif /* CONFIG_SYS_POWER_LOW_POWER_STATES */ #endif /* CONFIG_SYS_POWER_SLEEP_STATES */
default: default:
LOG_ERR("Unsupported power state %u", state); LOG_ERR("Unsupported power state %u", state);
break; break;

View file

@ -13,9 +13,9 @@ config SOC_SERIES_EFM32PG12B
select CPU_HAS_FPU select CPU_HAS_FPU
select SOC_FAMILY_EXX32 select SOC_FAMILY_EXX32
select CPU_HAS_SYSTICK select CPU_HAS_SYSTICK
select HAS_STATE_LOW_POWER_1 select HAS_STATE_SLEEP_1
select HAS_STATE_LOW_POWER_2 select HAS_STATE_SLEEP_2
select HAS_STATE_LOW_POWER_3 select HAS_STATE_SLEEP_3
select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
select SOC_GECKO_CMU select SOC_GECKO_CMU
select SOC_GECKO_EMU select SOC_GECKO_EMU

View file

@ -13,9 +13,9 @@ config SOC_SERIES_EFR32FG1P
select CPU_HAS_FPU select CPU_HAS_FPU
select SOC_FAMILY_EXX32 select SOC_FAMILY_EXX32
select CPU_HAS_SYSTICK select CPU_HAS_SYSTICK
select HAS_STATE_LOW_POWER_1 select HAS_STATE_SLEEP_1
select HAS_STATE_LOW_POWER_2 select HAS_STATE_SLEEP_2
select HAS_STATE_LOW_POWER_3 select HAS_STATE_SLEEP_3
select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
select SOC_GECKO_CMU select SOC_GECKO_CMU
select SOC_GECKO_GPIO select SOC_GECKO_GPIO

View file

@ -13,9 +13,9 @@ config SOC_SERIES_EFR32MG12P
select CPU_HAS_SYSTICK select CPU_HAS_SYSTICK
select HAS_SILABS_GECKO select HAS_SILABS_GECKO
select HAS_SWO select HAS_SWO
select HAS_STATE_LOW_POWER_1 select HAS_STATE_SLEEP_1
select HAS_STATE_LOW_POWER_2 select HAS_STATE_SLEEP_2
select HAS_STATE_LOW_POWER_3 select HAS_STATE_SLEEP_3
select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION select SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
select SOC_GECKO_CMU select SOC_GECKO_CMU
select SOC_GECKO_EMU select SOC_GECKO_EMU

View file

@ -11,9 +11,9 @@ config SOC_SERIES_QUARK_SE
select LOAPIC select LOAPIC
select LOAPIC_TIMER select LOAPIC_TIMER
select XIP select XIP
select HAS_STATE_LOW_POWER_1 select HAS_STATE_SLEEP_1
select HAS_STATE_LOW_POWER_2 select HAS_STATE_SLEEP_2
select HAS_STATE_LOW_POWER_3 select HAS_STATE_SLEEP_3
select HAS_STATE_DEEP_SLEEP_1 select HAS_STATE_DEEP_SLEEP_1
select HAS_STATE_DEEP_SLEEP_2 select HAS_STATE_DEEP_SLEEP_2
select BOOTLOADER_CONTEXT_RESTORE_SUPPORTED select BOOTLOADER_CONTEXT_RESTORE_SUPPORTED

View file

@ -60,14 +60,14 @@ static void _deep_sleep(enum power_states state)
void sys_set_power_state(enum power_states state) void sys_set_power_state(enum power_states state)
{ {
switch (state) { switch (state) {
#if (defined(CONFIG_SYS_POWER_LOW_POWER_STATES)) #if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
case SYS_POWER_STATE_LOW_POWER_1: case SYS_POWER_STATE_SLEEP_1:
qm_power_cpu_c1(); qm_power_cpu_c1();
break; break;
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
qm_power_cpu_c2(); qm_power_cpu_c2();
break; break;
case SYS_POWER_STATE_LOW_POWER_3: case SYS_POWER_STATE_SLEEP_3:
qm_power_cpu_c2lp(); qm_power_cpu_c2lp();
break; break;
#endif #endif
@ -85,11 +85,11 @@ void sys_set_power_state(enum power_states state)
void sys_power_state_post_ops(enum power_states state) void sys_power_state_post_ops(enum power_states state)
{ {
switch (state) { switch (state) {
#if (defined(CONFIG_SYS_POWER_LOW_POWER_STATES)) #if (defined(CONFIG_SYS_POWER_SLEEP_STATES))
case SYS_POWER_STATE_LOW_POWER_3: case SYS_POWER_STATE_SLEEP_3:
*_REG_TIMER_ICR = 1U; *_REG_TIMER_ICR = 1U;
case SYS_POWER_STATE_LOW_POWER_2: case SYS_POWER_STATE_SLEEP_2:
case SYS_POWER_STATE_LOW_POWER_1: case SYS_POWER_STATE_SLEEP_1:
__asm__ volatile("sti"); __asm__ volatile("sti");
break; break;
#endif #endif

View file

@ -23,9 +23,9 @@ extern "C" {
/* /*
* Power state map: * Power state map:
* SYS_POWER_STATE_LOW_POWER_1: C1 state * SYS_POWER_STATE_SLEEP_1: C1 state
* SYS_POWER_STATE_LOW_POWER_2: C2 state * SYS_POWER_STATE_SLEEP_2: C2 state
* SYS_POWER_STATE_LOW_POWER_3: C2LP state * SYS_POWER_STATE_SLEEP_3: C2LP state
* SYS_POWER_STATE_DEEP_SLEEP_1: SLEEP state * SYS_POWER_STATE_DEEP_SLEEP_1: SLEEP state
* SYS_POWER_STATE_DEEP_SLEEP_2: SLEEP state with LPMODE enabled * SYS_POWER_STATE_DEEP_SLEEP_2: SLEEP state with LPMODE enabled
*/ */

View file

@ -22,28 +22,28 @@ endchoice
if SYS_PM_POLICY_RESIDENCY if SYS_PM_POLICY_RESIDENCY
config SYS_PM_LPS_1_MIN_RES config SYS_PM_SLEEP_1_MIN_RES
int "Low Power State 1 minimum residency" int "Sleep State 1 minimum residency"
depends on HAS_STATE_LOW_POWER_1 depends on HAS_STATE_SLEEP_1
default 5000 default 5000
help help
Minimum residency in milliseconds to enter SYS_POWER_STATE_LOW_POWER_1 Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_1
state. state.
config SYS_PM_LPS_2_MIN_RES config SYS_PM_SLEEP_2_MIN_RES
int "Low Power State 2 minimum residency" int "Sleep State 2 minimum residency"
depends on HAS_STATE_LOW_POWER_2 depends on HAS_STATE_SLEEP_2
default 10000 default 10000
help help
Minimum residency in milliseconds to enter SYS_POWER_STATE_LOW_POWER_2 Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_2
state. state.
config SYS_PM_LPS_3_MIN_RES config SYS_PM_SLEEP_3_MIN_RES
int "Low Power State 3 minimum residency" int "Sleep State 3 minimum residency"
depends on HAS_STATE_LOW_POWER_3 depends on HAS_STATE_SLEEP_3
default 30000 default 30000
help help
Minimum residency in milliseconds to enter SYS_POWER_STATE_LOW_POWER_3 Minimum residency in milliseconds to enter SYS_POWER_STATE_SLEEP_3
state. state.
config SYS_PM_DEEP_SLEEP_1_MIN_RES config SYS_PM_DEEP_SLEEP_1_MIN_RES

View file

@ -16,19 +16,19 @@ LOG_MODULE_DECLARE(power);
/* PM Policy based on SoC/Platform residency requirements */ /* PM Policy based on SoC/Platform residency requirements */
static const unsigned int pm_min_residency[] = { static const unsigned int pm_min_residency[] = {
#ifdef CONFIG_SYS_POWER_LOW_POWER_STATES #ifdef CONFIG_SYS_POWER_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_LOW_POWER_1 #ifdef CONFIG_HAS_STATE_SLEEP_1
CONFIG_SYS_PM_LPS_1_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC, CONFIG_SYS_PM_SLEEP_1_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif #endif
#ifdef CONFIG_HAS_STATE_LOW_POWER_2 #ifdef CONFIG_HAS_STATE_SLEEP_2
CONFIG_SYS_PM_LPS_2_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC, CONFIG_SYS_PM_SLEEP_2_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif #endif
#ifdef CONFIG_HAS_STATE_LOW_POWER_3 #ifdef CONFIG_HAS_STATE_SLEEP_3
CONFIG_SYS_PM_LPS_3_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC, CONFIG_SYS_PM_SLEEP_3_MIN_RES * SECS_TO_TICKS / MSEC_PER_SEC,
#endif #endif
#endif /* CONFIG_SYS_POWER_LOW_POWER_STATES */ #endif /* CONFIG_SYS_POWER_SLEEP_STATES */
#ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES #ifdef CONFIG_SYS_POWER_DEEP_SLEEP_STATES
#ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1 #ifdef CONFIG_HAS_STATE_DEEP_SLEEP_1

View file

@ -1,7 +1,7 @@
config KERNEL_PROFILING_API_TEST config KERNEL_PROFILING_API_TEST
bool bool
default y default y
select HAS_STATE_LOW_POWER_1 select HAS_STATE_SLEEP_1
help help
Hidden option enabling LPS_0 power state regardless of hardware Hidden option enabling LPS_0 power state regardless of hardware
support. This ensures that power management hooks used in this support. This ensures that power management hooks used in this

View file

@ -7,7 +7,7 @@ CONFIG_TEST_HW_STACK_PROTECTION=n
# to check idle thread # to check idle thread
CONFIG_SYS_POWER_MANAGEMENT=y CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_LOW_POWER_STATES=y CONFIG_SYS_POWER_SLEEP_STATES=y
CONFIG_SYS_PM_POLICY_APP=y CONFIG_SYS_PM_POLICY_APP=y
CONFIG_IDLE_STACK_SIZE=768 CONFIG_IDLE_STACK_SIZE=768