1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/include/linux/amd-pstate.h
5 * Copyright (C) 2022 Advanced Micro Devices, Inc.
10 #ifndef _LINUX_AMD_PSTATE_H
11 #define _LINUX_AMD_PSTATE_H
13 #include <linux/pm_qos.h>
15 /*********************************************************************
16 * AMD P-state INTERFACE *
17 *********************************************************************/
19 * struct amd_aperf_mperf
20 * @aperf: actual performance frequency clock count
21 * @mperf: maximum performance frequency clock count
22 * @tsc: time stamp counter
24 struct amd_aperf_mperf {
31 * struct amd_cpudata - private CPU data for AMD P-State
33 * @req: constraint request to apply
34 * @cppc_req_cached: cached performance request hints
35 * @highest_perf: the maximum performance an individual processor may reach,
36 * assuming ideal conditions
37 * @nominal_perf: the maximum sustained performance level of the processor,
38 * assuming ideal operating conditions
39 * @lowest_nonlinear_perf: the lowest performance level at which nonlinear power
40 * savings are achieved
41 * @lowest_perf: the absolute lowest performance level of the processor
42 * @max_freq: the frequency that mapped to highest_perf
43 * @min_freq: the frequency that mapped to lowest_perf
44 * @nominal_freq: the frequency that mapped to nominal_perf
45 * @lowest_nonlinear_freq: the frequency that mapped to lowest_nonlinear_perf
46 * @cur: Difference of Aperf/Mperf/tsc count between last and current sample
47 * @prev: Last Aperf/Mperf/tsc count value read from register
48 * @freq: current cpu frequency value
49 * @boost_supported: check whether the Processor or SBIOS supports boost mode
51 * The amd_cpudata is key private data for each CPU thread in AMD P-State, and
52 * represents all the attributes and goals that AMD P-State requests at runtime.
57 struct freq_qos_request req[2];
62 u32 lowest_nonlinear_perf;
68 u32 lowest_nonlinear_freq;
70 struct amd_aperf_mperf cur;
71 struct amd_aperf_mperf prev;
77 #endif /* _LINUX_AMD_PSTATE_H */