Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pstate.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Analog Devices, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_SUBSYS_CPU_FREQ_PSTATE_H_
14#define ZEPHYR_SUBSYS_CPU_FREQ_PSTATE_H_
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#include <zephyr/types.h>
21#include <zephyr/devicetree.h>
23
32
34#define PSTATE_DT_SYM(_node) _CONCAT(__pstate_, DT_DEP_ORD(_node))
35
42#define PSTATE_DT_DEFINE(_node, _config) \
43 const struct pstate PSTATE_DT_SYM(_node) = { \
44 .load_threshold = DT_PROP(_node, load_threshold), \
45 .config = _config, \
46 };
47
55#define PSTATE_DT_GET(_node) &PSTATE_DT_SYM(_node)
56
57
64struct pstate {
66 const void *config;
67};
68
69/* Define performance-states as extern to be picked up by CPU Freq policy */
70#define Z_DECLARE_PSTATE_EXTERN(_node) \
71 extern const struct pstate PSTATE_DT_SYM(_node);
72
73DT_FOREACH_CHILD_STATUS_OKAY(DT_PATH(performance_states), Z_DECLARE_PSTATE_EXTERN)
74
75
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif /* ZEPHYR_SUBSYS_CPU_FREQ_PSTATE_H_ */
Devicetree main header.
#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn)
Call fn on the child nodes with status okay.
Definition devicetree.h:3503
#define DT_PATH(...)
Get a node identifier for a devicetree path.
Definition devicetree.h:141
Header file for CPU frequency scaling performance state (P-state).
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
CPU performance state (pstate) struct.
Definition pstate.h:64
const void * config
Vendor specific devicetree properties.
Definition pstate.h:66
uint8_t load_threshold
CPU load threshold at which P-state should be triggered.
Definition pstate.h:65