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_MASK (1 << 0)
28 #define PCC_ERROR_MASK (1 << 2)
30 #define MAX_CPC_REG_ENT 19
32 /* CPPC specific PCC commands. */
36 /* Each register has the folowing format. */
48 * Each entry in the CPC table is either
49 * of type ACPI_TYPE_BUFFER or
52 struct cpc_register_resource
{
53 acpi_object_type type
;
54 u64 __iomem
*sys_mem_vaddr
;
61 /* Container to hold the CPC details for each CPU */
68 struct cpc_register_resource cpc_regs
[MAX_CPC_REG_ENT
];
69 struct acpi_psd_package domain_info
;
73 /* These are indexes into the per-cpu cpc_regs[]. Order is important. */
97 * Categorization of registers as described
98 * in the ACPI v.5.1 spec.
99 * XXX: Only filling up ones which are used by governors
102 struct cppc_perf_caps
{
106 u32 lowest_nonlinear_perf
;
109 struct cppc_perf_ctrls
{
115 struct cppc_perf_fb_ctrs
{
122 /* Per CPU container for runtime CPPC management. */
123 struct cppc_cpudata
{
125 struct cppc_perf_caps perf_caps
;
126 struct cppc_perf_ctrls perf_ctrls
;
127 struct cppc_perf_fb_ctrs perf_fb_ctrs
;
128 struct cpufreq_policy
*cur_policy
;
129 unsigned int shared_type
;
130 cpumask_var_t shared_cpu_map
;
133 extern int cppc_get_perf_ctrs(int cpu
, struct cppc_perf_fb_ctrs
*perf_fb_ctrs
);
134 extern int cppc_set_perf(int cpu
, struct cppc_perf_ctrls
*perf_ctrls
);
135 extern int cppc_get_perf_caps(int cpu
, struct cppc_perf_caps
*caps
);
136 extern int acpi_get_psd_map(struct cppc_cpudata
**);
137 extern unsigned int cppc_get_transition_latency(int cpu
);
139 #endif /* _CPPC_ACPI_H*/