2020-08-22 12:58:49 -04:00
|
|
|
# Copyright (c) 2014-2015 Wind River Systems, Inc.
|
|
|
|
# Copyright (c) 2016 Intel Corporation
|
2019-04-06 09:08:09 -04:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2020-08-22 12:58:49 -04:00
|
|
|
menu "Power Management"
|
|
|
|
|
2023-07-18 10:40:27 +02:00
|
|
|
config HAS_PM
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
This option must be selected by SoCs that provide PM hooks, that is,
|
|
|
|
calls to configure low-power states.
|
|
|
|
|
|
|
|
config PM
|
2021-03-12 13:13:22 -05:00
|
|
|
bool "System Power Management"
|
2023-07-18 10:40:27 +02:00
|
|
|
depends on SYS_CLOCK_EXISTS && HAS_PM
|
2020-08-22 12:58:49 -04:00
|
|
|
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.
|
|
|
|
|
2024-10-22 16:00:54 +02:00
|
|
|
rsource "policy/Kconfig"
|
|
|
|
|
2020-09-01 18:31:40 -04:00
|
|
|
if PM
|
2020-08-22 12:58:49 -04:00
|
|
|
|
2021-10-27 13:39:12 +02:00
|
|
|
module = PM
|
|
|
|
module-str = System Power Management
|
|
|
|
source "subsys/logging/Kconfig.template.log_config"
|
|
|
|
|
2021-10-12 08:52:30 -05:00
|
|
|
config PM_STATS
|
|
|
|
bool "System Power Management Stats"
|
|
|
|
depends on STATS
|
2018-10-24 13:54:20 +05:30
|
|
|
help
|
2021-10-12 08:52:30 -05:00
|
|
|
Enable System Power Management Stats.
|
2018-10-24 13:54:20 +05:30
|
|
|
|
2022-05-04 14:25:59 +02:00
|
|
|
config PM_S2RAM
|
|
|
|
bool "Suspend-to-RAM (S2RAM)"
|
|
|
|
depends on ARCH_HAS_SUSPEND_TO_RAM
|
|
|
|
help
|
|
|
|
This option enables suspend-to-RAM (S2RAM).
|
|
|
|
|
2024-02-12 11:56:20 +01:00
|
|
|
config PM_S2RAM_CUSTOM_MARKING
|
|
|
|
bool "Use custom marking functions"
|
|
|
|
depends on PM_S2RAM
|
|
|
|
help
|
|
|
|
By default a magic word in RAM is used to mark entering suspend-to-RAM. Enabling
|
2024-05-21 18:31:36 +02:00
|
|
|
this option allows custom implementation of functions which handle the marking.
|
2024-02-12 11:56:20 +01:00
|
|
|
|
2023-08-22 16:42:51 +08:00
|
|
|
config PM_NEED_ALL_DEVICES_IDLE
|
|
|
|
bool "System Low Power Mode Needs All Devices Idle"
|
|
|
|
depends on PM_DEVICE && !SMP
|
|
|
|
help
|
|
|
|
When this option is enabled, check that no devices are busy before
|
|
|
|
entering into system low power mode.
|
|
|
|
|
2025-04-03 14:50:27 +02:00
|
|
|
choice PM_PREWAKEUP_CONV_MODE
|
|
|
|
prompt "Pre-wakeup microseconds to ticks conversion method"
|
|
|
|
default PM_PREWAKEUP_CONV_MODE_NEAR
|
|
|
|
help
|
|
|
|
Exit latency for each power state is given in microseconds. It is converted
|
|
|
|
to ticks and system clock is set to wake up the core earlier before scheduled
|
|
|
|
wake up. This option specifies rounding that is used when converting exit
|
|
|
|
latency from microseconds to system ticks.
|
|
|
|
|
|
|
|
config PM_PREWAKEUP_CONV_MODE_NEAR
|
|
|
|
bool "Nearest"
|
|
|
|
|
|
|
|
config PM_PREWAKEUP_CONV_MODE_CEIL
|
|
|
|
bool "Round up"
|
|
|
|
|
|
|
|
config PM_PREWAKEUP_CONV_MODE_FLOOR
|
|
|
|
bool "Round down"
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2020-09-01 18:31:40 -04:00
|
|
|
endif # PM
|
2020-08-22 12:58:49 -04:00
|
|
|
|
2020-09-01 18:31:40 -04:00
|
|
|
config PM_DEVICE
|
2021-10-27 13:48:50 +02:00
|
|
|
bool "Device Power Management"
|
2020-08-22 12:58:49 -04:00
|
|
|
help
|
|
|
|
This option enables the device power management interface. The
|
2024-01-16 15:17:02 -08:00
|
|
|
interface implemented by device drivers are called by the power
|
|
|
|
management subsystem. This allows device drivers to do any
|
|
|
|
necessary power management operations like turning off
|
|
|
|
device clocks and peripherals. Device drivers may also save
|
|
|
|
and restore states in these hook functions.
|
2020-08-22 12:58:49 -04:00
|
|
|
|
2021-10-27 13:39:12 +02:00
|
|
|
if PM_DEVICE
|
|
|
|
|
|
|
|
module = PM_DEVICE
|
|
|
|
module-str = Device Power Management
|
|
|
|
source "subsys/logging/Kconfig.template.log_config"
|
|
|
|
|
2021-11-29 15:50:12 -08:00
|
|
|
config PM_DEVICE_POWER_DOMAIN
|
2022-03-09 12:05:12 +01:00
|
|
|
bool "Power domain"
|
2021-11-29 15:50:12 -08:00
|
|
|
depends on PM_DEVICE
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enable support for Power Domain. With power domain enabled,
|
|
|
|
devices that depend on a domain will be notified when this
|
|
|
|
domain is suspended or resumed.
|
|
|
|
|
2022-01-05 17:19:53 -08:00
|
|
|
config PM_DEVICE_POWER_DOMAIN_DYNAMIC
|
2024-06-17 12:33:53 +02:00
|
|
|
bool "Dynamically bind devices to a Power Domain"
|
2023-06-14 17:04:52 +02:00
|
|
|
depends on PM_DEVICE_POWER_DOMAIN && DEVICE_DEPS_DYNAMIC
|
2022-01-05 17:19:53 -08:00
|
|
|
help
|
|
|
|
Enable support for dynamically bind devices to a Power Domain.
|
|
|
|
|
|
|
|
config PM_DEVICE_POWER_DOMAIN_DYNAMIC_NUM
|
|
|
|
int "Number of devices that can dynamically be bind to a Power Domain"
|
|
|
|
depends on PM_DEVICE_POWER_DOMAIN_DYNAMIC
|
|
|
|
default 1
|
|
|
|
help
|
|
|
|
The number of devices that can dynamically be bind to a Power Domain.
|
|
|
|
|
2021-04-29 14:12:11 +02:00
|
|
|
config PM_DEVICE_RUNTIME
|
|
|
|
bool "Runtime Device Power Management"
|
2022-12-06 17:44:24 +01:00
|
|
|
select EVENTS
|
2020-09-04 13:45:32 -04:00
|
|
|
help
|
2021-04-29 14:12:11 +02:00
|
|
|
Enable Runtime Power Management to save power. With device runtime PM
|
|
|
|
enabled, devices can be suspended or resumed based on the device
|
|
|
|
usage even while the CPU or system is running.
|
2021-10-27 13:39:12 +02:00
|
|
|
|
2025-03-21 13:05:35 -07:00
|
|
|
if PM_DEVICE_RUNTIME
|
|
|
|
|
|
|
|
config PM_DEVICE_DRIVER_NEEDS_DEDICATED_WQ
|
|
|
|
bool
|
|
|
|
|
2025-03-28 22:52:43 -07:00
|
|
|
config PM_DEVICE_RUNTIME_ASYNC
|
|
|
|
bool "Asynchronous device runtime power management"
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Use this option to enable support for asynchronous operation
|
|
|
|
in the power management device runtime.
|
|
|
|
|
|
|
|
if PM_DEVICE_RUNTIME_ASYNC
|
|
|
|
|
2025-03-21 13:05:35 -07:00
|
|
|
choice PM_DEVICE_RUNTIME_WQ
|
|
|
|
prompt "Work queue to be used by pm device runtime async"
|
|
|
|
default PM_DEVICE_RUNTIME_USE_DEDICATED_WQ if PM_DEVICE_DRIVER_NEEDS_DEDICATED_WQ
|
|
|
|
default PM_DEVICE_RUNTIME_USE_SYSTEM_WQ
|
|
|
|
|
|
|
|
config PM_DEVICE_RUNTIME_USE_SYSTEM_WQ
|
|
|
|
bool "Use the system workqueue"
|
|
|
|
help
|
|
|
|
When this option is enabled the power management subsystem will
|
|
|
|
use the system worqueue instead of defining its own queue.
|
|
|
|
|
|
|
|
config PM_DEVICE_RUNTIME_USE_DEDICATED_WQ
|
|
|
|
bool "Use a dedicated workqueue"
|
|
|
|
help
|
|
|
|
When this option is enabled the power management subsystem will
|
|
|
|
use a dedicated worqueue instead of the system work queue.
|
|
|
|
|
|
|
|
if PM_DEVICE_RUNTIME_USE_DEDICATED_WQ
|
|
|
|
config PM_DEVICE_RUNTIME_DEDICATED_WQ_STACK_SIZE
|
|
|
|
int "Stack size for pm runtime async workqueue"
|
|
|
|
default 1024
|
|
|
|
help
|
|
|
|
Defines the size of the stack on the workqueue used for
|
|
|
|
async operations.
|
|
|
|
|
|
|
|
config PM_DEVICE_RUNTIME_DEDICATED_WQ_PRIO
|
|
|
|
int "PM device runtime workqueue priority. Should be pre-emptible."
|
|
|
|
default SYSTEM_WORKQUEUE_PRIORITY if PM_DEVICE_RUNTIME_USE_SYSTEM_WQ
|
|
|
|
default 0
|
|
|
|
|
|
|
|
config PM_DEVICE_RUNTIME_DEDICATED_WQ_INIT_PRIO
|
|
|
|
int "PM device runtime workqueue init priority"
|
|
|
|
default 50
|
|
|
|
help
|
|
|
|
Init priority level to setup the device runtime workqueue.
|
|
|
|
endif #PM_DEVICE_RUNTIME_USE_DEDICATED_WQ
|
|
|
|
endchoice
|
|
|
|
|
2025-03-28 22:52:43 -07:00
|
|
|
endif # PM_DEVICE_RUNTIME_ASYNC
|
2025-03-21 13:05:35 -07:00
|
|
|
endif # PM_DEVICE_RUNTIME
|
|
|
|
|
2024-04-22 20:42:40 +01:00
|
|
|
config PM_DEVICE_SHELL
|
|
|
|
bool "Device Power Management shell"
|
|
|
|
depends on SHELL
|
|
|
|
help
|
|
|
|
Enable the device power management shell, for triggering device power
|
|
|
|
management events through the shell interface.
|
|
|
|
|
2024-01-16 15:17:02 -08:00
|
|
|
config PM_DEVICE_SYSTEM_MANAGED
|
|
|
|
bool "System-Managed Device Power Management"
|
2025-01-28 17:08:26 -08:00
|
|
|
default y if !PM_DEVICE_RUNTIME
|
2024-01-16 15:17:02 -08:00
|
|
|
help
|
|
|
|
This option enables the system-managed device power
|
|
|
|
management. The power management subsystem will suspend
|
|
|
|
devices before entering a low power state. Conversely, after
|
|
|
|
the core wakes up from low power mode all suspended devices
|
|
|
|
are resumed.
|
|
|
|
|
|
|
|
|
2021-10-27 13:39:12 +02:00
|
|
|
endif # PM_DEVICE
|
|
|
|
|
2020-08-22 12:58:49 -04:00
|
|
|
endmenu
|