aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/tegra
diff options
context:
space:
mode:
authorPeter De Schrijver <pdeschrijver@nvidia.com>2013-06-05 09:51:26 -0400
committerMike Turquette <mturquette@linaro.org>2013-06-11 20:39:24 -0400
commitfd428ad87b1f4a12820de07ecb3a155c51c802c7 (patch)
tree755d87693bbd63036a55b835a786c4171d8fee35 /drivers/clk/tegra
parentaa6fefde62401a84154161a8026872874a70e4c1 (diff)
clk: tegra: PLL m,n,p init for Tegra114
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/tegra')
-rw-r--r--drivers/clk/tegra/clk-tegra114.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
index 2dd9b0094c97..db9b1ae1c743 100644
--- a/drivers/clk/tegra/clk-tegra114.c
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -265,6 +265,15 @@ static DEFINE_SPINLOCK(clk_doubler_lock);
265static DEFINE_SPINLOCK(clk_out_lock); 265static DEFINE_SPINLOCK(clk_out_lock);
266static DEFINE_SPINLOCK(sysrate_lock); 266static DEFINE_SPINLOCK(sysrate_lock);
267 267
268static struct div_nmp pllxc_nmp = {
269 .divm_shift = 0,
270 .divm_width = 8,
271 .divn_shift = 8,
272 .divn_width = 8,
273 .divp_shift = 20,
274 .divp_width = 4,
275};
276
268static struct pdiv_map pllxc_p[] = { 277static struct pdiv_map pllxc_p[] = {
269 { .pdiv = 1, .hw_val = 0 }, 278 { .pdiv = 1, .hw_val = 0 },
270 { .pdiv = 2, .hw_val = 1 }, 279 { .pdiv = 2, .hw_val = 1 },
@@ -313,6 +322,16 @@ static struct tegra_clk_pll_params pll_c_params = {
313 .stepa_shift = 17, 322 .stepa_shift = 17,
314 .stepb_shift = 9, 323 .stepb_shift = 9,
315 .pdiv_tohw = pllxc_p, 324 .pdiv_tohw = pllxc_p,
325 .div_nmp = &pllxc_nmp,
326};
327
328static struct div_nmp pllcx_nmp = {
329 .divm_shift = 0,
330 .divm_width = 2,
331 .divn_shift = 8,
332 .divn_width = 8,
333 .divp_shift = 20,
334 .divp_width = 3,
316}; 335};
317 336
318static struct pdiv_map pllc_p[] = { 337static struct pdiv_map pllc_p[] = {
@@ -346,6 +365,8 @@ static struct tegra_clk_pll_params pll_c2_params = {
346 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 365 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
347 .lock_delay = 300, 366 .lock_delay = 300,
348 .pdiv_tohw = pllc_p, 367 .pdiv_tohw = pllc_p,
368 .div_nmp = &pllcx_nmp,
369 .max_p = 7,
349 .ext_misc_reg[0] = 0x4f0, 370 .ext_misc_reg[0] = 0x4f0,
350 .ext_misc_reg[1] = 0x4f4, 371 .ext_misc_reg[1] = 0x4f4,
351 .ext_misc_reg[2] = 0x4f8, 372 .ext_misc_reg[2] = 0x4f8,
@@ -364,11 +385,22 @@ static struct tegra_clk_pll_params pll_c3_params = {
364 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 385 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
365 .lock_delay = 300, 386 .lock_delay = 300,
366 .pdiv_tohw = pllc_p, 387 .pdiv_tohw = pllc_p,
388 .div_nmp = &pllcx_nmp,
389 .max_p = 7,
367 .ext_misc_reg[0] = 0x504, 390 .ext_misc_reg[0] = 0x504,
368 .ext_misc_reg[1] = 0x508, 391 .ext_misc_reg[1] = 0x508,
369 .ext_misc_reg[2] = 0x50c, 392 .ext_misc_reg[2] = 0x50c,
370}; 393};
371 394
395static struct div_nmp pllm_nmp = {
396 .divm_shift = 0,
397 .divm_width = 8,
398 .divn_shift = 8,
399 .divn_width = 8,
400 .divp_shift = 20,
401 .divp_width = 1,
402};
403
372static struct pdiv_map pllm_p[] = { 404static struct pdiv_map pllm_p[] = {
373 { .pdiv = 1, .hw_val = 0 }, 405 { .pdiv = 1, .hw_val = 0 },
374 { .pdiv = 2, .hw_val = 1 }, 406 { .pdiv = 2, .hw_val = 1 },
@@ -398,6 +430,16 @@ static struct tegra_clk_pll_params pll_m_params = {
398 .lock_delay = 300, 430 .lock_delay = 300,
399 .max_p = 2, 431 .max_p = 2,
400 .pdiv_tohw = pllm_p, 432 .pdiv_tohw = pllm_p,
433 .div_nmp = &pllm_nmp,
434};
435
436static struct div_nmp pllp_nmp = {
437 .divm_shift = 0,
438 .divm_width = 5,
439 .divn_shift = 8,
440 .divn_width = 10,
441 .divp_shift = 20,
442 .divp_width = 3,
401}; 443};
402 444
403static struct tegra_clk_pll_freq_table pll_p_freq_table[] = { 445static struct tegra_clk_pll_freq_table pll_p_freq_table[] = {
@@ -421,6 +463,7 @@ static struct tegra_clk_pll_params pll_p_params = {
421 .lock_mask = PLL_BASE_LOCK, 463 .lock_mask = PLL_BASE_LOCK,
422 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 464 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
423 .lock_delay = 300, 465 .lock_delay = 300,
466 .div_nmp = &pllp_nmp,
424}; 467};
425 468
426static struct tegra_clk_pll_freq_table pll_a_freq_table[] = { 469static struct tegra_clk_pll_freq_table pll_a_freq_table[] = {
@@ -447,6 +490,7 @@ static struct tegra_clk_pll_params pll_a_params = {
447 .lock_mask = PLL_BASE_LOCK, 490 .lock_mask = PLL_BASE_LOCK,
448 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 491 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
449 .lock_delay = 300, 492 .lock_delay = 300,
493 .div_nmp = &pllp_nmp,
450}; 494};
451 495
452static struct tegra_clk_pll_freq_table pll_d_freq_table[] = { 496static struct tegra_clk_pll_freq_table pll_d_freq_table[] = {
@@ -482,6 +526,7 @@ static struct tegra_clk_pll_params pll_d_params = {
482 .lock_mask = PLL_BASE_LOCK, 526 .lock_mask = PLL_BASE_LOCK,
483 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 527 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
484 .lock_delay = 1000, 528 .lock_delay = 1000,
529 .div_nmp = &pllp_nmp,
485}; 530};
486 531
487static struct tegra_clk_pll_params pll_d2_params = { 532static struct tegra_clk_pll_params pll_d2_params = {
@@ -496,6 +541,7 @@ static struct tegra_clk_pll_params pll_d2_params = {
496 .lock_mask = PLL_BASE_LOCK, 541 .lock_mask = PLL_BASE_LOCK,
497 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 542 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
498 .lock_delay = 1000, 543 .lock_delay = 1000,
544 .div_nmp = &pllp_nmp,
499}; 545};
500 546
501static struct pdiv_map pllu_p[] = { 547static struct pdiv_map pllu_p[] = {
@@ -504,6 +550,15 @@ static struct pdiv_map pllu_p[] = {
504 { .pdiv = 0, .hw_val = 0 }, 550 { .pdiv = 0, .hw_val = 0 },
505}; 551};
506 552
553static struct div_nmp pllu_nmp = {
554 .divm_shift = 0,
555 .divm_width = 5,
556 .divn_shift = 8,
557 .divn_width = 10,
558 .divp_shift = 20,
559 .divp_width = 1,
560};
561
507static struct tegra_clk_pll_freq_table pll_u_freq_table[] = { 562static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
508 {12000000, 480000000, 960, 12, 0, 12}, 563 {12000000, 480000000, 960, 12, 0, 12},
509 {13000000, 480000000, 960, 13, 0, 12}, 564 {13000000, 480000000, 960, 13, 0, 12},
@@ -526,6 +581,7 @@ static struct tegra_clk_pll_params pll_u_params = {
526 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 581 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
527 .lock_delay = 1000, 582 .lock_delay = 1000,
528 .pdiv_tohw = pllu_p, 583 .pdiv_tohw = pllu_p,
584 .div_nmp = &pllu_nmp,
529}; 585};
530 586
531static struct tegra_clk_pll_freq_table pll_x_freq_table[] = { 587static struct tegra_clk_pll_freq_table pll_x_freq_table[] = {
@@ -558,6 +614,7 @@ static struct tegra_clk_pll_params pll_x_params = {
558 .stepa_shift = 16, 614 .stepa_shift = 16,
559 .stepb_shift = 24, 615 .stepb_shift = 24,
560 .pdiv_tohw = pllxc_p, 616 .pdiv_tohw = pllxc_p,
617 .div_nmp = &pllxc_nmp,
561}; 618};
562 619
563static struct tegra_clk_pll_freq_table pll_e_freq_table[] = { 620static struct tegra_clk_pll_freq_table pll_e_freq_table[] = {
@@ -567,6 +624,15 @@ static struct tegra_clk_pll_freq_table pll_e_freq_table[] = {
567 {0, 0, 0, 0, 0, 0}, 624 {0, 0, 0, 0, 0, 0},
568}; 625};
569 626
627static struct div_nmp plle_nmp = {
628 .divm_shift = 0,
629 .divm_width = 8,
630 .divn_shift = 8,
631 .divn_width = 8,
632 .divp_shift = 24,
633 .divp_width = 4,
634};
635
570static struct tegra_clk_pll_params pll_e_params = { 636static struct tegra_clk_pll_params pll_e_params = {
571 .input_min = 12000000, 637 .input_min = 12000000,
572 .input_max = 1000000000, 638 .input_max = 1000000000,
@@ -580,6 +646,16 @@ static struct tegra_clk_pll_params pll_e_params = {
580 .lock_mask = PLLE_MISC_LOCK, 646 .lock_mask = PLLE_MISC_LOCK,
581 .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE, 647 .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE,
582 .lock_delay = 300, 648 .lock_delay = 300,
649 .div_nmp = &plle_nmp,
650};
651
652static struct div_nmp pllre_nmp = {
653 .divm_shift = 0,
654 .divm_width = 8,
655 .divn_shift = 8,
656 .divn_width = 8,
657 .divp_shift = 16,
658 .divp_width = 4,
583}; 659};
584 660
585static struct tegra_clk_pll_params pll_re_vco_params = { 661static struct tegra_clk_pll_params pll_re_vco_params = {
@@ -596,6 +672,7 @@ static struct tegra_clk_pll_params pll_re_vco_params = {
596 .lock_delay = 300, 672 .lock_delay = 300,
597 .iddq_reg = PLLRE_MISC, 673 .iddq_reg = PLLRE_MISC,
598 .iddq_bit_idx = PLLRE_IDDQ_BIT, 674 .iddq_bit_idx = PLLRE_IDDQ_BIT,
675 .div_nmp = &pllre_nmp,
599}; 676};
600 677
601/* Peripheral clock registers */ 678/* Peripheral clock registers */