| # Copyright (c) 2014-2015 Wind River Systems, Inc. |
| # Copyright (c) 2016 Intel Corporation |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| menu "Power Management" |
| |
| 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 HAS_PM_S2RAM_CUSTOM_MARKING |
| bool |
| depends on HAS_PM |
| help |
| By default a magic word in RAM is used to mark entering suspend-to-RAM. If this |
| option is selected, a custom implementation of functions which handle the marking |
| must be provided. |
| |
| config PM |
| bool "System Power Management" |
| depends on SYS_CLOCK_EXISTS && HAS_PM |
| 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. |
| |
| rsource "policy/Kconfig" |
| |
| if PM |
| |
| module = PM |
| module-str = System Power Management |
| source "subsys/logging/Kconfig.template.log_config" |
| |
| config PM_STATS |
| bool "System Power Management Stats" |
| depends on STATS |
| help |
| Enable System Power Management Stats. |
| |
| DT_POWER_STATE_COMPAT := zephyr,power-state |
| |
| config PM_S2RAM |
| bool |
| default y |
| depends on ARCH_HAS_SUSPEND_TO_RAM |
| depends on $(dt_compat_any_has_prop,$(DT_POWER_STATE_COMPAT),power-state-name,suspend-to-ram) |
| help |
| This option enables the SoC specific implementations of suspend-to-ram (S2RAM) |
| sleep states if PM is enabled and one or more suspend-to-ram sleep states are |
| enabled in the devicetree. |
| |
| 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. |
| |
| 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 |
| |
| endif # PM |
| |
| config PM_DEVICE |
| bool "Device Power Management" |
| help |
| This option enables the device power management interface. The |
| 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. |
| |
| if PM_DEVICE |
| |
| module = PM_DEVICE |
| module-str = Device Power Management |
| source "subsys/logging/Kconfig.template.log_config" |
| |
| config PM_DEVICE_POWER_DOMAIN |
| bool "Power domain" |
| 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. |
| |
| config PM_DEVICE_POWER_DOMAIN_DYNAMIC |
| bool "Dynamically bind devices to a Power Domain" |
| depends on PM_DEVICE_POWER_DOMAIN && DEVICE_DEPS_DYNAMIC |
| 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. |
| |
| config PM_DEVICE_RUNTIME |
| bool "Runtime Device Power Management" |
| help |
| 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. |
| |
| if PM_DEVICE_RUNTIME |
| |
| config PM_DEVICE_DRIVER_NEEDS_DEDICATED_WQ |
| bool |
| |
| config PM_DEVICE_RUNTIME_ASYNC |
| bool "Asynchronous device runtime power management" |
| select EVENTS |
| default y |
| help |
| Use this option to enable support for asynchronous operation |
| in the power management device runtime. |
| |
| if PM_DEVICE_RUNTIME_ASYNC |
| |
| 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 workqueue 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 workqueue 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 |
| |
| endif # PM_DEVICE_RUNTIME_ASYNC |
| |
| config PM_DEVICE_RUNTIME_DEFAULT_ENABLE |
| bool "PM device runtime enable by default" |
| help |
| Enable PM device runtime by default for all devices when they are |
| initialized. This option is identical to adding the devicetree |
| property zephyr,pm-device-runtime-auto to all nodes in the |
| devicetree. |
| |
| endif # PM_DEVICE_RUNTIME |
| |
| 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. |
| |
| config PM_DEVICE_SYSTEM_MANAGED |
| bool "System-Managed Device Power Management" |
| default y if !PM_DEVICE_RUNTIME |
| 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. |
| |
| |
| endif # PM_DEVICE |
| |
| config PM_CPU_SHELL |
| bool "CPU Power Management shell" |
| depends on SHELL |
| help |
| Enable the cpu power management shell, for triggering cpu power |
| management events through the shell interface. |
| The shell allows: |
| - listing supported CPU low power states from devicetree; |
| - checking whether states are currently available; |
| - idling the shell thread so the system naturally enters low power; |
| |
| endmenu |