diff options
author | Rafael J. Wysocki <rjw@rjwysocki.net> | 2013-10-25 16:36:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@rjwysocki.net> | 2013-10-25 16:36:40 -0400 |
commit | 6ddee424fea2d269c2f402278d93165c7b92dc58 (patch) | |
tree | c1b1d0d9058846a6da22def648dea61e16faacd0 /arch/arm | |
parent | e4db1c7439b31993a4886b273bb9235a8eea82bf (diff) | |
parent | a814613b9a32d9ab9578d9dab396265c826d37f0 (diff) |
Merge back earlier 'pm-cpufreq' material.
Conflicts:
drivers/cpufreq/omap-cpufreq.c
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-davinci/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/generic.c | 65 | ||||
-rw-r--r-- | arch/arm/mach-sa1100/generic.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-ux500/Kconfig | 1 |
5 files changed, 23 insertions, 52 deletions
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index e026b19b23ea..a075b3e0c5c7 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig | |||
@@ -40,7 +40,6 @@ config ARCH_DAVINCI_DA850 | |||
40 | bool "DA850/OMAP-L138/AM18x based system" | 40 | bool "DA850/OMAP-L138/AM18x based system" |
41 | select ARCH_DAVINCI_DA8XX | 41 | select ARCH_DAVINCI_DA8XX |
42 | select ARCH_HAS_CPUFREQ | 42 | select ARCH_HAS_CPUFREQ |
43 | select CPU_FREQ_TABLE | ||
44 | select CP_INTC | 43 | select CP_INTC |
45 | 44 | ||
46 | config ARCH_DAVINCI_DA8XX | 45 | config ARCH_DAVINCI_DA8XX |
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index a8427115ee07..96100dbf5a2e 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -615,14 +615,12 @@ endmenu | |||
615 | config PXA25x | 615 | config PXA25x |
616 | bool | 616 | bool |
617 | select CPU_XSCALE | 617 | select CPU_XSCALE |
618 | select CPU_FREQ_TABLE if CPU_FREQ | ||
619 | help | 618 | help |
620 | Select code specific to PXA21x/25x/26x variants | 619 | Select code specific to PXA21x/25x/26x variants |
621 | 620 | ||
622 | config PXA27x | 621 | config PXA27x |
623 | bool | 622 | bool |
624 | select CPU_XSCALE | 623 | select CPU_XSCALE |
625 | select CPU_FREQ_TABLE if CPU_FREQ | ||
626 | help | 624 | help |
627 | Select code specific to PXA27x variants | 625 | Select code specific to PXA27x variants |
628 | 626 | ||
@@ -635,7 +633,6 @@ config CPU_PXA26x | |||
635 | config PXA3xx | 633 | config PXA3xx |
636 | bool | 634 | bool |
637 | select CPU_XSC3 | 635 | select CPU_XSC3 |
638 | select CPU_FREQ_TABLE if CPU_FREQ | ||
639 | help | 636 | help |
640 | Select code specific to PXA3xx variants | 637 | Select code specific to PXA3xx variants |
641 | 638 | ||
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index f25b6119e028..cb4b2ca3cf6b 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c | |||
@@ -42,23 +42,24 @@ EXPORT_SYMBOL(reset_status); | |||
42 | /* | 42 | /* |
43 | * This table is setup for a 3.6864MHz Crystal. | 43 | * This table is setup for a 3.6864MHz Crystal. |
44 | */ | 44 | */ |
45 | static const unsigned short cclk_frequency_100khz[NR_FREQS] = { | 45 | struct cpufreq_frequency_table sa11x0_freq_table[NR_FREQS+1] = { |
46 | 590, /* 59.0 MHz */ | 46 | { .frequency = 59000, /* 59.0 MHz */}, |
47 | 737, /* 73.7 MHz */ | 47 | { .frequency = 73700, /* 73.7 MHz */}, |
48 | 885, /* 88.5 MHz */ | 48 | { .frequency = 88500, /* 88.5 MHz */}, |
49 | 1032, /* 103.2 MHz */ | 49 | { .frequency = 103200, /* 103.2 MHz */}, |
50 | 1180, /* 118.0 MHz */ | 50 | { .frequency = 118000, /* 118.0 MHz */}, |
51 | 1327, /* 132.7 MHz */ | 51 | { .frequency = 132700, /* 132.7 MHz */}, |
52 | 1475, /* 147.5 MHz */ | 52 | { .frequency = 147500, /* 147.5 MHz */}, |
53 | 1622, /* 162.2 MHz */ | 53 | { .frequency = 162200, /* 162.2 MHz */}, |
54 | 1769, /* 176.9 MHz */ | 54 | { .frequency = 176900, /* 176.9 MHz */}, |
55 | 1917, /* 191.7 MHz */ | 55 | { .frequency = 191700, /* 191.7 MHz */}, |
56 | 2064, /* 206.4 MHz */ | 56 | { .frequency = 206400, /* 206.4 MHz */}, |
57 | 2212, /* 221.2 MHz */ | 57 | { .frequency = 221200, /* 221.2 MHz */}, |
58 | 2359, /* 235.9 MHz */ | 58 | { .frequency = 235900, /* 235.9 MHz */}, |
59 | 2507, /* 250.7 MHz */ | 59 | { .frequency = 250700, /* 250.7 MHz */}, |
60 | 2654, /* 265.4 MHz */ | 60 | { .frequency = 265400, /* 265.4 MHz */}, |
61 | 2802 /* 280.2 MHz */ | 61 | { .frequency = 280200, /* 280.2 MHz */}, |
62 | { .frequency = CPUFREQ_TABLE_END, }, | ||
62 | }; | 63 | }; |
63 | 64 | ||
64 | /* rounds up(!) */ | 65 | /* rounds up(!) */ |
@@ -66,10 +67,8 @@ unsigned int sa11x0_freq_to_ppcr(unsigned int khz) | |||
66 | { | 67 | { |
67 | int i; | 68 | int i; |
68 | 69 | ||
69 | khz /= 100; | ||
70 | |||
71 | for (i = 0; i < NR_FREQS; i++) | 70 | for (i = 0; i < NR_FREQS; i++) |
72 | if (cclk_frequency_100khz[i] >= khz) | 71 | if (sa11x0_freq_table[i].frequency >= khz) |
73 | break; | 72 | break; |
74 | 73 | ||
75 | return i; | 74 | return i; |
@@ -79,37 +78,15 @@ unsigned int sa11x0_ppcr_to_freq(unsigned int idx) | |||
79 | { | 78 | { |
80 | unsigned int freq = 0; | 79 | unsigned int freq = 0; |
81 | if (idx < NR_FREQS) | 80 | if (idx < NR_FREQS) |
82 | freq = cclk_frequency_100khz[idx] * 100; | 81 | freq = sa11x0_freq_table[idx].frequency; |
83 | return freq; | 82 | return freq; |
84 | } | 83 | } |
85 | 84 | ||
86 | |||
87 | /* make sure that only the "userspace" governor is run -- anything else wouldn't make sense on | ||
88 | * this platform, anyway. | ||
89 | */ | ||
90 | int sa11x0_verify_speed(struct cpufreq_policy *policy) | ||
91 | { | ||
92 | unsigned int tmp; | ||
93 | if (policy->cpu) | ||
94 | return -EINVAL; | ||
95 | |||
96 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); | ||
97 | |||
98 | /* make sure that at least one frequency is within the policy */ | ||
99 | tmp = cclk_frequency_100khz[sa11x0_freq_to_ppcr(policy->min)] * 100; | ||
100 | if (tmp > policy->max) | ||
101 | policy->max = tmp; | ||
102 | |||
103 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); | ||
104 | |||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | unsigned int sa11x0_getspeed(unsigned int cpu) | 85 | unsigned int sa11x0_getspeed(unsigned int cpu) |
109 | { | 86 | { |
110 | if (cpu) | 87 | if (cpu) |
111 | return 0; | 88 | return 0; |
112 | return cclk_frequency_100khz[PPCR & 0xf] * 100; | 89 | return sa11x0_freq_table[PPCR & 0xf].frequency; |
113 | } | 90 | } |
114 | 91 | ||
115 | /* | 92 | /* |
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index 9a33695c9492..cbdfae744dc5 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Author: Nicolas Pitre | 4 | * Author: Nicolas Pitre |
5 | */ | 5 | */ |
6 | #include <linux/cpufreq.h> | ||
6 | #include <linux/reboot.h> | 7 | #include <linux/reboot.h> |
7 | 8 | ||
8 | extern void sa1100_timer_init(void); | 9 | extern void sa1100_timer_init(void); |
@@ -19,10 +20,8 @@ extern void sa11x0_init_late(void); | |||
19 | extern void sa1110_mb_enable(void); | 20 | extern void sa1110_mb_enable(void); |
20 | extern void sa1110_mb_disable(void); | 21 | extern void sa1110_mb_disable(void); |
21 | 22 | ||
22 | struct cpufreq_policy; | 23 | extern struct cpufreq_frequency_table sa11x0_freq_table[]; |
23 | |||
24 | extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); | 24 | extern unsigned int sa11x0_freq_to_ppcr(unsigned int khz); |
25 | extern int sa11x0_verify_speed(struct cpufreq_policy *policy); | ||
26 | extern unsigned int sa11x0_getspeed(unsigned int cpu); | 25 | extern unsigned int sa11x0_getspeed(unsigned int cpu); |
27 | extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx); | 26 | extern unsigned int sa11x0_ppcr_to_freq(unsigned int idx); |
28 | 27 | ||
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 99a28d628297..7a3fc1af6944 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig | |||
@@ -34,7 +34,6 @@ config UX500_SOC_COMMON | |||
34 | 34 | ||
35 | config UX500_SOC_DB8500 | 35 | config UX500_SOC_DB8500 |
36 | bool | 36 | bool |
37 | select CPU_FREQ_TABLE if CPU_FREQ | ||
38 | select MFD_DB8500_PRCMU | 37 | select MFD_DB8500_PRCMU |
39 | select PINCTRL_DB8500 | 38 | select PINCTRL_DB8500 |
40 | select PINCTRL_DB8540 | 39 | select PINCTRL_DB8540 |