diff options
author | Fei Yang <fei.yang@intel.com> | 2013-08-01 14:17:50 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2015-06-02 14:57:49 -0700 |
commit | c834b709a01893c6e3a3826ce3bda87f33826794 (patch) | |
tree | 49ea8c275eb4bae6c76e15dda2b5d49230358ba5 | |
parent | 4917ae012d0bb0efa1c556c150404b3347bb9a70 (diff) | |
download | edison-v3.10-c834b709a01893c6e3a3826ce3bda87f33826794.tar.gz |
P-STATE: Add SFI p-state driver for Intel SoC
Forklifted from PSI Jellybean tree.
Signed-off-by: Fei Yang <fei.yang@intel.com>
[Ignore the changes of ondemand Governor for 3.10 kernel]
Signed-off-by: Srinidhi Kasagar <srinidhi.kasagar@intel.com>
-rw-r--r-- | drivers/cpufreq/Kconfig.x86 | 15 | ||||
-rw-r--r-- | drivers/cpufreq/Makefile | 1 | ||||
-rw-r--r-- | drivers/cpufreq/sfi-cpufreq.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/sfi-cpufreq.h | 65 |
4 files changed, 82 insertions, 1 deletions
diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86 index 6bd63d63d35..2a9d25e893e 100644 --- a/drivers/cpufreq/Kconfig.x86 +++ b/drivers/cpufreq/Kconfig.x86 @@ -58,6 +58,21 @@ config X86_ACPI_CPUFREQ_CPB By enabling this option the acpi_cpufreq driver provides the old entry in addition to the new boost ones, for compatibility reasons. +config X86_SFI_CPUFREQ + tristate "SFI Processor P-States driver" + select CPU_FREQ_TABLE + depends on SFI + help + This driver adds a CPUFreq driver which utilizes the SFI + Processor Performance States enumeration. + + To compile this driver as a module, choose M here: the + module will be called sfi-cpufreq. + + For details, take a look at <file:Documentation/cpu-freq/>. + + If in doubt, say N. + config ELAN_CPUFREQ tristate "AMD Elan SC400 and SC410" select CPU_FREQ_TABLE diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index 315b9231feb..b1c516f84e0 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -25,6 +25,7 @@ obj-$(CONFIG_GENERIC_CPUFREQ_CPU0) += cpufreq-cpu0.o obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o mperf.o obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o +obj-$(CONFIG_X86_SFI_CPUFREQ) += sfi-cpufreq.o mperf.o obj-$(CONFIG_X86_PCC_CPUFREQ) += pcc-cpufreq.o obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o diff --git a/drivers/cpufreq/sfi-cpufreq.c b/drivers/cpufreq/sfi-cpufreq.c index fde419df9fa..2f9f9a2d2c7 100644 --- a/drivers/cpufreq/sfi-cpufreq.c +++ b/drivers/cpufreq/sfi-cpufreq.c @@ -1,7 +1,7 @@ /* * sfi_cpufreq.c - sfi Processor P-States Driver * - * + * (C) 2010-2011 Intel Corporation * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * diff --git a/drivers/cpufreq/sfi-cpufreq.h b/drivers/cpufreq/sfi-cpufreq.h new file mode 100644 index 00000000000..7e01c1e73dc --- /dev/null +++ b/drivers/cpufreq/sfi-cpufreq.h @@ -0,0 +1,65 @@ +/* + * sfi_processor.h + * Copyright (c) 2010, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef __SFI_PROCESSOR_H__ +#define __SFI_PROCESSOR_H__ + +#include <linux/sfi.h> +#include <linux/cpuidle.h> + +struct sfi_processor_power { + struct cpuidle_device dev; + u32 default_state; + int count; + struct cpuidle_state *states; + struct sfi_cstate_table_entry *sfi_cstates; +}; + +struct sfi_processor_flags { + u8 valid; + u8 power; +}; + +struct sfi_processor { + u32 id; + struct sfi_processor_flags flags; + struct sfi_processor_power power; + struct sfi_processor_performance *performance; +}; + +/* Performance management */ +struct sfi_processor_px { + u32 core_frequency; /* megahertz */ + u32 transition_latency; /* microseconds */ + u32 control; /* control value */ +}; + +struct sfi_processor_performance { + unsigned int state; + unsigned int state_count; + struct sfi_processor_px *states; +}; + +/* for communication between multiple parts of the processor kernel module */ +DECLARE_PER_CPU(struct sfi_processor *, sfi_processors); + +int sfi_processor_power_init(struct sfi_processor *pr); +int sfi_processor_power_exit(struct sfi_processor *pr); + +#endif /*__SFI_PROCESSOR_H__*/ |