aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv310
diff options
context:
space:
mode:
authorJongpill Lee <boyko.lee@samsung.com>2010-08-18 09:39:26 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-10-20 18:52:16 -0400
commit340ea1ef4b3d14d621f7a696341bf6cdf2bc188f (patch)
treef699ee688da470e691575cbaf78f55d87f6fcda3 /arch/arm/mach-s5pv310
parent37e017292f56f3d39fb497d7fc9038967095e230 (diff)
ARM: S5PV310: Adds SDMMC clock for S5PV310
This patch adds SDMMC clocks for S5PV310/S5PC210. Signed-off-by: Jongpill Lee <boyko.lee@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv310')
-rw-r--r--arch/arm/mach-s5pv310/clock.c142
1 files changed, 141 insertions, 1 deletions
diff --git a/arch/arm/mach-s5pv310/clock.c b/arch/arm/mach-s5pv310/clock.c
index a0bcd9f3bb8f..eb087ddb3125 100644
--- a/arch/arm/mach-s5pv310/clock.c
+++ b/arch/arm/mach-s5pv310/clock.c
@@ -51,11 +51,21 @@ static int s5pv310_clksrc_mask_top_ctrl(struct clk *clk, int enable)
51 return s5p_gatectrl(S5P_CLKSRC_MASK_TOP, clk, enable); 51 return s5p_gatectrl(S5P_CLKSRC_MASK_TOP, clk, enable);
52} 52}
53 53
54static int s5pv310_clksrc_mask_fsys_ctrl(struct clk *clk, int enable)
55{
56 return s5p_gatectrl(S5P_CLKSRC_MASK_FSYS, clk, enable);
57}
58
54static int s5pv310_clksrc_mask_peril0_ctrl(struct clk *clk, int enable) 59static int s5pv310_clksrc_mask_peril0_ctrl(struct clk *clk, int enable)
55{ 60{
56 return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL0, clk, enable); 61 return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL0, clk, enable);
57} 62}
58 63
64static int s5pv310_clk_ip_fsys_ctrl(struct clk *clk, int enable)
65{
66 return s5p_gatectrl(S5P_CLKGATE_IP_FSYS, clk, enable);
67}
68
59static int s5pv310_clk_ip_peril_ctrl(struct clk *clk, int enable) 69static int s5pv310_clk_ip_peril_ctrl(struct clk *clk, int enable)
60{ 70{
61 return s5p_gatectrl(S5P_CLKGATE_IP_PERIL, clk, enable); 71 return s5p_gatectrl(S5P_CLKGATE_IP_PERIL, clk, enable);
@@ -336,6 +346,36 @@ static struct clk init_clocks_disable[] = {
336 .parent = &clk_aclk_100.clk, 346 .parent = &clk_aclk_100.clk,
337 .enable = s5pv310_clk_ip_peril_ctrl, 347 .enable = s5pv310_clk_ip_peril_ctrl,
338 .ctrlbit = (1<<24), 348 .ctrlbit = (1<<24),
349 }, {
350 .name = "hsmmc",
351 .id = 0,
352 .parent = &clk_aclk_133.clk,
353 .enable = s5pv310_clk_ip_fsys_ctrl,
354 .ctrlbit = (1 << 5),
355 }, {
356 .name = "hsmmc",
357 .id = 1,
358 .parent = &clk_aclk_133.clk,
359 .enable = s5pv310_clk_ip_fsys_ctrl,
360 .ctrlbit = (1 << 6),
361 }, {
362 .name = "hsmmc",
363 .id = 2,
364 .parent = &clk_aclk_133.clk,
365 .enable = s5pv310_clk_ip_fsys_ctrl,
366 .ctrlbit = (1 << 7),
367 }, {
368 .name = "hsmmc",
369 .id = 3,
370 .parent = &clk_aclk_133.clk,
371 .enable = s5pv310_clk_ip_fsys_ctrl,
372 .ctrlbit = (1 << 8),
373 }, {
374 .name = "hsmmc",
375 .id = 4,
376 .parent = &clk_aclk_133.clk,
377 .enable = s5pv310_clk_ip_fsys_ctrl,
378 .ctrlbit = (1 << 9),
339 } 379 }
340}; 380};
341 381
@@ -390,6 +430,56 @@ static struct clksrc_sources clkset_group = {
390 .nr_sources = ARRAY_SIZE(clkset_group_list), 430 .nr_sources = ARRAY_SIZE(clkset_group_list),
391}; 431};
392 432
433static struct clksrc_clk clk_dout_mmc0 = {
434 .clk = {
435 .name = "dout_mmc0",
436 .id = -1,
437 },
438 .sources = &clkset_group,
439 .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 0, .size = 4 },
440 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 0, .size = 4 },
441};
442
443static struct clksrc_clk clk_dout_mmc1 = {
444 .clk = {
445 .name = "dout_mmc1",
446 .id = -1,
447 },
448 .sources = &clkset_group,
449 .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 4, .size = 4 },
450 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 16, .size = 4 },
451};
452
453static struct clksrc_clk clk_dout_mmc2 = {
454 .clk = {
455 .name = "dout_mmc2",
456 .id = -1,
457 },
458 .sources = &clkset_group,
459 .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 8, .size = 4 },
460 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 0, .size = 4 },
461};
462
463static struct clksrc_clk clk_dout_mmc3 = {
464 .clk = {
465 .name = "dout_mmc3",
466 .id = -1,
467 },
468 .sources = &clkset_group,
469 .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 12, .size = 4 },
470 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 16, .size = 4 },
471};
472
473static struct clksrc_clk clk_dout_mmc4 = {
474 .clk = {
475 .name = "dout_mmc4",
476 .id = -1,
477 },
478 .sources = &clkset_group,
479 .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 16, .size = 4 },
480 .reg_div = { .reg = S5P_CLKDIV_FSYS3, .shift = 0, .size = 4 },
481};
482
393static struct clksrc_clk clksrcs[] = { 483static struct clksrc_clk clksrcs[] = {
394 { 484 {
395 .clk = { 485 .clk = {
@@ -441,7 +531,52 @@ static struct clksrc_clk clksrcs[] = {
441 .sources = &clkset_group, 531 .sources = &clkset_group,
442 .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 24, .size = 4 }, 532 .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 24, .size = 4 },
443 .reg_div = { .reg = S5P_CLKDIV_PERIL3, .shift = 0, .size = 4 }, 533 .reg_div = { .reg = S5P_CLKDIV_PERIL3, .shift = 0, .size = 4 },
444 }, 534 }, {
535 .clk = {
536 .name = "sclk_mmc",
537 .id = 0,
538 .parent = &clk_dout_mmc0.clk,
539 .enable = s5pv310_clksrc_mask_fsys_ctrl,
540 .ctrlbit = (1 << 0),
541 },
542 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
543 }, {
544 .clk = {
545 .name = "sclk_mmc",
546 .id = 1,
547 .parent = &clk_dout_mmc1.clk,
548 .enable = s5pv310_clksrc_mask_fsys_ctrl,
549 .ctrlbit = (1 << 4),
550 },
551 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
552 }, {
553 .clk = {
554 .name = "sclk_mmc",
555 .id = 2,
556 .parent = &clk_dout_mmc2.clk,
557 .enable = s5pv310_clksrc_mask_fsys_ctrl,
558 .ctrlbit = (1 << 8),
559 },
560 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
561 }, {
562 .clk = {
563 .name = "sclk_mmc",
564 .id = 3,
565 .parent = &clk_dout_mmc3.clk,
566 .enable = s5pv310_clksrc_mask_fsys_ctrl,
567 .ctrlbit = (1 << 12),
568 },
569 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
570 }, {
571 .clk = {
572 .name = "sclk_mmc",
573 .id = 4,
574 .parent = &clk_dout_mmc4.clk,
575 .enable = s5pv310_clksrc_mask_fsys_ctrl,
576 .ctrlbit = (1 << 16),
577 },
578 .reg_div = { .reg = S5P_CLKDIV_FSYS3, .shift = 8, .size = 8 },
579 }
445}; 580};
446 581
447/* Clock initialization code */ 582/* Clock initialization code */
@@ -469,6 +604,11 @@ static struct clksrc_clk *sysclks[] = {
469 &clk_aclk_100, 604 &clk_aclk_100,
470 &clk_aclk_160, 605 &clk_aclk_160,
471 &clk_aclk_133, 606 &clk_aclk_133,
607 &clk_dout_mmc0,
608 &clk_dout_mmc1,
609 &clk_dout_mmc2,
610 &clk_dout_mmc3,
611 &clk_dout_mmc4,
472}; 612};
473 613
474void __init_or_cpufreq s5pv310_setup_clocks(void) 614void __init_or_cpufreq s5pv310_setup_clocks(void)