aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2013-01-11 02:46:26 -0500
committerStephen Warren <swarren@nvidia.com>2013-01-28 13:19:07 -0500
commit61fd290d213e25d5a119b8ca25644001ed9f8f2d (patch)
tree16d8d1da34b5970985145c14cd6b8a624486abba /arch
parentb08e8c0ecc42afa3a2e1019851af741980dd5a6b (diff)
ARM: tegra: migrate to new clock code
Migrate Tegra clock support to drivers/clk/tegra, this involves moving: 1. definition of tegra_cpu_car_ops to clk.c 2. definition of reset functions to clk-peripheral.c 3. change parent of cpu clock. 4. Remove legacy clock initialization. 5. Initialize clocks using DT. 6. Remove all instance of mach/clk.h Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com> [swarren: use to_clk_periph_gate().] Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra20.c30
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra30.c31
-rw-r--r--arch/arm/mach-tegra/clock.c19
-rw-r--r--arch/arm/mach-tegra/common.c44
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c2
-rw-r--r--arch/arm/mach-tegra/include/mach/clk.h3
-rw-r--r--arch/arm/mach-tegra/pcie.c2
-rw-r--r--arch/arm/mach-tegra/powergate.c2
8 files changed, 5 insertions, 128 deletions
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index e1f87dd314ef..0c11b8af3af3 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -42,7 +42,6 @@
42#include <asm/setup.h> 42#include <asm/setup.h>
43 43
44#include "board.h" 44#include "board.h"
45#include "clock.h"
46#include "common.h" 45#include "common.h"
47#include "iomap.h" 46#include "iomap.h"
48 47
@@ -104,37 +103,8 @@ static struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
104 {} 103 {}
105}; 104};
106 105
107static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
108 /* name parent rate enabled */
109 { "uarta", "pll_p", 216000000, true },
110 { "uartd", "pll_p", 216000000, true },
111 { "usbd", "clk_m", 12000000, false },
112 { "usb2", "clk_m", 12000000, false },
113 { "usb3", "clk_m", 12000000, false },
114 { "pll_a", "pll_p_out1", 56448000, true },
115 { "pll_a_out0", "pll_a", 11289600, true },
116 { "cdev1", NULL, 0, true },
117 { "blink", "clk_32k", 32768, true },
118 { "i2s1", "pll_a_out0", 11289600, false},
119 { "i2s2", "pll_a_out0", 11289600, false},
120 { "sdmmc1", "pll_p", 48000000, false},
121 { "sdmmc3", "pll_p", 48000000, false},
122 { "sdmmc4", "pll_p", 48000000, false},
123 { "spi", "pll_p", 20000000, false },
124 { "sbc1", "pll_p", 100000000, false },
125 { "sbc2", "pll_p", 100000000, false },
126 { "sbc3", "pll_p", 100000000, false },
127 { "sbc4", "pll_p", 100000000, false },
128 { "host1x", "pll_c", 150000000, false },
129 { "disp1", "pll_p", 600000000, false },
130 { "disp2", "pll_p", 600000000, false },
131 { NULL, NULL, 0, 0},
132};
133
134static void __init tegra_dt_init(void) 106static void __init tegra_dt_init(void)
135{ 107{
136 tegra_clk_init_from_table(tegra_dt_clk_init_table);
137
138 /* 108 /*
139 * Finished with the static registrations now; fill in the missing 109 * Finished with the static registrations now; fill in the missing
140 * devices 110 * devices
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index cfe5fc02be77..92f6014d22a1 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -35,7 +35,6 @@
35#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
36 36
37#include "board.h" 37#include "board.h"
38#include "clock.h"
39#include "common.h" 38#include "common.h"
40#include "iomap.h" 39#include "iomap.h"
41 40
@@ -67,38 +66,8 @@ static struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
67 {} 66 {}
68}; 67};
69 68
70static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
71 /* name parent rate enabled */
72 { "uarta", "pll_p", 408000000, true },
73 { "pll_a", "pll_p_out1", 564480000, true },
74 { "pll_a_out0", "pll_a", 11289600, true },
75 { "extern1", "pll_a_out0", 0, true },
76 { "clk_out_1", "extern1", 0, true },
77 { "blink", "clk_32k", 32768, true },
78 { "i2s0", "pll_a_out0", 11289600, false},
79 { "i2s1", "pll_a_out0", 11289600, false},
80 { "i2s2", "pll_a_out0", 11289600, false},
81 { "i2s3", "pll_a_out0", 11289600, false},
82 { "i2s4", "pll_a_out0", 11289600, false},
83 { "sdmmc1", "pll_p", 48000000, false},
84 { "sdmmc3", "pll_p", 48000000, false},
85 { "sdmmc4", "pll_p", 48000000, false},
86 { "sbc1", "pll_p", 100000000, false},
87 { "sbc2", "pll_p", 100000000, false},
88 { "sbc3", "pll_p", 100000000, false},
89 { "sbc4", "pll_p", 100000000, false},
90 { "sbc5", "pll_p", 100000000, false},
91 { "sbc6", "pll_p", 100000000, false},
92 { "host1x", "pll_c", 150000000, false},
93 { "disp1", "pll_p", 600000000, false},
94 { "disp2", "pll_p", 600000000, false},
95 { NULL, NULL, 0, 0},
96};
97
98static void __init tegra30_dt_init(void) 69static void __init tegra30_dt_init(void)
99{ 70{
100 tegra_clk_init_from_table(tegra_dt_clk_init_table);
101
102 of_platform_populate(NULL, of_default_bus_match_table, 71 of_platform_populate(NULL, of_default_bus_match_table,
103 tegra30_auxdata_lookup, NULL); 72 tegra30_auxdata_lookup, NULL);
104} 73}
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 8c0ff061f8cf..baa0c5b008f1 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -31,9 +31,6 @@
31#include "board.h" 31#include "board.h"
32#include "clock.h" 32#include "clock.h"
33 33
34/* Global data of Tegra CPU CAR ops */
35struct tegra_cpu_car_ops *tegra_cpu_car_ops;
36
37/* 34/*
38 * Locking: 35 * Locking:
39 * 36 *
@@ -131,22 +128,6 @@ void tegra_clk_init_from_table(struct tegra_clk_init_table *table)
131 tegra_clk_init_one_from_table(table); 128 tegra_clk_init_one_from_table(table);
132} 129}
133 130
134void tegra_periph_reset_deassert(struct clk *c)
135{
136 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
137 BUG_ON(!clk->reset);
138 clk->reset(__clk_get_hw(c), false);
139}
140EXPORT_SYMBOL(tegra_periph_reset_deassert);
141
142void tegra_periph_reset_assert(struct clk *c)
143{
144 struct clk_tegra *clk = to_clk_tegra(__clk_get_hw(c));
145 BUG_ON(!clk->reset);
146 clk->reset(__clk_get_hw(c), true);
147}
148EXPORT_SYMBOL(tegra_periph_reset_assert);
149
150/* Several extended clock configuration bits (e.g., clock routing, clock 131/* Several extended clock configuration bits (e.g., clock routing, clock
151 * phase control) are included in PLL and peripheral clock source 132 * phase control) are included in PLL and peripheral clock source
152 * registers. */ 133 * registers. */
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 3efe80b2af28..87dd69ccdf8e 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -22,6 +22,7 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/of_irq.h> 24#include <linux/of_irq.h>
25#include <linux/clk/tegra.h>
25 26
26#include <asm/hardware/cache-l2x0.h> 27#include <asm/hardware/cache-l2x0.h>
27#include <asm/hardware/gic.h> 28#include <asm/hardware/gic.h>
@@ -29,7 +30,6 @@
29#include <mach/powergate.h> 30#include <mach/powergate.h>
30 31
31#include "board.h" 32#include "board.h"
32#include "clock.h"
33#include "common.h" 33#include "common.h"
34#include "fuse.h" 34#include "fuse.h"
35#include "iomap.h" 35#include "iomap.h"
@@ -65,6 +65,7 @@ static const struct of_device_id tegra_dt_irq_match[] __initconst = {
65 65
66void __init tegra_dt_init_irq(void) 66void __init tegra_dt_init_irq(void)
67{ 67{
68 tegra_clocks_init();
68 tegra_init_irq(); 69 tegra_init_irq();
69 of_irq_init(tegra_dt_irq_match); 70 of_irq_init(tegra_dt_irq_match);
70} 71}
@@ -80,43 +81,6 @@ void tegra_assert_system_reset(char mode, const char *cmd)
80 writel_relaxed(reg, reset); 81 writel_relaxed(reg, reset);
81} 82}
82 83
83#ifdef CONFIG_ARCH_TEGRA_2x_SOC
84static __initdata struct tegra_clk_init_table tegra20_clk_init_table[] = {
85 /* name parent rate enabled */
86 { "clk_m", NULL, 0, true },
87 { "pll_p", "clk_m", 216000000, true },
88 { "pll_p_out1", "pll_p", 28800000, true },
89 { "pll_p_out2", "pll_p", 48000000, true },
90 { "pll_p_out3", "pll_p", 72000000, true },
91 { "pll_p_out4", "pll_p", 24000000, true },
92 { "pll_c", "clk_m", 600000000, true },
93 { "pll_c_out1", "pll_c", 120000000, true },
94 { "sclk", "pll_c_out1", 120000000, true },
95 { "hclk", "sclk", 120000000, true },
96 { "pclk", "hclk", 60000000, true },
97 { "csite", NULL, 0, true },
98 { "emc", NULL, 0, true },
99 { "cpu", NULL, 0, true },
100 { NULL, NULL, 0, 0},
101};
102#endif
103
104#ifdef CONFIG_ARCH_TEGRA_3x_SOC
105static __initdata struct tegra_clk_init_table tegra30_clk_init_table[] = {
106 /* name parent rate enabled */
107 { "clk_m", NULL, 0, true },
108 { "pll_p", "pll_ref", 408000000, true },
109 { "pll_p_out1", "pll_p", 9600000, true },
110 { "pll_p_out4", "pll_p", 102000000, true },
111 { "sclk", "pll_p_out4", 102000000, true },
112 { "hclk", "sclk", 102000000, true },
113 { "pclk", "hclk", 51000000, true },
114 { "csite", NULL, 0, true },
115 { NULL, NULL, 0, 0},
116};
117#endif
118
119
120static void __init tegra_init_cache(void) 84static void __init tegra_init_cache(void)
121{ 85{
122#ifdef CONFIG_CACHE_L2X0 86#ifdef CONFIG_CACHE_L2X0
@@ -141,8 +105,6 @@ void __init tegra20_init_early(void)
141 tegra_cpu_reset_handler_init(); 105 tegra_cpu_reset_handler_init();
142 tegra_apb_io_init(); 106 tegra_apb_io_init();
143 tegra_init_fuse(); 107 tegra_init_fuse();
144 tegra2_init_clocks();
145 tegra_clk_init_from_table(tegra20_clk_init_table);
146 tegra_init_cache(); 108 tegra_init_cache();
147 tegra_pmc_init(); 109 tegra_pmc_init();
148 tegra_powergate_init(); 110 tegra_powergate_init();
@@ -155,8 +117,6 @@ void __init tegra30_init_early(void)
155 tegra_cpu_reset_handler_init(); 117 tegra_cpu_reset_handler_init();
156 tegra_apb_io_init(); 118 tegra_apb_io_init();
157 tegra_init_fuse(); 119 tegra_init_fuse();
158 tegra30_init_clocks();
159 tegra_clk_init_from_table(tegra30_clk_init_table);
160 tegra_init_cache(); 120 tegra_init_cache();
161 tegra_pmc_init(); 121 tegra_pmc_init();
162 tegra_powergate_init(); 122 tegra_powergate_init();
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index 85d4a23bba03..ebffed67e2f5 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -266,7 +266,7 @@ static int __init tegra_cpufreq_init(void)
266 if (IS_ERR(pll_x_clk)) 266 if (IS_ERR(pll_x_clk))
267 return PTR_ERR(pll_x_clk); 267 return PTR_ERR(pll_x_clk);
268 268
269 pll_p_clk = clk_get_sys(NULL, "pll_p"); 269 pll_p_clk = clk_get_sys(NULL, "pll_p_cclk");
270 if (IS_ERR(pll_p_clk)) 270 if (IS_ERR(pll_p_clk))
271 return PTR_ERR(pll_p_clk); 271 return PTR_ERR(pll_p_clk);
272 272
diff --git a/arch/arm/mach-tegra/include/mach/clk.h b/arch/arm/mach-tegra/include/mach/clk.h
index 95f3a547c770..85bbf10a7d0d 100644
--- a/arch/arm/mach-tegra/include/mach/clk.h
+++ b/arch/arm/mach-tegra/include/mach/clk.h
@@ -31,9 +31,6 @@ enum tegra_clk_ex_param {
31 TEGRA_CLK_PLLD_MIPI_MUX_SEL, 31 TEGRA_CLK_PLLD_MIPI_MUX_SEL,
32}; 32};
33 33
34void tegra_periph_reset_deassert(struct clk *c);
35void tegra_periph_reset_assert(struct clk *c);
36
37#ifndef CONFIG_COMMON_CLK 34#ifndef CONFIG_COMMON_CLK
38unsigned long clk_get_rate_all_locked(struct clk *c); 35unsigned long clk_get_rate_all_locked(struct clk *c);
39#endif 36#endif
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index bffcd643d7a3..b60165f1ca02 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -33,11 +33,11 @@
33#include <linux/clk.h> 33#include <linux/clk.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/export.h> 35#include <linux/export.h>
36#include <linux/clk/tegra.h>
36 37
37#include <asm/sizes.h> 38#include <asm/sizes.h>
38#include <asm/mach/pci.h> 39#include <asm/mach/pci.h>
39 40
40#include <mach/clk.h>
41#include <mach/powergate.h> 41#include <mach/powergate.h>
42 42
43#include "board.h" 43#include "board.h"
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 2cc1185d902e..c6bc8f85759c 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -26,8 +26,8 @@
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/clk/tegra.h>
29 30
30#include <mach/clk.h>
31#include <mach/powergate.h> 31#include <mach/powergate.h>
32 32
33#include "fuse.h" 33#include "fuse.h"