aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/spear/spear3xx_clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/spear/spear3xx_clock.c')
-rw-r--r--drivers/clk/spear/spear3xx_clock.c57
1 files changed, 36 insertions, 21 deletions
diff --git a/drivers/clk/spear/spear3xx_clock.c b/drivers/clk/spear/spear3xx_clock.c
index 080c3c5e33f6..c2d204315546 100644
--- a/drivers/clk/spear/spear3xx_clock.c
+++ b/drivers/clk/spear/spear3xx_clock.c
@@ -294,7 +294,8 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
294 clk_register_clkdev(clk, NULL, "a9400000.i2s"); 294 clk_register_clkdev(clk, NULL, "a9400000.i2s");
295 295
296 clk = clk_register_mux(NULL, "i2s_ref_clk", i2s_ref_parents, 296 clk = clk_register_mux(NULL, "i2s_ref_clk", i2s_ref_parents,
297 ARRAY_SIZE(i2s_ref_parents), CLK_SET_RATE_PARENT, 297 ARRAY_SIZE(i2s_ref_parents),
298 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
298 SPEAR320_CONTROL_REG, I2S_REF_PCLK_SHIFT, 299 SPEAR320_CONTROL_REG, I2S_REF_PCLK_SHIFT,
299 I2S_REF_PCLK_MASK, 0, &_lock); 300 I2S_REF_PCLK_MASK, 0, &_lock);
300 clk_register_clkdev(clk, "i2s_ref_clk", NULL); 301 clk_register_clkdev(clk, "i2s_ref_clk", NULL);
@@ -313,57 +314,66 @@ static void __init spear320_clk_init(void __iomem *soc_config_base)
313 clk_register_clkdev(clk, "hclk", "ab000000.eth"); 314 clk_register_clkdev(clk, "hclk", "ab000000.eth");
314 315
315 clk = clk_register_mux(NULL, "rs485_clk", uartx_parents, 316 clk = clk_register_mux(NULL, "rs485_clk", uartx_parents,
316 ARRAY_SIZE(uartx_parents), CLK_SET_RATE_PARENT, 317 ARRAY_SIZE(uartx_parents),
318 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
317 SPEAR320_EXT_CTRL_REG, SPEAR320_RS485_PCLK_SHIFT, 319 SPEAR320_EXT_CTRL_REG, SPEAR320_RS485_PCLK_SHIFT,
318 SPEAR320_UARTX_PCLK_MASK, 0, &_lock); 320 SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
319 clk_register_clkdev(clk, NULL, "a9300000.serial"); 321 clk_register_clkdev(clk, NULL, "a9300000.serial");
320 322
321 clk = clk_register_mux(NULL, "sdhci_clk", sdhci_parents, 323 clk = clk_register_mux(NULL, "sdhci_clk", sdhci_parents,
322 ARRAY_SIZE(sdhci_parents), CLK_SET_RATE_PARENT, 324 ARRAY_SIZE(sdhci_parents),
325 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
323 SPEAR320_CONTROL_REG, SDHCI_PCLK_SHIFT, SDHCI_PCLK_MASK, 326 SPEAR320_CONTROL_REG, SDHCI_PCLK_SHIFT, SDHCI_PCLK_MASK,
324 0, &_lock); 327 0, &_lock);
325 clk_register_clkdev(clk, NULL, "70000000.sdhci"); 328 clk_register_clkdev(clk, NULL, "70000000.sdhci");
326 329
327 clk = clk_register_mux(NULL, "smii_pclk", smii0_parents, 330 clk = clk_register_mux(NULL, "smii_pclk", smii0_parents,
328 ARRAY_SIZE(smii0_parents), 0, SPEAR320_CONTROL_REG, 331 ARRAY_SIZE(smii0_parents), CLK_SET_RATE_NO_REPARENT,
329 SMII_PCLK_SHIFT, SMII_PCLK_MASK, 0, &_lock); 332 SPEAR320_CONTROL_REG, SMII_PCLK_SHIFT, SMII_PCLK_MASK,
333 0, &_lock);
330 clk_register_clkdev(clk, NULL, "smii_pclk"); 334 clk_register_clkdev(clk, NULL, "smii_pclk");
331 335
332 clk = clk_register_fixed_factor(NULL, "smii_clk", "smii_pclk", 0, 1, 1); 336 clk = clk_register_fixed_factor(NULL, "smii_clk", "smii_pclk", 0, 1, 1);
333 clk_register_clkdev(clk, NULL, "smii"); 337 clk_register_clkdev(clk, NULL, "smii");
334 338
335 clk = clk_register_mux(NULL, "uart1_clk", uartx_parents, 339 clk = clk_register_mux(NULL, "uart1_clk", uartx_parents,
336 ARRAY_SIZE(uartx_parents), CLK_SET_RATE_PARENT, 340 ARRAY_SIZE(uartx_parents),
341 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
337 SPEAR320_CONTROL_REG, UART1_PCLK_SHIFT, UART1_PCLK_MASK, 342 SPEAR320_CONTROL_REG, UART1_PCLK_SHIFT, UART1_PCLK_MASK,
338 0, &_lock); 343 0, &_lock);
339 clk_register_clkdev(clk, NULL, "a3000000.serial"); 344 clk_register_clkdev(clk, NULL, "a3000000.serial");
340 345
341 clk = clk_register_mux(NULL, "uart2_clk", uartx_parents, 346 clk = clk_register_mux(NULL, "uart2_clk", uartx_parents,
342 ARRAY_SIZE(uartx_parents), CLK_SET_RATE_PARENT, 347 ARRAY_SIZE(uartx_parents),
348 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
343 SPEAR320_EXT_CTRL_REG, SPEAR320_UART2_PCLK_SHIFT, 349 SPEAR320_EXT_CTRL_REG, SPEAR320_UART2_PCLK_SHIFT,
344 SPEAR320_UARTX_PCLK_MASK, 0, &_lock); 350 SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
345 clk_register_clkdev(clk, NULL, "a4000000.serial"); 351 clk_register_clkdev(clk, NULL, "a4000000.serial");
346 352
347 clk = clk_register_mux(NULL, "uart3_clk", uartx_parents, 353 clk = clk_register_mux(NULL, "uart3_clk", uartx_parents,
348 ARRAY_SIZE(uartx_parents), CLK_SET_RATE_PARENT, 354 ARRAY_SIZE(uartx_parents),
355 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
349 SPEAR320_EXT_CTRL_REG, SPEAR320_UART3_PCLK_SHIFT, 356 SPEAR320_EXT_CTRL_REG, SPEAR320_UART3_PCLK_SHIFT,
350 SPEAR320_UARTX_PCLK_MASK, 0, &_lock); 357 SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
351 clk_register_clkdev(clk, NULL, "a9100000.serial"); 358 clk_register_clkdev(clk, NULL, "a9100000.serial");
352 359
353 clk = clk_register_mux(NULL, "uart4_clk", uartx_parents, 360 clk = clk_register_mux(NULL, "uart4_clk", uartx_parents,
354 ARRAY_SIZE(uartx_parents), CLK_SET_RATE_PARENT, 361 ARRAY_SIZE(uartx_parents),
362 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
355 SPEAR320_EXT_CTRL_REG, SPEAR320_UART4_PCLK_SHIFT, 363 SPEAR320_EXT_CTRL_REG, SPEAR320_UART4_PCLK_SHIFT,
356 SPEAR320_UARTX_PCLK_MASK, 0, &_lock); 364 SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
357 clk_register_clkdev(clk, NULL, "a9200000.serial"); 365 clk_register_clkdev(clk, NULL, "a9200000.serial");
358 366
359 clk = clk_register_mux(NULL, "uart5_clk", uartx_parents, 367 clk = clk_register_mux(NULL, "uart5_clk", uartx_parents,
360 ARRAY_SIZE(uartx_parents), CLK_SET_RATE_PARENT, 368 ARRAY_SIZE(uartx_parents),
369 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
361 SPEAR320_EXT_CTRL_REG, SPEAR320_UART5_PCLK_SHIFT, 370 SPEAR320_EXT_CTRL_REG, SPEAR320_UART5_PCLK_SHIFT,
362 SPEAR320_UARTX_PCLK_MASK, 0, &_lock); 371 SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
363 clk_register_clkdev(clk, NULL, "60000000.serial"); 372 clk_register_clkdev(clk, NULL, "60000000.serial");
364 373
365 clk = clk_register_mux(NULL, "uart6_clk", uartx_parents, 374 clk = clk_register_mux(NULL, "uart6_clk", uartx_parents,
366 ARRAY_SIZE(uartx_parents), CLK_SET_RATE_PARENT, 375 ARRAY_SIZE(uartx_parents),
376 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
367 SPEAR320_EXT_CTRL_REG, SPEAR320_UART6_PCLK_SHIFT, 377 SPEAR320_EXT_CTRL_REG, SPEAR320_UART6_PCLK_SHIFT,
368 SPEAR320_UARTX_PCLK_MASK, 0, &_lock); 378 SPEAR320_UARTX_PCLK_MASK, 0, &_lock);
369 clk_register_clkdev(clk, NULL, "60100000.serial"); 379 clk_register_clkdev(clk, NULL, "60100000.serial");
@@ -427,7 +437,8 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
427 clk_register_clkdev(clk1, "uart_syn_gclk", NULL); 437 clk_register_clkdev(clk1, "uart_syn_gclk", NULL);
428 438
429 clk = clk_register_mux(NULL, "uart0_mclk", uart0_parents, 439 clk = clk_register_mux(NULL, "uart0_mclk", uart0_parents,
430 ARRAY_SIZE(uart0_parents), CLK_SET_RATE_PARENT, 440 ARRAY_SIZE(uart0_parents),
441 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
431 PERIP_CLK_CFG, UART_CLK_SHIFT, UART_CLK_MASK, 0, 442 PERIP_CLK_CFG, UART_CLK_SHIFT, UART_CLK_MASK, 0,
432 &_lock); 443 &_lock);
433 clk_register_clkdev(clk, "uart0_mclk", NULL); 444 clk_register_clkdev(clk, "uart0_mclk", NULL);
@@ -444,7 +455,8 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
444 clk_register_clkdev(clk1, "firda_syn_gclk", NULL); 455 clk_register_clkdev(clk1, "firda_syn_gclk", NULL);
445 456
446 clk = clk_register_mux(NULL, "firda_mclk", firda_parents, 457 clk = clk_register_mux(NULL, "firda_mclk", firda_parents,
447 ARRAY_SIZE(firda_parents), CLK_SET_RATE_PARENT, 458 ARRAY_SIZE(firda_parents),
459 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
448 PERIP_CLK_CFG, FIRDA_CLK_SHIFT, FIRDA_CLK_MASK, 0, 460 PERIP_CLK_CFG, FIRDA_CLK_SHIFT, FIRDA_CLK_MASK, 0,
449 &_lock); 461 &_lock);
450 clk_register_clkdev(clk, "firda_mclk", NULL); 462 clk_register_clkdev(clk, "firda_mclk", NULL);
@@ -458,14 +470,16 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
458 clk_register_gpt("gpt0_syn_clk", "pll1_clk", 0, PRSC0_CLK_CFG, gpt_rtbl, 470 clk_register_gpt("gpt0_syn_clk", "pll1_clk", 0, PRSC0_CLK_CFG, gpt_rtbl,
459 ARRAY_SIZE(gpt_rtbl), &_lock); 471 ARRAY_SIZE(gpt_rtbl), &_lock);
460 clk = clk_register_mux(NULL, "gpt0_clk", gpt0_parents, 472 clk = clk_register_mux(NULL, "gpt0_clk", gpt0_parents,
461 ARRAY_SIZE(gpt0_parents), CLK_SET_RATE_PARENT, 473 ARRAY_SIZE(gpt0_parents),
474 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
462 PERIP_CLK_CFG, GPT0_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); 475 PERIP_CLK_CFG, GPT0_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock);
463 clk_register_clkdev(clk, NULL, "gpt0"); 476 clk_register_clkdev(clk, NULL, "gpt0");
464 477
465 clk_register_gpt("gpt1_syn_clk", "pll1_clk", 0, PRSC1_CLK_CFG, gpt_rtbl, 478 clk_register_gpt("gpt1_syn_clk", "pll1_clk", 0, PRSC1_CLK_CFG, gpt_rtbl,
466 ARRAY_SIZE(gpt_rtbl), &_lock); 479 ARRAY_SIZE(gpt_rtbl), &_lock);
467 clk = clk_register_mux(NULL, "gpt1_mclk", gpt1_parents, 480 clk = clk_register_mux(NULL, "gpt1_mclk", gpt1_parents,
468 ARRAY_SIZE(gpt1_parents), CLK_SET_RATE_PARENT, 481 ARRAY_SIZE(gpt1_parents),
482 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
469 PERIP_CLK_CFG, GPT1_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); 483 PERIP_CLK_CFG, GPT1_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock);
470 clk_register_clkdev(clk, "gpt1_mclk", NULL); 484 clk_register_clkdev(clk, "gpt1_mclk", NULL);
471 clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mclk", 485 clk = clk_register_gate(NULL, "gpt1_clk", "gpt1_mclk",
@@ -476,7 +490,8 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
476 clk_register_gpt("gpt2_syn_clk", "pll1_clk", 0, PRSC2_CLK_CFG, gpt_rtbl, 490 clk_register_gpt("gpt2_syn_clk", "pll1_clk", 0, PRSC2_CLK_CFG, gpt_rtbl,
477 ARRAY_SIZE(gpt_rtbl), &_lock); 491 ARRAY_SIZE(gpt_rtbl), &_lock);
478 clk = clk_register_mux(NULL, "gpt2_mclk", gpt2_parents, 492 clk = clk_register_mux(NULL, "gpt2_mclk", gpt2_parents,
479 ARRAY_SIZE(gpt2_parents), CLK_SET_RATE_PARENT, 493 ARRAY_SIZE(gpt2_parents),
494 CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
480 PERIP_CLK_CFG, GPT2_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock); 495 PERIP_CLK_CFG, GPT2_CLK_SHIFT, GPT_CLK_MASK, 0, &_lock);
481 clk_register_clkdev(clk, "gpt2_mclk", NULL); 496 clk_register_clkdev(clk, "gpt2_mclk", NULL);
482 clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mclk", 497 clk = clk_register_gate(NULL, "gpt2_clk", "gpt2_mclk",
@@ -498,9 +513,9 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
498 clk_register_clkdev(clk1, "gen1_syn_gclk", NULL); 513 clk_register_clkdev(clk1, "gen1_syn_gclk", NULL);
499 514
500 clk = clk_register_mux(NULL, "gen2_3_par_clk", gen2_3_parents, 515 clk = clk_register_mux(NULL, "gen2_3_par_clk", gen2_3_parents,
501 ARRAY_SIZE(gen2_3_parents), 0, CORE_CLK_CFG, 516 ARRAY_SIZE(gen2_3_parents), CLK_SET_RATE_NO_REPARENT,
502 GEN_SYNTH2_3_CLK_SHIFT, GEN_SYNTH2_3_CLK_MASK, 0, 517 CORE_CLK_CFG, GEN_SYNTH2_3_CLK_SHIFT,
503 &_lock); 518 GEN_SYNTH2_3_CLK_MASK, 0, &_lock);
504 clk_register_clkdev(clk, "gen2_3_par_clk", NULL); 519 clk_register_clkdev(clk, "gen2_3_par_clk", NULL);
505 520
506 clk = clk_register_aux("gen2_syn_clk", "gen2_syn_gclk", 521 clk = clk_register_aux("gen2_syn_clk", "gen2_syn_gclk",
@@ -540,8 +555,8 @@ void __init spear3xx_clk_init(void __iomem *misc_base, void __iomem *soc_config_
540 clk_register_clkdev(clk, "ahbmult2_clk", NULL); 555 clk_register_clkdev(clk, "ahbmult2_clk", NULL);
541 556
542 clk = clk_register_mux(NULL, "ddr_clk", ddr_parents, 557 clk = clk_register_mux(NULL, "ddr_clk", ddr_parents,
543 ARRAY_SIZE(ddr_parents), 0, PLL_CLK_CFG, MCTR_CLK_SHIFT, 558 ARRAY_SIZE(ddr_parents), CLK_SET_RATE_NO_REPARENT,
544 MCTR_CLK_MASK, 0, &_lock); 559 PLL_CLK_CFG, MCTR_CLK_SHIFT, MCTR_CLK_MASK, 0, &_lock);
545 clk_register_clkdev(clk, "ddr_clk", NULL); 560 clk_register_clkdev(clk, "ddr_clk", NULL);
546 561
547 clk = clk_register_divider(NULL, "apb_clk", "ahb_clk", 562 clk = clk_register_divider(NULL, "apb_clk", "ahb_clk",