diff options
Diffstat (limited to 'arch/arm/mach-s3c2410/clock.c')
-rw-r--r-- | arch/arm/mach-s3c2410/clock.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c index c5c93c333ac6..e13fb6778890 100644 --- a/arch/arm/mach-s3c2410/clock.c +++ b/arch/arm/mach-s3c2410/clock.c | |||
@@ -213,7 +213,7 @@ EXPORT_SYMBOL(clk_set_parent); | |||
213 | 213 | ||
214 | /* base clocks */ | 214 | /* base clocks */ |
215 | 215 | ||
216 | static struct clk clk_xtal = { | 216 | struct clk clk_xtal = { |
217 | .name = "xtal", | 217 | .name = "xtal", |
218 | .id = -1, | 218 | .id = -1, |
219 | .rate = 0, | 219 | .rate = 0, |
@@ -221,6 +221,11 @@ static struct clk clk_xtal = { | |||
221 | .ctrlbit = 0, | 221 | .ctrlbit = 0, |
222 | }; | 222 | }; |
223 | 223 | ||
224 | struct clk clk_mpll = { | ||
225 | .name = "mpll", | ||
226 | .id = -1, | ||
227 | }; | ||
228 | |||
224 | struct clk clk_upll = { | 229 | struct clk clk_upll = { |
225 | .name = "upll", | 230 | .name = "upll", |
226 | .id = -1, | 231 | .id = -1, |
@@ -232,7 +237,7 @@ struct clk clk_f = { | |||
232 | .name = "fclk", | 237 | .name = "fclk", |
233 | .id = -1, | 238 | .id = -1, |
234 | .rate = 0, | 239 | .rate = 0, |
235 | .parent = NULL, | 240 | .parent = &clk_mpll, |
236 | .ctrlbit = 0, | 241 | .ctrlbit = 0, |
237 | }; | 242 | }; |
238 | 243 | ||
@@ -263,14 +268,14 @@ struct clk clk_usb_bus = { | |||
263 | 268 | ||
264 | static int s3c24xx_dclk_enable(struct clk *clk, int enable) | 269 | static int s3c24xx_dclk_enable(struct clk *clk, int enable) |
265 | { | 270 | { |
266 | unsigned long dclkcon = __raw_readl(S3C2410_DCLKCON); | 271 | unsigned long dclkcon = __raw_readl(S3C24XX_DCLKCON); |
267 | 272 | ||
268 | if (enable) | 273 | if (enable) |
269 | dclkcon |= clk->ctrlbit; | 274 | dclkcon |= clk->ctrlbit; |
270 | else | 275 | else |
271 | dclkcon &= ~clk->ctrlbit; | 276 | dclkcon &= ~clk->ctrlbit; |
272 | 277 | ||
273 | __raw_writel(dclkcon, S3C2410_DCLKCON); | 278 | __raw_writel(dclkcon, S3C24XX_DCLKCON); |
274 | 279 | ||
275 | return 0; | 280 | return 0; |
276 | } | 281 | } |
@@ -289,7 +294,7 @@ static int s3c24xx_dclk_setparent(struct clk *clk, struct clk *parent) | |||
289 | 294 | ||
290 | clk->parent = parent; | 295 | clk->parent = parent; |
291 | 296 | ||
292 | dclkcon = __raw_readl(S3C2410_DCLKCON); | 297 | dclkcon = __raw_readl(S3C24XX_DCLKCON); |
293 | 298 | ||
294 | if (clk->ctrlbit == S3C2410_DCLKCON_DCLK0EN) { | 299 | if (clk->ctrlbit == S3C2410_DCLKCON_DCLK0EN) { |
295 | if (uclk) | 300 | if (uclk) |
@@ -303,7 +308,7 @@ static int s3c24xx_dclk_setparent(struct clk *clk, struct clk *parent) | |||
303 | dclkcon &= ~S3C2410_DCLKCON_DCLK1_UCLK; | 308 | dclkcon &= ~S3C2410_DCLKCON_DCLK1_UCLK; |
304 | } | 309 | } |
305 | 310 | ||
306 | __raw_writel(dclkcon, S3C2410_DCLKCON); | 311 | __raw_writel(dclkcon, S3C24XX_DCLKCON); |
307 | 312 | ||
308 | return 0; | 313 | return 0; |
309 | } | 314 | } |
@@ -413,6 +418,7 @@ int __init s3c24xx_setup_clocks(unsigned long xtal, | |||
413 | clk_xtal.rate = xtal; | 418 | clk_xtal.rate = xtal; |
414 | clk_upll.rate = s3c2410_get_pll(__raw_readl(S3C2410_UPLLCON), xtal); | 419 | clk_upll.rate = s3c2410_get_pll(__raw_readl(S3C2410_UPLLCON), xtal); |
415 | 420 | ||
421 | clk_mpll.rate = fclk; | ||
416 | clk_h.rate = hclk; | 422 | clk_h.rate = hclk; |
417 | clk_p.rate = pclk; | 423 | clk_p.rate = pclk; |
418 | clk_f.rate = fclk; | 424 | clk_f.rate = fclk; |
@@ -424,6 +430,9 @@ int __init s3c24xx_setup_clocks(unsigned long xtal, | |||
424 | if (s3c24xx_register_clock(&clk_xtal) < 0) | 430 | if (s3c24xx_register_clock(&clk_xtal) < 0) |
425 | printk(KERN_ERR "failed to register master xtal\n"); | 431 | printk(KERN_ERR "failed to register master xtal\n"); |
426 | 432 | ||
433 | if (s3c24xx_register_clock(&clk_mpll) < 0) | ||
434 | printk(KERN_ERR "failed to register mpll clock\n"); | ||
435 | |||
427 | if (s3c24xx_register_clock(&clk_upll) < 0) | 436 | if (s3c24xx_register_clock(&clk_upll) < 0) |
428 | printk(KERN_ERR "failed to register upll clock\n"); | 437 | printk(KERN_ERR "failed to register upll clock\n"); |
429 | 438 | ||