diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 19:47:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-01 19:47:15 -0400 |
commit | 1a9b4993b70fb1884716902774dc9025b457760d (patch) | |
tree | 83a3fa7011878ab4b7bef6857d4b481038a1e67e | |
parent | 1871e845e564c4e17f561ec4e5e4bb6bb8578685 (diff) | |
parent | 95cf1468f712df516cc471adcd1c861df4e3d371 (diff) |
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
"The lion share of this pull request are fixes for clk-related breakage
caused by other changes during this merge window. For some platforms
the fix was as simple as selecting HAVE_CLK, for others like the
Loongson 2 significant restructuring was required.
The remainder are changes required to get the Lantiq code to work
again."
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
MIPS: Loongson 2: Sort out clock managment.
MIPS: Loongson 1: more clk support and add select HAVE_CLK
MIPS: txx9: Fix redefinition of clk_* by adding select HAVE_CLK
MIPS: BCM63xx: Fix redefinition of clk_* by adding select HAVE_CLK
MIPS: AR7: Fix redefinition of clk_* by adding select HAVE_CLK
MIPS: Lantiq: Platform specific CLK fixup
MIPS: Lantiq: Add device_tree_init function
MIPS: Lantiq: Fix interface clock and PCI control register offset
-rw-r--r-- | arch/mips/Kconfig | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/clock.h | 11 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-loongson/loongson.h | 1 | ||||
-rw-r--r-- | arch/mips/kernel/cpufreq/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/kernel/cpufreq/loongson2_cpufreq.c | 21 | ||||
-rw-r--r-- | arch/mips/lantiq/clk.c | 5 | ||||
-rw-r--r-- | arch/mips/lantiq/prom.c | 22 | ||||
-rw-r--r-- | arch/mips/lantiq/xway/sysctrl.c | 49 | ||||
-rw-r--r-- | arch/mips/loongson/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/loongson/lemote-2f/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/loongson/lemote-2f/clock.c (renamed from arch/mips/kernel/cpufreq/loongson2_clock.c) | 46 | ||||
-rw-r--r-- | arch/mips/loongson1/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/loongson1/common/clock.c | 16 | ||||
-rw-r--r-- | arch/mips/txx9/Kconfig | 1 |
14 files changed, 108 insertions, 72 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index e3efc06e6409..331d574df99c 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -77,6 +77,7 @@ config AR7 | |||
77 | select SYS_SUPPORTS_ZBOOT_UART16550 | 77 | select SYS_SUPPORTS_ZBOOT_UART16550 |
78 | select ARCH_REQUIRE_GPIOLIB | 78 | select ARCH_REQUIRE_GPIOLIB |
79 | select VLYNQ | 79 | select VLYNQ |
80 | select HAVE_CLK | ||
80 | help | 81 | help |
81 | Support for the Texas Instruments AR7 System-on-a-Chip | 82 | Support for the Texas Instruments AR7 System-on-a-Chip |
82 | family: TNETD7100, 7200 and 7300. | 83 | family: TNETD7100, 7200 and 7300. |
@@ -124,6 +125,7 @@ config BCM63XX | |||
124 | select SYS_HAS_EARLY_PRINTK | 125 | select SYS_HAS_EARLY_PRINTK |
125 | select SWAP_IO_SPACE | 126 | select SWAP_IO_SPACE |
126 | select ARCH_REQUIRE_GPIOLIB | 127 | select ARCH_REQUIRE_GPIOLIB |
128 | select HAVE_CLK | ||
127 | help | 129 | help |
128 | Support for BCM63XX based boards | 130 | Support for BCM63XX based boards |
129 | 131 | ||
diff --git a/arch/mips/include/asm/clock.h b/arch/mips/include/asm/clock.h index 83894aa7932c..c9456e7a7283 100644 --- a/arch/mips/include/asm/clock.h +++ b/arch/mips/include/asm/clock.h | |||
@@ -50,15 +50,4 @@ void clk_recalc_rate(struct clk *); | |||
50 | int clk_register(struct clk *); | 50 | int clk_register(struct clk *); |
51 | void clk_unregister(struct clk *); | 51 | void clk_unregister(struct clk *); |
52 | 52 | ||
53 | /* the exported API, in addition to clk_set_rate */ | ||
54 | /** | ||
55 | * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter | ||
56 | * @clk: clock source | ||
57 | * @rate: desired clock rate in Hz | ||
58 | * @algo_id: algorithm id to be passed down to ops->set_rate | ||
59 | * | ||
60 | * Returns success (0) or negative errno. | ||
61 | */ | ||
62 | int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id); | ||
63 | |||
64 | #endif /* __ASM_MIPS_CLOCK_H */ | 53 | #endif /* __ASM_MIPS_CLOCK_H */ |
diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h index 06367c37e1b2..5222a007bc21 100644 --- a/arch/mips/include/asm/mach-loongson/loongson.h +++ b/arch/mips/include/asm/mach-loongson/loongson.h | |||
@@ -245,7 +245,6 @@ static inline void do_perfcnt_IRQ(void) | |||
245 | 245 | ||
246 | #ifdef CONFIG_CPU_SUPPORTS_CPUFREQ | 246 | #ifdef CONFIG_CPU_SUPPORTS_CPUFREQ |
247 | #include <linux/cpufreq.h> | 247 | #include <linux/cpufreq.h> |
248 | extern void loongson2_cpu_wait(void); | ||
249 | extern struct cpufreq_frequency_table loongson2_clockmod_table[]; | 248 | extern struct cpufreq_frequency_table loongson2_clockmod_table[]; |
250 | 249 | ||
251 | /* Chip Config */ | 250 | /* Chip Config */ |
diff --git a/arch/mips/kernel/cpufreq/Makefile b/arch/mips/kernel/cpufreq/Makefile index c3479a432efe..05a5715ee38c 100644 --- a/arch/mips/kernel/cpufreq/Makefile +++ b/arch/mips/kernel/cpufreq/Makefile | |||
@@ -2,4 +2,4 @@ | |||
2 | # Makefile for the Linux/MIPS cpufreq. | 2 | # Makefile for the Linux/MIPS cpufreq. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_LOONGSON2_CPUFREQ) += loongson2_cpufreq.o loongson2_clock.o | 5 | obj-$(CONFIG_LOONGSON2_CPUFREQ) += loongson2_cpufreq.o |
diff --git a/arch/mips/kernel/cpufreq/loongson2_cpufreq.c b/arch/mips/kernel/cpufreq/loongson2_cpufreq.c index ae5db206347c..e7c98e2b78b6 100644 --- a/arch/mips/kernel/cpufreq/loongson2_cpufreq.c +++ b/arch/mips/kernel/cpufreq/loongson2_cpufreq.c | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | #include <asm/clock.h> | 20 | #include <asm/clock.h> |
21 | 21 | ||
22 | #include <loongson.h> | 22 | #include <asm/mach-loongson/loongson.h> |
23 | 23 | ||
24 | static uint nowait; | 24 | static uint nowait; |
25 | 25 | ||
@@ -181,6 +181,25 @@ static struct platform_driver platform_driver = { | |||
181 | .id_table = platform_device_ids, | 181 | .id_table = platform_device_ids, |
182 | }; | 182 | }; |
183 | 183 | ||
184 | /* | ||
185 | * This is the simple version of Loongson-2 wait, Maybe we need do this in | ||
186 | * interrupt disabled context. | ||
187 | */ | ||
188 | |||
189 | static DEFINE_SPINLOCK(loongson2_wait_lock); | ||
190 | |||
191 | static void loongson2_cpu_wait(void) | ||
192 | { | ||
193 | unsigned long flags; | ||
194 | u32 cpu_freq; | ||
195 | |||
196 | spin_lock_irqsave(&loongson2_wait_lock, flags); | ||
197 | cpu_freq = LOONGSON_CHIPCFG0; | ||
198 | LOONGSON_CHIPCFG0 &= ~0x7; /* Put CPU into wait mode */ | ||
199 | LOONGSON_CHIPCFG0 = cpu_freq; /* Restore CPU state */ | ||
200 | spin_unlock_irqrestore(&loongson2_wait_lock, flags); | ||
201 | } | ||
202 | |||
184 | static int __init cpufreq_init(void) | 203 | static int __init cpufreq_init(void) |
185 | { | 204 | { |
186 | int ret; | 205 | int ret; |
diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c index d3bcc33f4699..ce2f129b081f 100644 --- a/arch/mips/lantiq/clk.c +++ b/arch/mips/lantiq/clk.c | |||
@@ -135,6 +135,11 @@ void clk_deactivate(struct clk *clk) | |||
135 | } | 135 | } |
136 | EXPORT_SYMBOL(clk_deactivate); | 136 | EXPORT_SYMBOL(clk_deactivate); |
137 | 137 | ||
138 | struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec) | ||
139 | { | ||
140 | return NULL; | ||
141 | } | ||
142 | |||
138 | static inline u32 get_counter_resolution(void) | 143 | static inline u32 get_counter_resolution(void) |
139 | { | 144 | { |
140 | u32 res; | 145 | u32 res; |
diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c index d185e8477fdf..6cfd6117fbfd 100644 --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c | |||
@@ -8,7 +8,10 @@ | |||
8 | 8 | ||
9 | #include <linux/export.h> | 9 | #include <linux/export.h> |
10 | #include <linux/clk.h> | 10 | #include <linux/clk.h> |
11 | #include <linux/bootmem.h> | ||
11 | #include <linux/of_platform.h> | 12 | #include <linux/of_platform.h> |
13 | #include <linux/of_fdt.h> | ||
14 | |||
12 | #include <asm/bootinfo.h> | 15 | #include <asm/bootinfo.h> |
13 | #include <asm/time.h> | 16 | #include <asm/time.h> |
14 | 17 | ||
@@ -70,6 +73,25 @@ void __init plat_mem_setup(void) | |||
70 | __dt_setup_arch(&__dtb_start); | 73 | __dt_setup_arch(&__dtb_start); |
71 | } | 74 | } |
72 | 75 | ||
76 | void __init device_tree_init(void) | ||
77 | { | ||
78 | unsigned long base, size; | ||
79 | |||
80 | if (!initial_boot_params) | ||
81 | return; | ||
82 | |||
83 | base = virt_to_phys((void *)initial_boot_params); | ||
84 | size = be32_to_cpu(initial_boot_params->totalsize); | ||
85 | |||
86 | /* Before we do anything, lets reserve the dt blob */ | ||
87 | reserve_bootmem(base, size, BOOTMEM_DEFAULT); | ||
88 | |||
89 | unflatten_device_tree(); | ||
90 | |||
91 | /* free the space reserved for the dt blob */ | ||
92 | free_bootmem(base, size); | ||
93 | } | ||
94 | |||
73 | void __init prom_init(void) | 95 | void __init prom_init(void) |
74 | { | 96 | { |
75 | /* call the soc specific detetcion code and get it to fill soc_info */ | 97 | /* call the soc specific detetcion code and get it to fill soc_info */ |
diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c index 83780f7c842b..befbb760ab76 100644 --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c | |||
@@ -20,10 +20,12 @@ | |||
20 | 20 | ||
21 | /* clock control register */ | 21 | /* clock control register */ |
22 | #define CGU_IFCCR 0x0018 | 22 | #define CGU_IFCCR 0x0018 |
23 | #define CGU_IFCCR_VR9 0x0024 | ||
23 | /* system clock register */ | 24 | /* system clock register */ |
24 | #define CGU_SYS 0x0010 | 25 | #define CGU_SYS 0x0010 |
25 | /* pci control register */ | 26 | /* pci control register */ |
26 | #define CGU_PCICR 0x0034 | 27 | #define CGU_PCICR 0x0034 |
28 | #define CGU_PCICR_VR9 0x0038 | ||
27 | /* ephy configuration register */ | 29 | /* ephy configuration register */ |
28 | #define CGU_EPHY 0x10 | 30 | #define CGU_EPHY 0x10 |
29 | /* power control register */ | 31 | /* power control register */ |
@@ -80,6 +82,9 @@ static void __iomem *pmu_membase; | |||
80 | void __iomem *ltq_cgu_membase; | 82 | void __iomem *ltq_cgu_membase; |
81 | void __iomem *ltq_ebu_membase; | 83 | void __iomem *ltq_ebu_membase; |
82 | 84 | ||
85 | static u32 ifccr = CGU_IFCCR; | ||
86 | static u32 pcicr = CGU_PCICR; | ||
87 | |||
83 | /* legacy function kept alive to ease clkdev transition */ | 88 | /* legacy function kept alive to ease clkdev transition */ |
84 | void ltq_pmu_enable(unsigned int module) | 89 | void ltq_pmu_enable(unsigned int module) |
85 | { | 90 | { |
@@ -103,14 +108,14 @@ EXPORT_SYMBOL(ltq_pmu_disable); | |||
103 | /* enable a hw clock */ | 108 | /* enable a hw clock */ |
104 | static int cgu_enable(struct clk *clk) | 109 | static int cgu_enable(struct clk *clk) |
105 | { | 110 | { |
106 | ltq_cgu_w32(ltq_cgu_r32(CGU_IFCCR) | clk->bits, CGU_IFCCR); | 111 | ltq_cgu_w32(ltq_cgu_r32(ifccr) | clk->bits, ifccr); |
107 | return 0; | 112 | return 0; |
108 | } | 113 | } |
109 | 114 | ||
110 | /* disable a hw clock */ | 115 | /* disable a hw clock */ |
111 | static void cgu_disable(struct clk *clk) | 116 | static void cgu_disable(struct clk *clk) |
112 | { | 117 | { |
113 | ltq_cgu_w32(ltq_cgu_r32(CGU_IFCCR) & ~clk->bits, CGU_IFCCR); | 118 | ltq_cgu_w32(ltq_cgu_r32(ifccr) & ~clk->bits, ifccr); |
114 | } | 119 | } |
115 | 120 | ||
116 | /* enable a clock gate */ | 121 | /* enable a clock gate */ |
@@ -138,22 +143,22 @@ static void pmu_disable(struct clk *clk) | |||
138 | /* the pci enable helper */ | 143 | /* the pci enable helper */ |
139 | static int pci_enable(struct clk *clk) | 144 | static int pci_enable(struct clk *clk) |
140 | { | 145 | { |
141 | unsigned int ifccr = ltq_cgu_r32(CGU_IFCCR); | 146 | unsigned int val = ltq_cgu_r32(ifccr); |
142 | /* set bus clock speed */ | 147 | /* set bus clock speed */ |
143 | if (of_machine_is_compatible("lantiq,ar9")) { | 148 | if (of_machine_is_compatible("lantiq,ar9")) { |
144 | ifccr &= ~0x1f00000; | 149 | val &= ~0x1f00000; |
145 | if (clk->rate == CLOCK_33M) | 150 | if (clk->rate == CLOCK_33M) |
146 | ifccr |= 0xe00000; | 151 | val |= 0xe00000; |
147 | else | 152 | else |
148 | ifccr |= 0x700000; /* 62.5M */ | 153 | val |= 0x700000; /* 62.5M */ |
149 | } else { | 154 | } else { |
150 | ifccr &= ~0xf00000; | 155 | val &= ~0xf00000; |
151 | if (clk->rate == CLOCK_33M) | 156 | if (clk->rate == CLOCK_33M) |
152 | ifccr |= 0x800000; | 157 | val |= 0x800000; |
153 | else | 158 | else |
154 | ifccr |= 0x400000; /* 62.5M */ | 159 | val |= 0x400000; /* 62.5M */ |
155 | } | 160 | } |
156 | ltq_cgu_w32(ifccr, CGU_IFCCR); | 161 | ltq_cgu_w32(val, ifccr); |
157 | pmu_enable(clk); | 162 | pmu_enable(clk); |
158 | return 0; | 163 | return 0; |
159 | } | 164 | } |
@@ -161,18 +166,16 @@ static int pci_enable(struct clk *clk) | |||
161 | /* enable the external clock as a source */ | 166 | /* enable the external clock as a source */ |
162 | static int pci_ext_enable(struct clk *clk) | 167 | static int pci_ext_enable(struct clk *clk) |
163 | { | 168 | { |
164 | ltq_cgu_w32(ltq_cgu_r32(CGU_IFCCR) & ~(1 << 16), | 169 | ltq_cgu_w32(ltq_cgu_r32(ifccr) & ~(1 << 16), ifccr); |
165 | CGU_IFCCR); | 170 | ltq_cgu_w32((1 << 30), pcicr); |
166 | ltq_cgu_w32((1 << 30), CGU_PCICR); | ||
167 | return 0; | 171 | return 0; |
168 | } | 172 | } |
169 | 173 | ||
170 | /* disable the external clock as a source */ | 174 | /* disable the external clock as a source */ |
171 | static void pci_ext_disable(struct clk *clk) | 175 | static void pci_ext_disable(struct clk *clk) |
172 | { | 176 | { |
173 | ltq_cgu_w32(ltq_cgu_r32(CGU_IFCCR) | (1 << 16), | 177 | ltq_cgu_w32(ltq_cgu_r32(ifccr) | (1 << 16), ifccr); |
174 | CGU_IFCCR); | 178 | ltq_cgu_w32((1 << 31) | (1 << 30), pcicr); |
175 | ltq_cgu_w32((1 << 31) | (1 << 30), CGU_PCICR); | ||
176 | } | 179 | } |
177 | 180 | ||
178 | /* enable a clockout source */ | 181 | /* enable a clockout source */ |
@@ -184,11 +187,11 @@ static int clkout_enable(struct clk *clk) | |||
184 | for (i = 0; i < 4; i++) { | 187 | for (i = 0; i < 4; i++) { |
185 | if (clk->rates[i] == clk->rate) { | 188 | if (clk->rates[i] == clk->rate) { |
186 | int shift = 14 - (2 * clk->module); | 189 | int shift = 14 - (2 * clk->module); |
187 | unsigned int ifccr = ltq_cgu_r32(CGU_IFCCR); | 190 | unsigned int val = ltq_cgu_r32(ifccr); |
188 | 191 | ||
189 | ifccr &= ~(3 << shift); | 192 | val &= ~(3 << shift); |
190 | ifccr |= i << shift; | 193 | val |= i << shift; |
191 | ltq_cgu_w32(ifccr, CGU_IFCCR); | 194 | ltq_cgu_w32(val, ifccr); |
192 | return 0; | 195 | return 0; |
193 | } | 196 | } |
194 | } | 197 | } |
@@ -336,8 +339,12 @@ void __init ltq_soc_init(void) | |||
336 | clkdev_add_clkout(); | 339 | clkdev_add_clkout(); |
337 | 340 | ||
338 | /* add the soc dependent clocks */ | 341 | /* add the soc dependent clocks */ |
339 | if (!of_machine_is_compatible("lantiq,vr9")) | 342 | if (of_machine_is_compatible("lantiq,vr9")) { |
343 | ifccr = CGU_IFCCR_VR9; | ||
344 | pcicr = CGU_PCICR_VR9; | ||
345 | } else { | ||
340 | clkdev_add_pmu("1e180000.etop", NULL, 0, PMU_PPE); | 346 | clkdev_add_pmu("1e180000.etop", NULL, 0, PMU_PPE); |
347 | } | ||
341 | 348 | ||
342 | if (!of_machine_is_compatible("lantiq,ase")) { | 349 | if (!of_machine_is_compatible("lantiq,ase")) { |
343 | clkdev_add_pmu("1e100c00.serial", NULL, 0, PMU_ASC1); | 350 | clkdev_add_pmu("1e100c00.serial", NULL, 0, PMU_ASC1); |
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig index aca93eed8779..263beb9322a8 100644 --- a/arch/mips/loongson/Kconfig +++ b/arch/mips/loongson/Kconfig | |||
@@ -41,6 +41,7 @@ config LEMOTE_MACH2F | |||
41 | select CSRC_R4K if ! MIPS_EXTERNAL_TIMER | 41 | select CSRC_R4K if ! MIPS_EXTERNAL_TIMER |
42 | select DMA_NONCOHERENT | 42 | select DMA_NONCOHERENT |
43 | select GENERIC_ISA_DMA_SUPPORT_BROKEN | 43 | select GENERIC_ISA_DMA_SUPPORT_BROKEN |
44 | select HAVE_CLK | ||
44 | select HW_HAS_PCI | 45 | select HW_HAS_PCI |
45 | select I8259 | 46 | select I8259 |
46 | select IRQ_CPU | 47 | select IRQ_CPU |
diff --git a/arch/mips/loongson/lemote-2f/Makefile b/arch/mips/loongson/lemote-2f/Makefile index 8699a53f0477..4f9eaa328a16 100644 --- a/arch/mips/loongson/lemote-2f/Makefile +++ b/arch/mips/loongson/lemote-2f/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for lemote loongson2f family machines | 2 | # Makefile for lemote loongson2f family machines |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y += machtype.o irq.o reset.o ec_kb3310b.o | 5 | obj-y += clock.o machtype.o irq.o reset.o ec_kb3310b.o |
6 | 6 | ||
7 | # | 7 | # |
8 | # Suspend Support | 8 | # Suspend Support |
diff --git a/arch/mips/kernel/cpufreq/loongson2_clock.c b/arch/mips/loongson/lemote-2f/clock.c index 5426779d9fdb..bc739d4bab2e 100644 --- a/arch/mips/kernel/cpufreq/loongson2_clock.c +++ b/arch/mips/loongson/lemote-2f/clock.c | |||
@@ -6,14 +6,17 @@ | |||
6 | * License. See the file "COPYING" in the main directory of this archive | 6 | * License. See the file "COPYING" in the main directory of this archive |
7 | * for more details. | 7 | * for more details. |
8 | */ | 8 | */ |
9 | 9 | #include <linux/clk.h> | |
10 | #include <linux/module.h> | ||
11 | #include <linux/cpufreq.h> | 10 | #include <linux/cpufreq.h> |
12 | #include <linux/platform_device.h> | 11 | #include <linux/errno.h> |
12 | #include <linux/export.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/list.h> | ||
15 | #include <linux/mutex.h> | ||
16 | #include <linux/spinlock.h> | ||
13 | 17 | ||
14 | #include <asm/clock.h> | 18 | #include <asm/clock.h> |
15 | 19 | #include <asm/mach-loongson/loongson.h> | |
16 | #include <loongson.h> | ||
17 | 20 | ||
18 | static LIST_HEAD(clock_list); | 21 | static LIST_HEAD(clock_list); |
19 | static DEFINE_SPINLOCK(clock_lock); | 22 | static DEFINE_SPINLOCK(clock_lock); |
@@ -89,12 +92,6 @@ EXPORT_SYMBOL(clk_put); | |||
89 | 92 | ||
90 | int clk_set_rate(struct clk *clk, unsigned long rate) | 93 | int clk_set_rate(struct clk *clk, unsigned long rate) |
91 | { | 94 | { |
92 | return clk_set_rate_ex(clk, rate, 0); | ||
93 | } | ||
94 | EXPORT_SYMBOL_GPL(clk_set_rate); | ||
95 | |||
96 | int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) | ||
97 | { | ||
98 | int ret = 0; | 95 | int ret = 0; |
99 | int regval; | 96 | int regval; |
100 | int i; | 97 | int i; |
@@ -103,7 +100,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) | |||
103 | unsigned long flags; | 100 | unsigned long flags; |
104 | 101 | ||
105 | spin_lock_irqsave(&clock_lock, flags); | 102 | spin_lock_irqsave(&clock_lock, flags); |
106 | ret = clk->ops->set_rate(clk, rate, algo_id); | 103 | ret = clk->ops->set_rate(clk, rate, 0); |
107 | spin_unlock_irqrestore(&clock_lock, flags); | 104 | spin_unlock_irqrestore(&clock_lock, flags); |
108 | } | 105 | } |
109 | 106 | ||
@@ -129,7 +126,7 @@ int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id) | |||
129 | 126 | ||
130 | return ret; | 127 | return ret; |
131 | } | 128 | } |
132 | EXPORT_SYMBOL_GPL(clk_set_rate_ex); | 129 | EXPORT_SYMBOL_GPL(clk_set_rate); |
133 | 130 | ||
134 | long clk_round_rate(struct clk *clk, unsigned long rate) | 131 | long clk_round_rate(struct clk *clk, unsigned long rate) |
135 | { | 132 | { |
@@ -146,26 +143,3 @@ long clk_round_rate(struct clk *clk, unsigned long rate) | |||
146 | return rate; | 143 | return rate; |
147 | } | 144 | } |
148 | EXPORT_SYMBOL_GPL(clk_round_rate); | 145 | EXPORT_SYMBOL_GPL(clk_round_rate); |
149 | |||
150 | /* | ||
151 | * This is the simple version of Loongson-2 wait, Maybe we need do this in | ||
152 | * interrupt disabled content | ||
153 | */ | ||
154 | |||
155 | DEFINE_SPINLOCK(loongson2_wait_lock); | ||
156 | void loongson2_cpu_wait(void) | ||
157 | { | ||
158 | u32 cpu_freq; | ||
159 | unsigned long flags; | ||
160 | |||
161 | spin_lock_irqsave(&loongson2_wait_lock, flags); | ||
162 | cpu_freq = LOONGSON_CHIPCFG0; | ||
163 | LOONGSON_CHIPCFG0 &= ~0x7; /* Put CPU into wait mode */ | ||
164 | LOONGSON_CHIPCFG0 = cpu_freq; /* Restore CPU state */ | ||
165 | spin_unlock_irqrestore(&loongson2_wait_lock, flags); | ||
166 | } | ||
167 | EXPORT_SYMBOL_GPL(loongson2_cpu_wait); | ||
168 | |||
169 | MODULE_AUTHOR("Yanhua <yanh@lemote.com>"); | ||
170 | MODULE_DESCRIPTION("cpufreq driver for Loongson 2F"); | ||
171 | MODULE_LICENSE("GPL"); | ||
diff --git a/arch/mips/loongson1/Kconfig b/arch/mips/loongson1/Kconfig index 237fa214de9f..a9a14d6e81af 100644 --- a/arch/mips/loongson1/Kconfig +++ b/arch/mips/loongson1/Kconfig | |||
@@ -15,6 +15,7 @@ config LOONGSON1_LS1B | |||
15 | select SYS_SUPPORTS_LITTLE_ENDIAN | 15 | select SYS_SUPPORTS_LITTLE_ENDIAN |
16 | select SYS_SUPPORTS_HIGHMEM | 16 | select SYS_SUPPORTS_HIGHMEM |
17 | select SYS_HAS_EARLY_PRINTK | 17 | select SYS_HAS_EARLY_PRINTK |
18 | select HAVE_CLK | ||
18 | 19 | ||
19 | endchoice | 20 | endchoice |
20 | 21 | ||
diff --git a/arch/mips/loongson1/common/clock.c b/arch/mips/loongson1/common/clock.c index 2d98fb030596..1bbbbec12085 100644 --- a/arch/mips/loongson1/common/clock.c +++ b/arch/mips/loongson1/common/clock.c | |||
@@ -38,12 +38,28 @@ struct clk *clk_get(struct device *dev, const char *name) | |||
38 | } | 38 | } |
39 | EXPORT_SYMBOL(clk_get); | 39 | EXPORT_SYMBOL(clk_get); |
40 | 40 | ||
41 | int clk_enable(struct clk *clk) | ||
42 | { | ||
43 | return 0; | ||
44 | } | ||
45 | EXPORT_SYMBOL(clk_enable); | ||
46 | |||
47 | void clk_disable(struct clk *clk) | ||
48 | { | ||
49 | } | ||
50 | EXPORT_SYMBOL(clk_disable); | ||
51 | |||
41 | unsigned long clk_get_rate(struct clk *clk) | 52 | unsigned long clk_get_rate(struct clk *clk) |
42 | { | 53 | { |
43 | return clk->rate; | 54 | return clk->rate; |
44 | } | 55 | } |
45 | EXPORT_SYMBOL(clk_get_rate); | 56 | EXPORT_SYMBOL(clk_get_rate); |
46 | 57 | ||
58 | void clk_put(struct clk *clk) | ||
59 | { | ||
60 | } | ||
61 | EXPORT_SYMBOL(clk_put); | ||
62 | |||
47 | static void pll_clk_init(struct clk *clk) | 63 | static void pll_clk_init(struct clk *clk) |
48 | { | 64 | { |
49 | u32 pll; | 65 | u32 pll; |
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig index 852ae4bb7a85..6d40bc783459 100644 --- a/arch/mips/txx9/Kconfig +++ b/arch/mips/txx9/Kconfig | |||
@@ -20,6 +20,7 @@ config MACH_TXX9 | |||
20 | select SYS_SUPPORTS_32BIT_KERNEL | 20 | select SYS_SUPPORTS_32BIT_KERNEL |
21 | select SYS_SUPPORTS_LITTLE_ENDIAN | 21 | select SYS_SUPPORTS_LITTLE_ENDIAN |
22 | select SYS_SUPPORTS_BIG_ENDIAN | 22 | select SYS_SUPPORTS_BIG_ENDIAN |
23 | select HAVE_CLK | ||
23 | 24 | ||
24 | config TOSHIBA_JMR3927 | 25 | config TOSHIBA_JMR3927 |
25 | bool "Toshiba JMR-TX3927 board" | 26 | bool "Toshiba JMR-TX3927 board" |