Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191816
b: refs/heads/master
c: c5a0adb
h: refs/heads/master
v: v3
  • Loading branch information
Russell King committed May 2, 2010
1 parent 5ba55a7 commit 5039677
Show file tree
Hide file tree
Showing 21 changed files with 68 additions and 219 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 232eaf7f268f765b52170bec42bfa0c5825aa239
refs/heads/master: c5a0adb51002e51a4254cb7f0ab7190d41d8b930
6 changes: 3 additions & 3 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ config ARCH_INTEGRATOR
select ARCH_HAS_CPUFREQ
select HAVE_CLK
select COMMON_CLKDEV
select ICST525
select ICST
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
help
Expand All @@ -251,7 +251,7 @@ config ARCH_REALVIEW
select ARM_AMBA
select HAVE_CLK
select COMMON_CLKDEV
select ICST307
select ICST
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
select ARCH_WANT_OPTIONAL_GPIOLIB
Expand All @@ -264,7 +264,7 @@ config ARCH_VERSATILE
select ARM_VIC
select HAVE_CLK
select COMMON_CLKDEV
select ICST307
select ICST
select GENERIC_TIME
select GENERIC_CLOCKEVENTS
select ARCH_WANT_OPTIONAL_GPIOLIB
Expand Down
5 changes: 1 addition & 4 deletions trunk/arch/arm/common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ config ARM_VIC_NR
The maximum number of VICs available in the system, for
power management.

config ICST525
bool

config ICST307
config ICST
bool

config SA1111
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

obj-$(CONFIG_ARM_GIC) += gic.o
obj-$(CONFIG_ARM_VIC) += vic.o
obj-$(CONFIG_ICST525) += icst525.o
obj-$(CONFIG_ICST307) += icst307.o
obj-$(CONFIG_ICST) += icst.o
obj-$(CONFIG_SA1111) += sa1111.o
obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
obj-$(CONFIG_DMABOUNCE) += dmabounce.o
Expand Down
19 changes: 9 additions & 10 deletions trunk/arch/arm/common/icst307.c → trunk/arch/arm/common/icst.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,33 @@
#include <linux/module.h>
#include <linux/kernel.h>

#include <asm/hardware/icst307.h>
#include <asm/hardware/icst.h>

/*
* Divisors for each OD setting.
*/
const unsigned char icst307_s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 };

const unsigned char icst525_s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 };
EXPORT_SYMBOL(icst307_s2div);
EXPORT_SYMBOL(icst525_s2div);

unsigned long icst307_hz(const struct icst_params *p, struct icst_vco vco)
unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco)
{
return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]);
}

EXPORT_SYMBOL(icst307_hz);
EXPORT_SYMBOL(icst_hz);

/*
* Ascending divisor S values.
*/
const unsigned char icst307_idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 };

const unsigned char icst525_idx2s[8] = { 1, 3, 4, 7, 5, 2, 6, 0 };
EXPORT_SYMBOL(icst307_idx2s);
EXPORT_SYMBOL(icst525_idx2s);

struct icst_vco
icst307_hz_to_vco(const struct icst_params *p, unsigned long freq)
icst_hz_to_vco(const struct icst_params *p, unsigned long freq)
{
struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
unsigned long f;
Expand All @@ -54,9 +56,6 @@ icst307_hz_to_vco(const struct icst_params *p, unsigned long freq)
do {
f = freq * p->s2div[p->idx2s[i]];

/*
* f must be between 6MHz and 200MHz (3.3 or 5V)
*/
if (f > p->vco_min && f <= p->vco_max)
break;
} while (i < 8);
Expand Down Expand Up @@ -98,4 +97,4 @@ icst307_hz_to_vco(const struct icst_params *p, unsigned long freq)
return vco;
}

EXPORT_SYMBOL(icst307_hz_to_vco);
EXPORT_SYMBOL(icst_hz_to_vco);
99 changes: 0 additions & 99 deletions trunk/arch/arm/common/icst525.c

This file was deleted.

24 changes: 24 additions & 0 deletions trunk/arch/arm/include/asm/hardware/icst.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,28 @@ struct icst_vco {
unsigned char s;
};

unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco);
struct icst_vco icst_hz_to_vco(const struct icst_params *p, unsigned long freq);

/*
* ICST307 VCO frequency must be between 6MHz and 200MHz (3.3 or 5V).
* This frequency is pre-output divider.
*/
#define ICST307_VCO_MIN 6000000
#define ICST307_VCO_MAX 200000000

extern const unsigned char icst307_s2div[];
extern const unsigned char icst307_idx2s[];

/*
* ICST525 VCO frequency must be between 10MHz and 200MHz (3V) or 320MHz (5V).
* This frequency is pre-output divider.
*/
#define ICST525_VCO_MIN 10000000
#define ICST525_VCO_MAX_3V 200000000
#define ICST525_VCO_MAX_5V 320000000

extern const unsigned char icst525_s2div[];
extern const unsigned char icst525_idx2s[];

#endif
34 changes: 0 additions & 34 deletions trunk/arch/arm/include/asm/hardware/icst307.h

This file was deleted.

33 changes: 0 additions & 33 deletions trunk/arch/arm/include/asm/hardware/icst525.h

This file was deleted.

10 changes: 5 additions & 5 deletions trunk/arch/arm/mach-integrator/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <linux/clk.h>
#include <linux/mutex.h>

#include <asm/hardware/icst525.h>
#include <asm/hardware/icst.h>
#include <asm/clkdev.h>
#include <mach/clkdev.h>

Expand All @@ -38,8 +38,8 @@ EXPORT_SYMBOL(clk_get_rate);
long clk_round_rate(struct clk *clk, unsigned long rate)
{
struct icst_vco vco;
vco = icst525_hz_to_vco(clk->params, rate);
return icst525_hz(clk->params, vco);
vco = icst_hz_to_vco(clk->params, rate);
return icst_hz(clk->params, vco);
}
EXPORT_SYMBOL(clk_round_rate);

Expand All @@ -50,8 +50,8 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
if (clk->setvco) {
struct icst_vco vco;

vco = icst525_hz_to_vco(clk->params, rate);
clk->rate = icst525_hz(clk->params, vco);
vco = icst_hz_to_vco(clk->params, rate);
clk->rate = icst_hz(clk->params, vco);
clk->setvco(clk, vco);
ret = 0;
}
Expand Down
20 changes: 10 additions & 10 deletions trunk/arch/arm/mach-integrator/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <mach/hardware.h>
#include <mach/platform.h>
#include <asm/mach-types.h>
#include <asm/hardware/icst525.h>
#include <asm/hardware/icst.h>

static struct cpufreq_driver integrator_driver;

Expand Down Expand Up @@ -66,11 +66,11 @@ static int integrator_verify_policy(struct cpufreq_policy *policy)
policy->cpuinfo.min_freq,
policy->cpuinfo.max_freq);

vco = icst525_hz_to_vco(&cclk_params, policy->max * 1000);
policy->max = icst525_hz(&cclk_params, vco) / 1000;
vco = icst_hz_to_vco(&cclk_params, policy->max * 1000);
policy->max = icst_hz(&cclk_params, vco) / 1000;

vco = icst525_hz_to_vco(&cclk_params, policy->min * 1000);
policy->min = icst525_hz(&cclk_params, vco) / 1000;
vco = icst_hz_to_vco(&cclk_params, policy->min * 1000);
policy->min = icst_hz(&cclk_params, vco) / 1000;

cpufreq_verify_within_limits(policy,
policy->cpuinfo.min_freq,
Expand Down Expand Up @@ -112,17 +112,17 @@ static int integrator_set_target(struct cpufreq_policy *policy,
}
vco.v = cm_osc & 255;
vco.r = 22;
freqs.old = icst525_hz(&cclk_params, vco) / 1000;
freqs.old = icst_hz(&cclk_params, vco) / 1000;

/* icst525_hz_to_vco rounds down -- so we need the next
/* icst_hz_to_vco rounds down -- so we need the next
* larger freq in case of CPUFREQ_RELATION_L.
*/
if (relation == CPUFREQ_RELATION_L)
target_freq += 999;
if (target_freq > policy->max)
target_freq = policy->max;
vco = icst525_hz_to_vco(&cclk_params, target_freq * 1000);
freqs.new = icst525_hz(&cclk_params, vco) / 1000;
vco = icst_hz_to_vco(&cclk_params, target_freq * 1000);
freqs.new = icst_hz(&cclk_params, vco) / 1000;

freqs.cpu = policy->cpu;

Expand Down Expand Up @@ -180,7 +180,7 @@ static unsigned int integrator_get(unsigned int cpu)
vco.v = cm_osc & 255;
vco.r = 22;

current_freq = icst525_hz(&cclk_params, vco) / 1000; /* current freq */
current_freq = icst_hz(&cclk_params, vco) / 1000; /* current freq */

set_cpus_allowed(current, cpus_allowed);

Expand Down
Loading

0 comments on commit 5039677

Please sign in to comment.