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/mailbox_controller.h>
19 #include <linux/mailbox_client.h>
20 #include <linux/types.h>
22 #include <acpi/processor.h>
24 /* Only support CPPCv2 for now. */
25 #define CPPC_NUM_ENT 21
28 #define PCC_CMD_COMPLETE 1
29 #define MAX_CPC_REG_ENT 19
31 /* CPPC specific PCC commands. */
35 /* Each register has the folowing format. */
47 * Each entry in the CPC table is either
48 * of type ACPI_TYPE_BUFFER or
51 struct cpc_register_resource
{
52 acpi_object_type type
;
59 /* Container to hold the CPC details for each CPU */
64 struct cpc_register_resource cpc_regs
[MAX_CPC_REG_ENT
];
65 struct acpi_psd_package domain_info
;
68 /* These are indexes into the per-cpu cpc_regs[]. Order is important. */
92 * Categorization of registers as described
93 * in the ACPI v.5.1 spec.
94 * XXX: Only filling up ones which are used by governors
97 struct cppc_perf_caps
{
104 struct cppc_perf_ctrls
{
110 struct cppc_perf_fb_ctrs
{
117 /* Per CPU container for runtime CPPC management. */
120 struct cppc_perf_caps perf_caps
;
121 struct cppc_perf_ctrls perf_ctrls
;
122 struct cppc_perf_fb_ctrs perf_fb_ctrs
;
123 struct cpufreq_policy
*cur_policy
;
124 unsigned int shared_type
;
125 cpumask_var_t shared_cpu_map
;
128 extern int cppc_get_perf_ctrs(int cpu
, struct cppc_perf_fb_ctrs
*perf_fb_ctrs
);
129 extern int cppc_set_perf(int cpu
, struct cppc_perf_ctrls
*perf_ctrls
);
130 extern int cppc_get_perf_caps(int cpu
, struct cppc_perf_caps
*caps
);
131 extern int acpi_get_psd_map(struct cpudata
**);
133 /* Methods to interact with the PCC mailbox controller. */
134 extern struct mbox_chan
*
135 pcc_mbox_request_channel(struct mbox_client
*, unsigned int);
137 #endif /* _CPPC_ACPI_H*/