Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions dts/bindings/power/zephyr,power-state.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) 2020, Intel Corporation
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

description: Properties for power management state
description: |
Properties for power management idle states.

compatible: "zephyr,power-state"

Expand All @@ -24,9 +26,13 @@ properties:
min-residency-us:
type: int
description: |
Minimum residency duration in microseconds. It is the minimum time for a
given idle state to be worthwhile energywise. It includes the time to enter
in this state.
Minimum residency duration in microseconds.

How much time the residency in a given idle state must last for state entry
to be worthwhile energywise. It includes the time to enter into this state
and represents the "break-even" time to justify the time and power spent
on the work needed for entering and exiting the state based on how much actual energy
is saved once in the state, compared to choosing the next shallowest state.
exit-latency-us:
type: int
description: |
Expand Down
28 changes: 0 additions & 28 deletions subsys/pm/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,6 @@
BUILD_ASSERT(DT_NODE_EXISTS(DT_PATH(cpus)),
"cpus node not defined in Devicetree");

/**
* Check CPU power state consistency.
*
* @param i Power state index.
* @param node_id CPU node identifier.
*/
#define CHECK_POWER_STATE_CONSISTENCY(i, node_id) \
BUILD_ASSERT( \
DT_PROP_BY_PHANDLE_IDX_OR(node_id, cpu_power_states, i, \
min_residency_us, 0U) >= \
DT_PROP_BY_PHANDLE_IDX_OR(node_id, cpu_power_states, i, \
exit_latency_us, 0U), \
"Found CPU power state with min_residency < exit_latency")

/**
* @brief Check CPU power states consistency
*
* All states should have a minimum residency >= than the exit latency.
*
* @param node_id A CPU node identifier.
*/
#define CHECK_POWER_STATES_CONSISTENCY(node_id) \
LISTIFY(DT_PROP_LEN_OR(node_id, cpu_power_states, 0), \
CHECK_POWER_STATE_CONSISTENCY, (;), node_id); \

/* Check that all power states are consistent */
DT_FOREACH_CHILD(DT_PATH(cpus), CHECK_POWER_STATES_CONSISTENCY)

#define DEFINE_CPU_STATES(n) \
static const struct pm_state_info pmstates_##n[] \
= PM_STATE_INFO_LIST_FROM_DT_CPU(n);
Expand Down