Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# Normal rules
#
.*
*.o
*.o.*
*.a
*.s
*.ko
*.so
*.so.dbg
*.mod.c
*.i
*.lst
*.symtypes
*.order
modules.builtin
*.elf
*.bin
*.gz
*.bz2
*.lzma
*.lzo
*.patch
*.gcno

#
# Top-level generic files
#
/tags
/TAGS
/linux
/vmlinux
/vmlinuz
/System.map
/Module.markers
/Module.symvers

#
# git files that we don't want to ignore even it they are dot-files
#
!.gitignore
!.mailmap

#
# Generated include files
#
include/config
include/linux/version.h
include/generated

# stgit generated dirs
patches-*

# quilt's files
patches
series

# cscope files
cscope.*
ncscope.*

# gnu global files
GPATH
GRTAGS
GSYMS
GTAGS

*.orig
*~
\#*#
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
export KBUILD_BUILDHOST := $(SUBARCH)
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
ARCH ?= arm
CROSS_COMPILE ?= /home/forumber/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-

# Architecture as present in compile.h
UTS_MACHINE := $(ARCH)
Expand Down
9 changes: 6 additions & 3 deletions arch/arm/configs/u8800_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_LZMA=y
# CONFIG_KERNEL_LZO is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
# CONFIG_SWAP is not set
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_POSIX_MQUEUE is not set
Expand Down Expand Up @@ -382,7 +382,7 @@ CONFIG_MSM_DALRPC=y
CONFIG_MSM_DALRPC_TEST=m
CONFIG_MSM_CPU_FREQ_SET_MIN_MAX=y
CONFIG_MSM_CPU_FREQ_MAX=1024000
CONFIG_MSM_CPU_FREQ_MIN=122880
CONFIG_MSM_CPU_FREQ_MIN=368640
# CONFIG_MSM_AVS_HW is not set
# CONFIG_MSM_HW3D is not set
CONFIG_AMSS_7X25_VERSION_2009=y
Expand Down Expand Up @@ -584,18 +584,21 @@ CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS2=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_VDD_LEVELS=y
CONFIG_CPU_FREQ_GOV_SMARTASS2=y
# CONFIG_CPU_IDLE is not set
CONFIG_CPU_FREQ_MSM=y

Expand Down
55 changes: 48 additions & 7 deletions arch/arm/mach-msm/acpuclock-7x30.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#define VDD_RAW(mv) (((MV(mv) / V_STEP) - 30) | VREG_DATA)

#define MAX_AXI_KHZ 192000
#define SEMC_ACPU_MIN_UV_MV 750U
#define SEMC_ACPU_MAX_UV_MV 1500U

struct clock_state {
struct clkctl_acpu_speed *current_speed;
Expand Down Expand Up @@ -121,20 +123,20 @@ static struct clk *acpuclk_sources[MAX_SOURCE];
static struct clkctl_acpu_speed acpu_freq_tbl[] = {
{ 0, 24576, LPXO, 0, 0, 30720000, 900, VDD_RAW(900) },
{ 0, 61440, PLL_3, 5, 11, 61440000, 900, VDD_RAW(900) },
{ 1, 122880, PLL_3, 5, 5, 61440000, 900, VDD_RAW(900) },
{ 0, 122880, PLL_3, 5, 5, 61440000, 900, VDD_RAW(900) },
{ 0, 184320, PLL_3, 5, 4, 61440000, 900, VDD_RAW(900) },
{ 0, MAX_AXI_KHZ, AXI, 1, 0, 61440000, 900, VDD_RAW(900) },
{ 1, 245760, PLL_3, 5, 2, 61440000, 900, VDD_RAW(900) },
{ 0, 245760, PLL_3, 5, 2, 61440000, 900, VDD_RAW(900) },
{ 1, 368640, PLL_3, 5, 1, 122800000, 900, VDD_RAW(900) },
{ 0, 480000, PLL_2, 3, 0, 122800000, 900, VDD_RAW(900), &pll2_tbl[0]},
{ 0, 600000, PLL_2, 3, 0, 122800000, 925, VDD_RAW(925), &pll2_tbl[1]},
{ 1, 480000, PLL_2, 3, 0, 122800000, 900, VDD_RAW(900), &pll2_tbl[0]},
{ 1, 600000, PLL_2, 3, 0, 122800000, 925, VDD_RAW(925), &pll2_tbl[1]},
/* AXI has MSMC1 implications. See above. */
{ 1, 768000, PLL_1, 2, 0, 153600000, 1050, VDD_RAW(1050) },
{ 1, 768000, PLL_1, 2, 0, 153600000, 975, VDD_RAW(975) },
/*
* AXI has MSMC1 implications. See above.
*/
{ 1, 806400, PLL_2, 3, 0, UINT_MAX, 1100, VDD_RAW(1100), &pll2_tbl[2]},
{ 1, 1024000, PLL_2, 3, 0, UINT_MAX, 1200, VDD_RAW(1200), &pll2_tbl[3]},
{ 1, 806400, PLL_2, 3, 0, UINT_MAX, 1000, VDD_RAW(1000), &pll2_tbl[2]},
{ 1, 1024000, PLL_2, 3, 0, UINT_MAX, 1100, VDD_RAW(1100), &pll2_tbl[3]},
{ 1, 1200000, PLL_2, 3, 0, UINT_MAX, 1200, VDD_RAW(1200), &pll2_tbl[4]},
{ 1, 1401600, PLL_2, 3, 0, UINT_MAX, 1250, VDD_RAW(1250), &pll2_tbl[5]},
{ 1, 1516800, PLL_2, 3, 0, UINT_MAX, 1300, VDD_RAW(1300), &pll2_tbl[6]},
Expand Down Expand Up @@ -493,3 +495,42 @@ static int __init acpuclk_7x30_init(struct acpuclk_soc_data *soc_data)
struct acpuclk_soc_data acpuclk_7x30_soc_data __initdata = {
.init = acpuclk_7x30_init,
};

#ifdef CONFIG_CPU_FREQ_VDD_LEVELS

ssize_t acpuclk_get_vdd_levels_str(char *buf)
{
int i, len = 0;
if (buf)
{
mutex_lock(&drv_state.lock);
for (i = 0; acpu_freq_tbl[i].acpu_clk_khz; i++)
{
len += sprintf(buf + len, "%8u: %4d\n", acpu_freq_tbl[i].acpu_clk_khz, acpu_freq_tbl[i].vdd_mv);
}
mutex_unlock(&drv_state.lock);
}
return len;
}

void acpuclk_set_vdd(unsigned int khz, int vdd)
{
int i;
unsigned int new_vdd;
vdd = vdd / V_STEP * V_STEP;
mutex_lock(&drv_state.lock);
for (i = 0; acpu_freq_tbl[i].acpu_clk_khz; i++)
{
if (khz == 0)
new_vdd = min(max((acpu_freq_tbl[i].vdd_mv + vdd), SEMC_ACPU_MIN_UV_MV), SEMC_ACPU_MAX_UV_MV);
else if (acpu_freq_tbl[i].acpu_clk_khz == khz)
new_vdd = min(max((unsigned int)vdd, SEMC_ACPU_MIN_UV_MV), SEMC_ACPU_MAX_UV_MV);
else continue;

acpu_freq_tbl[i].vdd_mv = new_vdd;
acpu_freq_tbl[i].vdd_raw = VDD_RAW(new_vdd);
}
mutex_unlock(&drv_state.lock);
}

#endif
23 changes: 23 additions & 0 deletions drivers/cpufreq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ config CPU_FREQ_DEFAULT_GOV_INTERACTIVE
loading your cpufreq low-level hardware driver, using the
'interactive' governor for latency-sensitive workloads.

config CPU_FREQ_DEFAULT_GOV_SMARTASS2
bool "smartass2"
select CPU_FREQ_GOV_SMARTASS2
select CPU_FREQ_GOV_PERFORMANCE
help
Use the CPUFreq governor 'smartassV2' as default.

endchoice

config CPU_FREQ_GOV_PERFORMANCE
Expand Down Expand Up @@ -206,6 +213,22 @@ config CPU_FREQ_GOV_CONSERVATIVE

If in doubt, say N.

config CPU_FREQ_VDD_LEVELS
bool "CPU Vdd levels sysfs interface"
depends on CPU_FREQ_STAT
depends on ARCH_MSM7X30
default n
help
CPU Vdd levels sysfs interface

config CPU_FREQ_GOV_SMARTASS2
tristate "'smartassV2' cpufreq governor"
depends on CPU_FREQ
help
'smartassV2' - a "smart" governor

If in doubt, say N.

menu "x86 CPU frequency scaling drivers"
depends on X86
source "drivers/cpufreq/Kconfig.x86"
Expand Down
1 change: 1 addition & 0 deletions drivers/cpufreq/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o
obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
obj-$(CONFIG_CPU_FREQ_GOV_INTERACTIVE) += cpufreq_interactive.o
obj-$(CONFIG_CPU_FREQ_GOV_SMARTASS2) += cpufreq_smartass2.o

# CPUfreq cross-arch helpers
obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o
Expand Down
62 changes: 62 additions & 0 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,62 @@ static ssize_t show_scaling_setspeed(struct cpufreq_policy *policy, char *buf)
return policy->governor->show_setspeed(policy, buf);
}

#ifdef CONFIG_CPU_FREQ_VDD_LEVELS

extern ssize_t acpuclk_get_vdd_levels_str(char *buf);
static ssize_t show_vdd_levels(struct cpufreq_policy *policy, char *buf)
{
return acpuclk_get_vdd_levels_str(buf);
}

extern void acpuclk_set_vdd(unsigned acpu_khz, int vdd);
static ssize_t store_vdd_levels(struct cpufreq_policy *policy, const char *buf, size_t count)
{
int i = 0, j;
int pair[2] = { 0, 0 };
int sign = 0;

if (count < 1)
return 0;

if (buf[0] == '-') {
sign = -1;
i++;
} else if (buf[0] == '+') {
sign = 1;
i++;
}

for (j = 0; i < count; i++) {
char c = buf[i];
if ((c >= '0') && (c <= '9')) {
pair[j] *= 10;
pair[j] += (c - '0');
} else if ((c == ' ') || (c == '\t')) {
if (pair[j] != 0) {
j++;
if ((sign != 0) || (j > 1))
break;
}
}
else
break;
}

if (sign != 0) {
if (pair[0] > 0)
acpuclk_set_vdd(0, sign * pair[0]);
} else {
if ((pair[0] > 0) && (pair[1] > 0))
acpuclk_set_vdd((unsigned)pair[0], pair[1]);
else
return -EINVAL;
}
return count;
}

#endif

/**
* show_scaling_driver - show the current cpufreq HW/BIOS limitation
*/
Expand Down Expand Up @@ -586,6 +642,9 @@ cpufreq_freq_attr_rw(scaling_min_freq);
cpufreq_freq_attr_rw(scaling_max_freq);
cpufreq_freq_attr_rw(scaling_governor);
cpufreq_freq_attr_rw(scaling_setspeed);
#ifdef CONFIG_CPU_FREQ_VDD_LEVELS
cpufreq_freq_attr_rw(vdd_levels);
#endif

static struct attribute *default_attrs[] = {
&cpuinfo_min_freq.attr,
Expand All @@ -599,6 +658,9 @@ static struct attribute *default_attrs[] = {
&scaling_driver.attr,
&scaling_available_governors.attr,
&scaling_setspeed.attr,
#ifdef CONFIG_CPU_FREQ_VDD_LEVELS
&vdd_levels.attr,
#endif
NULL
};

Expand Down
Loading