diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-01-14 15:09:34 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-02 04:35:37 -0400 |
commit | d1914c7e75cff736e2c2dac13ad2fe20c2567e68 (patch) | |
tree | a9913c63b86caf9122b6b1246e8045b9b436c98e /arch/arm/mach-realview | |
parent | f5fc00826d1e60af0e22cb9f65b933d823a8ed84 (diff) |
ARM: Make Integrator/Versatile/Reaview VCO code similar
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-realview')
-rw-r--r-- | arch/arm/mach-realview/core.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-realview/include/mach/clkdev.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c index f97f001e874b..043b93bab7df 100644 --- a/arch/arm/mach-realview/core.c +++ b/arch/arm/mach-realview/core.c | |||
@@ -271,19 +271,13 @@ static const struct icst_params realview_oscvco_params = { | |||
271 | static void realview_oscvco_set(struct clk *clk, struct icst_vco vco) | 271 | static void realview_oscvco_set(struct clk *clk, struct icst_vco vco) |
272 | { | 272 | { |
273 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; | 273 | void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; |
274 | void __iomem *sys_osc; | ||
275 | u32 val; | 274 | u32 val; |
276 | 275 | ||
277 | if (machine_is_realview_pb1176()) | 276 | val = readl(clk->vcoreg) & ~0x7ffff; |
278 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
279 | else | ||
280 | sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
281 | |||
282 | val = readl(sys_osc) & ~0x7ffff; | ||
283 | val |= vco.v | (vco.r << 9) | (vco.s << 16); | 277 | val |= vco.v | (vco.r << 9) | (vco.s << 16); |
284 | 278 | ||
285 | writel(0xa05f, sys_lock); | 279 | writel(0xa05f, sys_lock); |
286 | writel(val, sys_osc); | 280 | writel(val, clk->vcoreg); |
287 | writel(0, sys_lock); | 281 | writel(0, sys_lock); |
288 | } | 282 | } |
289 | 283 | ||
@@ -332,7 +326,13 @@ static struct clk_lookup lookups[] = { | |||
332 | 326 | ||
333 | static int __init clk_init(void) | 327 | static int __init clk_init(void) |
334 | { | 328 | { |
329 | if (machine_is_realview_pb1176()) | ||
330 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; | ||
331 | else | ||
332 | oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; | ||
333 | |||
335 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | 334 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); |
335 | |||
336 | return 0; | 336 | return 0; |
337 | } | 337 | } |
338 | arch_initcall(clk_init); | 338 | arch_initcall(clk_init); |
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h index fefe4671255c..baea03c9ad45 100644 --- a/arch/arm/mach-realview/include/mach/clkdev.h +++ b/arch/arm/mach-realview/include/mach/clkdev.h | |||
@@ -6,7 +6,7 @@ | |||
6 | struct clk { | 6 | struct clk { |
7 | unsigned long rate; | 7 | unsigned long rate; |
8 | const struct icst_params *params; | 8 | const struct icst_params *params; |
9 | u32 oscoff; | 9 | void __iomem *vcoreg; |
10 | void (*setvco)(struct clk *, struct icst_vco vco); | 10 | void (*setvco)(struct clk *, struct icst_vco vco); |
11 | }; | 11 | }; |
12 | 12 | ||