From 3b75a08e3ff7e480250f42b2d650937660983c7c Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 22 Aug 2020 12:58:49 -0400 Subject: [PATCH] Kconfig: move power management Kconfig into subsys/power Consolidate all PM related Kconfigs in one place. Signed-off-by: Anas Nashif --- kernel/Kconfig | 2 -- kernel/Kconfig.power_mgmt | 54 ------------------------------------ subsys/Kconfig | 2 ++ subsys/power/Kconfig | 58 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 56 deletions(-) delete mode 100644 kernel/Kconfig.power_mgmt diff --git a/kernel/Kconfig b/kernel/Kconfig index 5a0e862d683..2870d8cc948 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -794,6 +794,4 @@ config TICKLESS_KERNEL This option enables a fully event driven kernel. Periodic system clock interrupt generation would be stopped at all times. -source "kernel/Kconfig.power_mgmt" - endmenu diff --git a/kernel/Kconfig.power_mgmt b/kernel/Kconfig.power_mgmt deleted file mode 100644 index 3a2f133ae7f..00000000000 --- a/kernel/Kconfig.power_mgmt +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2014-2015 Wind River Systems, Inc. -# Copyright (c) 2016 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -menuconfig SYS_POWER_MANAGEMENT - bool "System Power management" - select TICKLESS_IDLE - help - This option enables the board to implement extra power management - policies whenever the kernel becomes idle. The kernel informs the - power management subsystem of the number of ticks until the next kernel - timer is due to expire. - -if SYS_POWER_MANAGEMENT -config SYS_POWER_SLEEP_STATES - bool "Low Power states" - depends on HAS_SYS_POWER_STATE_SLEEP_1 || \ - HAS_SYS_POWER_STATE_SLEEP_2 || \ - HAS_SYS_POWER_STATE_SLEEP_3 - help - This option enables the kernel to interface with a power manager - application. This permits the system to enter a custom CPU low power - state when the kernel becomes idle. The low power state could be any of - the CPU low power states supported by the processor. Generally the one - saving most power. - -config SYS_POWER_DEEP_SLEEP_STATES - bool "Deep Sleep states" - depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_1 || \ - HAS_SYS_POWER_STATE_DEEP_SLEEP_2 || \ - HAS_SYS_POWER_STATE_DEEP_SLEEP_3 - help - This option enables the kernel to interface with a power manager - application. This permits the system to enter a Deep sleep state - supported by the SOC where the system clock is turned off while RAM is - retained. This state would be entered when the kernel becomes idle for - extended periods and would have a high wake latency. Resume would be - from the reset vector same as cold boot. The interface allows - restoration of states that were saved at the time of suspend. - -source "subsys/power/Kconfig" - -endif # SYS_POWER_MANAGEMENT - -config DEVICE_POWER_MANAGEMENT - bool "Device power management" - help - This option enables the device power management interface. The - interface consists of hook functions implemented by device drivers - that get called by the power manager application when the system - is going to suspend state or resuming from suspend state. This allows - device drivers to do any necessary power management operations - like turning off device clocks and peripherals. The device drivers - may also save and restore states in these hook functions. diff --git a/subsys/Kconfig b/subsys/Kconfig index df722d6db84..8bd92165d17 100644 --- a/subsys/Kconfig +++ b/subsys/Kconfig @@ -23,6 +23,8 @@ source "subsys/mgmt/Kconfig" source "subsys/net/Kconfig" +source "subsys/power/Kconfig" + source "subsys/shell/Kconfig" source "subsys/usb/Kconfig" diff --git a/subsys/power/Kconfig b/subsys/power/Kconfig index c5df0744941..ae255f6778f 100644 --- a/subsys/power/Kconfig +++ b/subsys/power/Kconfig @@ -1,5 +1,46 @@ +# Copyright (c) 2014-2015 Wind River Systems, Inc. +# Copyright (c) 2016 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +menu "Power Management" + +menuconfig SYS_POWER_MANAGEMENT + bool "System Power management" + select TICKLESS_IDLE + help + This option enables the board to implement extra power management + policies whenever the kernel becomes idle. The kernel informs the + power management subsystem of the number of ticks until the next kernel + timer is due to expire. + +if SYS_POWER_MANAGEMENT +config SYS_POWER_SLEEP_STATES + bool "Low Power states" + depends on HAS_SYS_POWER_STATE_SLEEP_1 || \ + HAS_SYS_POWER_STATE_SLEEP_2 || \ + HAS_SYS_POWER_STATE_SLEEP_3 + help + This option enables the kernel to interface with a power manager + application. This permits the system to enter a custom CPU low power + state when the kernel becomes idle. The low power state could be any of + the CPU low power states supported by the processor. Generally the one + saving most power. + +config SYS_POWER_DEEP_SLEEP_STATES + bool "Deep Sleep states" + depends on HAS_SYS_POWER_STATE_DEEP_SLEEP_1 || \ + HAS_SYS_POWER_STATE_DEEP_SLEEP_2 || \ + HAS_SYS_POWER_STATE_DEEP_SLEEP_3 + help + This option enables the kernel to interface with a power manager + application. This permits the system to enter a Deep sleep state + supported by the SOC where the system clock is turned off while RAM is + retained. This state would be entered when the kernel becomes idle for + extended periods and would have a high wake latency. Resume would be + from the reset vector same as cold boot. The interface allows + restoration of states that were saved at the time of suspend. + + config SYS_PM_STATE_LOCK bool "Enable Power State locking capability" help @@ -36,3 +77,20 @@ source "subsys/power/policy/Kconfig" module = SYS_PM module-str = System Power Management source "subsys/logging/Kconfig.template.log_config" + + +endif # SYS_POWER_MANAGEMENT + +config DEVICE_POWER_MANAGEMENT + bool "Device power management" + help + This option enables the device power management interface. The + interface consists of hook functions implemented by device drivers + that get called by the power manager application when the system + is going to suspend state or resuming from suspend state. This allows + device drivers to do any necessary power management operations + like turning off device clocks and peripherals. The device drivers + may also save and restore states in these hook functions. + + +endmenu