Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Side by Side Diff: arch/arm/mach-tegra/tegra2_clocks.c

Issue 6116004: Add 1.2GHz cpu clock support for T25 (Closed) Base URL: http://git.chromium.org/git/kernel-next.git@chromeos-2.6.36
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * arch/arm/mach-tegra/tegra2_clocks.c 2 * arch/arm/mach-tegra/tegra2_clocks.c
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * 5 *
6 * Author: 6 * Author:
7 * Colin Cross <ccross@google.com> 7 * Colin Cross <ccross@google.com>
8 * 8 *
9 * This software is licensed under the terms of the GNU General Public 9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and 10 * License version 2, as published by the Free Software Foundation, and
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 } 782 }
783 783
784 static int tegra2_pll_div_clk_set_rate(struct clk *c, unsigned long rate) 784 static int tegra2_pll_div_clk_set_rate(struct clk *c, unsigned long rate)
785 { 785 {
786 u32 val; 786 u32 val;
787 u32 new_val; 787 u32 new_val;
788 int divider_u71; 788 int divider_u71;
789 unsigned long parent_rate = clk_get_rate(c->parent); 789 unsigned long parent_rate = clk_get_rate(c->parent);
790 790
791 pr_debug("%s: %s %lu\n", __func__, c->name, rate); 791 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
792
Olof Johansson 2011/01/12 01:05:28 Unrelated change, please discard
jimmzhang 2011/01/12 01:22:56 will be removed.
792 if (c->flags & DIV_U71) { 793 if (c->flags & DIV_U71) {
793 divider_u71 = clk_div71_get_divider(parent_rate, rate); 794 divider_u71 = clk_div71_get_divider(parent_rate, rate);
794 if (divider_u71 >= 0) { 795 if (divider_u71 >= 0) {
795 val = clk_readl(c->reg); 796 val = clk_readl(c->reg);
796 new_val = val >> c->reg_shift; 797 new_val = val >> c->reg_shift;
797 new_val &= 0xFFFF; 798 new_val &= 0xFFFF;
798 if (c->flags & DIV_U71_FIXED) 799 if (c->flags & DIV_U71_FIXED)
799 new_val |= PLL_OUT_OVERRIDE; 800 new_val |= PLL_OUT_OVERRIDE;
800 new_val &= ~PLL_OUT_RATIO_MASK; 801 new_val &= ~PLL_OUT_RATIO_MASK;
801 new_val |= divider_u71 << PLL_OUT_RATIO_SHIFT; 802 new_val |= divider_u71 << PLL_OUT_RATIO_SHIFT;
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 .cf_min = 1000000, 1507 .cf_min = 1000000,
1507 .cf_max = 6000000, 1508 .cf_max = 6000000,
1508 .vco_min = 480000000, 1509 .vco_min = 480000000,
1509 .vco_max = 960000000, 1510 .vco_max = 960000000,
1510 .freq_table = tegra_pll_u_freq_table, 1511 .freq_table = tegra_pll_u_freq_table,
1511 .lock_delay = 1000, 1512 .lock_delay = 1000,
1512 }, 1513 },
1513 }; 1514 };
1514 1515
1515 static struct clk_pll_freq_table tegra_pll_x_freq_table[] = { 1516 static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
1517 /* 1.2 GHz */
1518 { 12000000, 1200000000, 600, 6, 1, 12},
1519 { 13000000, 1200000000, 923, 10, 1, 12},
1520 { 19200000, 1200000000, 750, 12, 1, 8},
1521 { 26000000, 1200000000, 600, 13, 1, 12},
1522
1516 /* 1 GHz */ 1523 /* 1 GHz */
1517 { 12000000, 1000000000, 1000, 12, 1, 12}, 1524 { 12000000, 1000000000, 1000, 12, 1, 12},
1518 { 13000000, 1000000000, 1000, 13, 1, 12}, 1525 { 13000000, 1000000000, 1000, 13, 1, 12},
1519 { 19200000, 1000000000, 625, 12, 1, 8}, 1526 { 19200000, 1000000000, 625, 12, 1, 8},
1520 { 26000000, 1000000000, 1000, 26, 1, 12}, 1527 { 26000000, 1000000000, 1000, 26, 1, 12},
1521 1528
1522 /* 912 MHz */ 1529 /* 912 MHz */
1523 { 12000000, 912000000, 912, 12, 1, 12}, 1530 { 12000000, 912000000, 912, 12, 1, 12},
1524 { 13000000, 912000000, 912, 13, 1, 12}, 1531 { 13000000, 912000000, 912, 13, 1, 12},
1525 { 19200000, 912000000, 760, 16, 1, 8}, 1532 { 19200000, 912000000, 760, 16, 1, 8},
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 1564
1558 { 0, 0, 0, 0, 0, 0 }, 1565 { 0, 0, 0, 0, 0, 0 },
1559 }; 1566 };
1560 1567
1561 static struct clk tegra_pll_x = { 1568 static struct clk tegra_pll_x = {
1562 .name = "pll_x", 1569 .name = "pll_x",
1563 .flags = PLL_HAS_CPCON | PLL_ALT_MISC_REG, 1570 .flags = PLL_HAS_CPCON | PLL_ALT_MISC_REG,
1564 .ops = &tegra_pllx_ops, 1571 .ops = &tegra_pllx_ops,
1565 .reg = 0xe0, 1572 .reg = 0xe0,
1566 .parent = &tegra_clk_m, 1573 .parent = &tegra_clk_m,
1567 » .max_rate = 1000000000, 1574 » .max_rate = 1200000000,
Olof Johansson 2011/01/12 01:05:28 Is it safe to set max_rate here? Shouldn't you upd
jimmzhang 2011/01/12 01:22:56 The max value is still limited by the cpu frequenc
Olof Johansson 2011/01/12 18:53:07 Ok, sounds good.
1568 .u.pll = { 1575 .u.pll = {
1569 .input_min = 2000000, 1576 .input_min = 2000000,
1570 .input_max = 31000000, 1577 .input_max = 31000000,
1571 .cf_min = 1000000, 1578 .cf_min = 1000000,
1572 .cf_max = 6000000, 1579 .cf_max = 6000000,
1573 .vco_min = 20000000, 1580 .vco_min = 20000000,
1574 .vco_max = 1200000000, 1581 .vco_max = 1200000000,
1575 .freq_table = tegra_pll_x_freq_table, 1582 .freq_table = tegra_pll_x_freq_table,
1576 .lock_delay = 300, 1583 .lock_delay = 300,
1577 }, 1584 },
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 { .input = &tegra_clk_32k, .value = 6}, 1713 { .input = &tegra_clk_32k, .value = 6},
1707 { .input = &tegra_pll_m_out1, .value = 7}, 1714 { .input = &tegra_pll_m_out1, .value = 7},
1708 { 0, 0}, 1715 { 0, 0},
1709 }; 1716 };
1710 1717
1711 static struct clk tegra_clk_cclk = { 1718 static struct clk tegra_clk_cclk = {
1712 .name = "cclk", 1719 .name = "cclk",
1713 .inputs = mux_cclk, 1720 .inputs = mux_cclk,
1714 .reg = 0x20, 1721 .reg = 0x20,
1715 .ops = &tegra_super_ops, 1722 .ops = &tegra_super_ops,
1716 » .max_rate = 1000000000, 1723 » .max_rate = 1200000000,
1717 }; 1724 };
1718 1725
1719 static struct clk tegra_clk_sclk = { 1726 static struct clk tegra_clk_sclk = {
1720 .name = "sclk", 1727 .name = "sclk",
1721 .inputs = mux_sclk, 1728 .inputs = mux_sclk,
1722 .reg = 0x28, 1729 .reg = 0x28,
1723 .ops = &tegra_super_ops, 1730 .ops = &tegra_super_ops,
1724 .max_rate = 240000000, 1731 .max_rate = 240000000,
1725 .u.shared_bus = { 1732 .u.shared_bus = {
1726 .min_rate = 120000000, 1733 .min_rate = 120000000,
1727 }, 1734 },
1728 }; 1735 };
1729 1736
1730 static struct clk tegra_clk_virtual_cpu = { 1737 static struct clk tegra_clk_virtual_cpu = {
1731 .name = "cpu", 1738 .name = "cpu",
1732 .parent = &tegra_clk_cclk, 1739 .parent = &tegra_clk_cclk,
1733 .ops = &tegra_cpu_ops, 1740 .ops = &tegra_cpu_ops,
1734 » .max_rate = 1000000000, 1741 » .max_rate = 1200000000,
1735 .u.cpu = { 1742 .u.cpu = {
1736 .main = &tegra_pll_x, 1743 .main = &tegra_pll_x,
1737 .backup = &tegra_pll_p, 1744 .backup = &tegra_pll_p,
1738 }, 1745 },
1739 }; 1746 };
1740 1747
1741 static struct clk tegra_clk_cop = { 1748 static struct clk tegra_clk_cop = {
1742 .name = "cop", 1749 .name = "cop",
1743 .parent = &tegra_clk_sclk, 1750 .parent = &tegra_clk_sclk,
1744 .ops = &tegra_cop_ops, 1751 .ops = &tegra_cop_ops,
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 2162
2156 off = CLK_OUT_ENB; 2163 off = CLK_OUT_ENB;
2157 for (i = 0; i < CLK_OUT_ENB_NUM; i++, off += 4) 2164 for (i = 0; i < CLK_OUT_ENB_NUM; i++, off += 4)
2158 clk_writel(*ctx++, off); 2165 clk_writel(*ctx++, off);
2159 wmb(); 2166 wmb();
2160 2167
2161 clk_writel(*ctx++, MISC_CLK_ENB); 2168 clk_writel(*ctx++, MISC_CLK_ENB);
2162 clk_writel(*ctx++, CLK_MASK_ARM); 2169 clk_writel(*ctx++, CLK_MASK_ARM);
2163 } 2170 }
2164 #endif 2171 #endif
OLDNEW
« arch/arm/mach-tegra/cpu-tegra.c ('K') | « arch/arm/mach-tegra/cpu-tegra.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698