2 * CPPC (Collaborative Processor Performance Control) methods used
5 * (C) Copyright 2014, 2015 Linaro Ltd.
6 * Author: Ashwin Chaugule <ashwin.chaugule@linaro.org>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; version 2
17 #include <linux/acpi.h>
18 #include <linux/types.h>
21 #include <acpi/processor.h>
23 /* Only support CPPCv2 for now. */
24 #define CPPC_NUM_ENT 21
27 #define PCC_CMD_COMPLETE 1
28 #define MAX_CPC_REG_ENT 19
30 /* CPPC specific PCC commands. */
34 /* Each register has the folowing format. */
46 * Each entry in the CPC table is either
47 * of type ACPI_TYPE_BUFFER or
50 struct cpc_register_resource {
51 acpi_object_type type;
58 /* Container to hold the CPC details for each CPU */
63 struct cpc_register_resource cpc_regs[MAX_CPC_REG_ENT];
64 struct acpi_psd_package domain_info;
67 /* These are indexes into the per-cpu cpc_regs[]. Order is important. */
91 * Categorization of registers as described
92 * in the ACPI v.5.1 spec.
93 * XXX: Only filling up ones which are used by governors
96 struct cppc_perf_caps {
103 struct cppc_perf_ctrls {
109 struct cppc_perf_fb_ctrs {
116 /* Per CPU container for runtime CPPC management. */
119 struct cppc_perf_caps perf_caps;
120 struct cppc_perf_ctrls perf_ctrls;
121 struct cppc_perf_fb_ctrs perf_fb_ctrs;
122 struct cpufreq_policy *cur_policy;
123 unsigned int shared_type;
124 cpumask_var_t shared_cpu_map;
127 extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs);
128 extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
129 extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
130 extern int acpi_get_psd_map(struct cpudata **);
132 #endif /* _CPPC_ACPI_H*/