blob: bb3b88359daf74ea5b6dcc4e2948c2bd31d0fc74 [file] [log] [blame]
Tero Kristoaafd9002013-08-02 14:04:19 +03001/*
2 * OMAP3 Clock init
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc
5 * Tero Kristo (t-kristo@ti.com)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/clk-provider.h>
20#include <linux/clk/ti.h>
21
Tero Kristoa5aa8a62015-03-03 10:51:01 +020022#include "clock.h"
Tero Kristoaafd9002013-08-02 14:04:19 +030023
24static struct ti_dt_clk omap3xxx_clks[] = {
25 DT_CLK(NULL, "apb_pclk", "dummy_apb_pclk"),
26 DT_CLK(NULL, "omap_32k_fck", "omap_32k_fck"),
27 DT_CLK(NULL, "virt_12m_ck", "virt_12m_ck"),
28 DT_CLK(NULL, "virt_13m_ck", "virt_13m_ck"),
29 DT_CLK(NULL, "virt_19200000_ck", "virt_19200000_ck"),
30 DT_CLK(NULL, "virt_26000000_ck", "virt_26000000_ck"),
31 DT_CLK(NULL, "virt_38_4m_ck", "virt_38_4m_ck"),
32 DT_CLK(NULL, "osc_sys_ck", "osc_sys_ck"),
33 DT_CLK("twl", "fck", "osc_sys_ck"),
34 DT_CLK(NULL, "sys_ck", "sys_ck"),
35 DT_CLK(NULL, "omap_96m_alwon_fck", "omap_96m_alwon_fck"),
36 DT_CLK("etb", "emu_core_alwon_ck", "emu_core_alwon_ck"),
37 DT_CLK(NULL, "sys_altclk", "sys_altclk"),
Tero Kristoaafd9002013-08-02 14:04:19 +030038 DT_CLK(NULL, "sys_clkout1", "sys_clkout1"),
39 DT_CLK(NULL, "dpll1_ck", "dpll1_ck"),
40 DT_CLK(NULL, "dpll1_x2_ck", "dpll1_x2_ck"),
41 DT_CLK(NULL, "dpll1_x2m2_ck", "dpll1_x2m2_ck"),
42 DT_CLK(NULL, "dpll3_ck", "dpll3_ck"),
43 DT_CLK(NULL, "core_ck", "core_ck"),
44 DT_CLK(NULL, "dpll3_x2_ck", "dpll3_x2_ck"),
45 DT_CLK(NULL, "dpll3_m2_ck", "dpll3_m2_ck"),
46 DT_CLK(NULL, "dpll3_m2x2_ck", "dpll3_m2x2_ck"),
47 DT_CLK(NULL, "dpll3_m3_ck", "dpll3_m3_ck"),
48 DT_CLK(NULL, "dpll3_m3x2_ck", "dpll3_m3x2_ck"),
49 DT_CLK(NULL, "dpll4_ck", "dpll4_ck"),
50 DT_CLK(NULL, "dpll4_x2_ck", "dpll4_x2_ck"),
51 DT_CLK(NULL, "omap_96m_fck", "omap_96m_fck"),
52 DT_CLK(NULL, "cm_96m_fck", "cm_96m_fck"),
53 DT_CLK(NULL, "omap_54m_fck", "omap_54m_fck"),
54 DT_CLK(NULL, "omap_48m_fck", "omap_48m_fck"),
55 DT_CLK(NULL, "omap_12m_fck", "omap_12m_fck"),
56 DT_CLK(NULL, "dpll4_m2_ck", "dpll4_m2_ck"),
57 DT_CLK(NULL, "dpll4_m2x2_ck", "dpll4_m2x2_ck"),
58 DT_CLK(NULL, "dpll4_m3_ck", "dpll4_m3_ck"),
59 DT_CLK(NULL, "dpll4_m3x2_ck", "dpll4_m3x2_ck"),
60 DT_CLK(NULL, "dpll4_m4_ck", "dpll4_m4_ck"),
61 DT_CLK(NULL, "dpll4_m4x2_ck", "dpll4_m4x2_ck"),
62 DT_CLK(NULL, "dpll4_m5_ck", "dpll4_m5_ck"),
63 DT_CLK(NULL, "dpll4_m5x2_ck", "dpll4_m5x2_ck"),
64 DT_CLK(NULL, "dpll4_m6_ck", "dpll4_m6_ck"),
65 DT_CLK(NULL, "dpll4_m6x2_ck", "dpll4_m6x2_ck"),
66 DT_CLK("etb", "emu_per_alwon_ck", "emu_per_alwon_ck"),
67 DT_CLK(NULL, "clkout2_src_ck", "clkout2_src_ck"),
68 DT_CLK(NULL, "sys_clkout2", "sys_clkout2"),
69 DT_CLK(NULL, "corex2_fck", "corex2_fck"),
70 DT_CLK(NULL, "dpll1_fck", "dpll1_fck"),
71 DT_CLK(NULL, "mpu_ck", "mpu_ck"),
72 DT_CLK(NULL, "arm_fck", "arm_fck"),
73 DT_CLK("etb", "emu_mpu_alwon_ck", "emu_mpu_alwon_ck"),
74 DT_CLK(NULL, "l3_ick", "l3_ick"),
75 DT_CLK(NULL, "l4_ick", "l4_ick"),
76 DT_CLK(NULL, "rm_ick", "rm_ick"),
77 DT_CLK(NULL, "gpt10_fck", "gpt10_fck"),
78 DT_CLK(NULL, "gpt11_fck", "gpt11_fck"),
79 DT_CLK(NULL, "core_96m_fck", "core_96m_fck"),
80 DT_CLK(NULL, "mmchs2_fck", "mmchs2_fck"),
81 DT_CLK(NULL, "mmchs1_fck", "mmchs1_fck"),
82 DT_CLK(NULL, "i2c3_fck", "i2c3_fck"),
83 DT_CLK(NULL, "i2c2_fck", "i2c2_fck"),
84 DT_CLK(NULL, "i2c1_fck", "i2c1_fck"),
Tero Kristoaafd9002013-08-02 14:04:19 +030085 DT_CLK(NULL, "core_48m_fck", "core_48m_fck"),
86 DT_CLK(NULL, "mcspi4_fck", "mcspi4_fck"),
87 DT_CLK(NULL, "mcspi3_fck", "mcspi3_fck"),
88 DT_CLK(NULL, "mcspi2_fck", "mcspi2_fck"),
89 DT_CLK(NULL, "mcspi1_fck", "mcspi1_fck"),
90 DT_CLK(NULL, "uart2_fck", "uart2_fck"),
91 DT_CLK(NULL, "uart1_fck", "uart1_fck"),
92 DT_CLK(NULL, "core_12m_fck", "core_12m_fck"),
93 DT_CLK("omap_hdq.0", "fck", "hdq_fck"),
94 DT_CLK(NULL, "hdq_fck", "hdq_fck"),
95 DT_CLK(NULL, "core_l3_ick", "core_l3_ick"),
96 DT_CLK(NULL, "sdrc_ick", "sdrc_ick"),
97 DT_CLK(NULL, "gpmc_fck", "gpmc_fck"),
98 DT_CLK(NULL, "core_l4_ick", "core_l4_ick"),
99 DT_CLK("omap_hsmmc.1", "ick", "mmchs2_ick"),
100 DT_CLK("omap_hsmmc.0", "ick", "mmchs1_ick"),
101 DT_CLK(NULL, "mmchs2_ick", "mmchs2_ick"),
102 DT_CLK(NULL, "mmchs1_ick", "mmchs1_ick"),
103 DT_CLK("omap_hdq.0", "ick", "hdq_ick"),
104 DT_CLK(NULL, "hdq_ick", "hdq_ick"),
105 DT_CLK("omap2_mcspi.4", "ick", "mcspi4_ick"),
106 DT_CLK("omap2_mcspi.3", "ick", "mcspi3_ick"),
107 DT_CLK("omap2_mcspi.2", "ick", "mcspi2_ick"),
108 DT_CLK("omap2_mcspi.1", "ick", "mcspi1_ick"),
109 DT_CLK(NULL, "mcspi4_ick", "mcspi4_ick"),
110 DT_CLK(NULL, "mcspi3_ick", "mcspi3_ick"),
111 DT_CLK(NULL, "mcspi2_ick", "mcspi2_ick"),
112 DT_CLK(NULL, "mcspi1_ick", "mcspi1_ick"),
113 DT_CLK("omap_i2c.3", "ick", "i2c3_ick"),
114 DT_CLK("omap_i2c.2", "ick", "i2c2_ick"),
115 DT_CLK("omap_i2c.1", "ick", "i2c1_ick"),
116 DT_CLK(NULL, "i2c3_ick", "i2c3_ick"),
117 DT_CLK(NULL, "i2c2_ick", "i2c2_ick"),
118 DT_CLK(NULL, "i2c1_ick", "i2c1_ick"),
119 DT_CLK(NULL, "uart2_ick", "uart2_ick"),
120 DT_CLK(NULL, "uart1_ick", "uart1_ick"),
121 DT_CLK(NULL, "gpt11_ick", "gpt11_ick"),
122 DT_CLK(NULL, "gpt10_ick", "gpt10_ick"),
Tero Kristoaafd9002013-08-02 14:04:19 +0300123 DT_CLK(NULL, "omapctrl_ick", "omapctrl_ick"),
124 DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"),
125 DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"),
126 DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"),
Tero Kristoaafd9002013-08-02 14:04:19 +0300127 DT_CLK(NULL, "init_60m_fclk", "dummy_ck"),
128 DT_CLK(NULL, "gpt1_fck", "gpt1_fck"),
129 DT_CLK(NULL, "aes2_ick", "aes2_ick"),
130 DT_CLK(NULL, "wkup_32k_fck", "wkup_32k_fck"),
131 DT_CLK(NULL, "gpio1_dbck", "gpio1_dbck"),
132 DT_CLK(NULL, "sha12_ick", "sha12_ick"),
133 DT_CLK(NULL, "wdt2_fck", "wdt2_fck"),
134 DT_CLK("omap_wdt", "ick", "wdt2_ick"),
135 DT_CLK(NULL, "wdt2_ick", "wdt2_ick"),
136 DT_CLK(NULL, "wdt1_ick", "wdt1_ick"),
137 DT_CLK(NULL, "gpio1_ick", "gpio1_ick"),
138 DT_CLK(NULL, "omap_32ksync_ick", "omap_32ksync_ick"),
139 DT_CLK(NULL, "gpt12_ick", "gpt12_ick"),
140 DT_CLK(NULL, "gpt1_ick", "gpt1_ick"),
141 DT_CLK(NULL, "per_96m_fck", "per_96m_fck"),
142 DT_CLK(NULL, "per_48m_fck", "per_48m_fck"),
143 DT_CLK(NULL, "uart3_fck", "uart3_fck"),
144 DT_CLK(NULL, "gpt2_fck", "gpt2_fck"),
145 DT_CLK(NULL, "gpt3_fck", "gpt3_fck"),
146 DT_CLK(NULL, "gpt4_fck", "gpt4_fck"),
147 DT_CLK(NULL, "gpt5_fck", "gpt5_fck"),
148 DT_CLK(NULL, "gpt6_fck", "gpt6_fck"),
149 DT_CLK(NULL, "gpt7_fck", "gpt7_fck"),
150 DT_CLK(NULL, "gpt8_fck", "gpt8_fck"),
151 DT_CLK(NULL, "gpt9_fck", "gpt9_fck"),
152 DT_CLK(NULL, "per_32k_alwon_fck", "per_32k_alwon_fck"),
153 DT_CLK(NULL, "gpio6_dbck", "gpio6_dbck"),
154 DT_CLK(NULL, "gpio5_dbck", "gpio5_dbck"),
155 DT_CLK(NULL, "gpio4_dbck", "gpio4_dbck"),
156 DT_CLK(NULL, "gpio3_dbck", "gpio3_dbck"),
157 DT_CLK(NULL, "gpio2_dbck", "gpio2_dbck"),
158 DT_CLK(NULL, "wdt3_fck", "wdt3_fck"),
159 DT_CLK(NULL, "per_l4_ick", "per_l4_ick"),
160 DT_CLK(NULL, "gpio6_ick", "gpio6_ick"),
161 DT_CLK(NULL, "gpio5_ick", "gpio5_ick"),
162 DT_CLK(NULL, "gpio4_ick", "gpio4_ick"),
163 DT_CLK(NULL, "gpio3_ick", "gpio3_ick"),
164 DT_CLK(NULL, "gpio2_ick", "gpio2_ick"),
165 DT_CLK(NULL, "wdt3_ick", "wdt3_ick"),
166 DT_CLK(NULL, "uart3_ick", "uart3_ick"),
167 DT_CLK(NULL, "uart4_ick", "uart4_ick"),
168 DT_CLK(NULL, "gpt9_ick", "gpt9_ick"),
169 DT_CLK(NULL, "gpt8_ick", "gpt8_ick"),
170 DT_CLK(NULL, "gpt7_ick", "gpt7_ick"),
171 DT_CLK(NULL, "gpt6_ick", "gpt6_ick"),
172 DT_CLK(NULL, "gpt5_ick", "gpt5_ick"),
173 DT_CLK(NULL, "gpt4_ick", "gpt4_ick"),
174 DT_CLK(NULL, "gpt3_ick", "gpt3_ick"),
175 DT_CLK(NULL, "gpt2_ick", "gpt2_ick"),
Peter Ujfalusif757d1b2015-03-16 12:40:57 +0200176 DT_CLK(NULL, "mcbsp_clks", "mcbsp_clks"),
177 DT_CLK(NULL, "mcbsp1_ick", "mcbsp1_ick"),
178 DT_CLK(NULL, "mcbsp2_ick", "mcbsp2_ick"),
Tero Kristoaafd9002013-08-02 14:04:19 +0300179 DT_CLK(NULL, "mcbsp3_ick", "mcbsp3_ick"),
Peter Ujfalusif757d1b2015-03-16 12:40:57 +0200180 DT_CLK(NULL, "mcbsp4_ick", "mcbsp4_ick"),
181 DT_CLK(NULL, "mcbsp5_ick", "mcbsp5_ick"),
182 DT_CLK(NULL, "mcbsp1_fck", "mcbsp1_fck"),
Tero Kristoaafd9002013-08-02 14:04:19 +0300183 DT_CLK(NULL, "mcbsp2_fck", "mcbsp2_fck"),
184 DT_CLK(NULL, "mcbsp3_fck", "mcbsp3_fck"),
185 DT_CLK(NULL, "mcbsp4_fck", "mcbsp4_fck"),
Peter Ujfalusif757d1b2015-03-16 12:40:57 +0200186 DT_CLK(NULL, "mcbsp5_fck", "mcbsp5_fck"),
Tero Kristoaafd9002013-08-02 14:04:19 +0300187 DT_CLK("etb", "emu_src_ck", "emu_src_ck"),
188 DT_CLK(NULL, "emu_src_ck", "emu_src_ck"),
189 DT_CLK(NULL, "pclk_fck", "pclk_fck"),
190 DT_CLK(NULL, "pclkx2_fck", "pclkx2_fck"),
191 DT_CLK(NULL, "atclk_fck", "atclk_fck"),
192 DT_CLK(NULL, "traceclk_src_fck", "traceclk_src_fck"),
193 DT_CLK(NULL, "traceclk_fck", "traceclk_fck"),
194 DT_CLK(NULL, "secure_32k_fck", "secure_32k_fck"),
195 DT_CLK(NULL, "gpt12_fck", "gpt12_fck"),
196 DT_CLK(NULL, "wdt1_fck", "wdt1_fck"),
197 DT_CLK(NULL, "timer_32k_ck", "omap_32k_fck"),
198 DT_CLK(NULL, "timer_sys_ck", "sys_ck"),
199 DT_CLK(NULL, "cpufreq_ck", "dpll1_ck"),
200 { .node_name = NULL },
201};
202
203static struct ti_dt_clk omap34xx_omap36xx_clks[] = {
204 DT_CLK(NULL, "aes1_ick", "aes1_ick"),
205 DT_CLK("omap_rng", "ick", "rng_ick"),
206 DT_CLK("omap3-rom-rng", "ick", "rng_ick"),
207 DT_CLK(NULL, "sha11_ick", "sha11_ick"),
208 DT_CLK(NULL, "des1_ick", "des1_ick"),
209 DT_CLK(NULL, "cam_mclk", "cam_mclk"),
210 DT_CLK(NULL, "cam_ick", "cam_ick"),
211 DT_CLK(NULL, "csi2_96m_fck", "csi2_96m_fck"),
212 DT_CLK(NULL, "security_l3_ick", "security_l3_ick"),
213 DT_CLK(NULL, "pka_ick", "pka_ick"),
214 DT_CLK(NULL, "icr_ick", "icr_ick"),
215 DT_CLK("omap-aes", "ick", "aes2_ick"),
216 DT_CLK("omap-sham", "ick", "sha12_ick"),
217 DT_CLK(NULL, "des2_ick", "des2_ick"),
218 DT_CLK(NULL, "mspro_ick", "mspro_ick"),
219 DT_CLK(NULL, "mailboxes_ick", "mailboxes_ick"),
220 DT_CLK(NULL, "ssi_l4_ick", "ssi_l4_ick"),
221 DT_CLK(NULL, "sr1_fck", "sr1_fck"),
222 DT_CLK(NULL, "sr2_fck", "sr2_fck"),
223 DT_CLK(NULL, "sr_l4_ick", "sr_l4_ick"),
224 DT_CLK(NULL, "security_l4_ick2", "security_l4_ick2"),
225 DT_CLK(NULL, "wkup_l4_ick", "wkup_l4_ick"),
226 DT_CLK(NULL, "dpll2_fck", "dpll2_fck"),
227 DT_CLK(NULL, "iva2_ck", "iva2_ck"),
228 DT_CLK(NULL, "modem_fck", "modem_fck"),
229 DT_CLK(NULL, "sad2d_ick", "sad2d_ick"),
230 DT_CLK(NULL, "mad2d_ick", "mad2d_ick"),
231 DT_CLK(NULL, "mspro_fck", "mspro_fck"),
232 DT_CLK(NULL, "dpll2_ck", "dpll2_ck"),
233 DT_CLK(NULL, "dpll2_m2_ck", "dpll2_m2_ck"),
234 { .node_name = NULL },
235};
236
237static struct ti_dt_clk omap36xx_omap3430es2plus_clks[] = {
238 DT_CLK(NULL, "ssi_ssr_fck", "ssi_ssr_fck_3430es2"),
239 DT_CLK(NULL, "ssi_sst_fck", "ssi_sst_fck_3430es2"),
240 DT_CLK("musb-omap2430", "ick", "hsotgusb_ick_3430es2"),
241 DT_CLK(NULL, "hsotgusb_ick", "hsotgusb_ick_3430es2"),
242 DT_CLK(NULL, "ssi_ick", "ssi_ick_3430es2"),
243 DT_CLK(NULL, "usim_fck", "usim_fck"),
244 DT_CLK(NULL, "usim_ick", "usim_ick"),
245 { .node_name = NULL },
246};
247
248static struct ti_dt_clk omap3430es1_clks[] = {
249 DT_CLK(NULL, "gfx_l3_ck", "gfx_l3_ck"),
250 DT_CLK(NULL, "gfx_l3_fck", "gfx_l3_fck"),
251 DT_CLK(NULL, "gfx_l3_ick", "gfx_l3_ick"),
252 DT_CLK(NULL, "gfx_cg1_ck", "gfx_cg1_ck"),
253 DT_CLK(NULL, "gfx_cg2_ck", "gfx_cg2_ck"),
254 DT_CLK(NULL, "d2d_26m_fck", "d2d_26m_fck"),
255 DT_CLK(NULL, "fshostusb_fck", "fshostusb_fck"),
256 DT_CLK(NULL, "ssi_ssr_fck", "ssi_ssr_fck_3430es1"),
257 DT_CLK(NULL, "ssi_sst_fck", "ssi_sst_fck_3430es1"),
258 DT_CLK("musb-omap2430", "ick", "hsotgusb_ick_3430es1"),
259 DT_CLK(NULL, "hsotgusb_ick", "hsotgusb_ick_3430es1"),
260 DT_CLK(NULL, "fac_ick", "fac_ick"),
261 DT_CLK(NULL, "ssi_ick", "ssi_ick_3430es1"),
262 DT_CLK(NULL, "usb_l4_ick", "usb_l4_ick"),
263 DT_CLK(NULL, "dss1_alwon_fck", "dss1_alwon_fck_3430es1"),
264 DT_CLK("omapdss_dss", "ick", "dss_ick_3430es1"),
265 DT_CLK(NULL, "dss_ick", "dss_ick_3430es1"),
266 { .node_name = NULL },
267};
268
269static struct ti_dt_clk omap36xx_am35xx_omap3430es2plus_clks[] = {
270 DT_CLK(NULL, "virt_16_8m_ck", "virt_16_8m_ck"),
271 DT_CLK(NULL, "dpll5_ck", "dpll5_ck"),
272 DT_CLK(NULL, "dpll5_m2_ck", "dpll5_m2_ck"),
273 DT_CLK(NULL, "sgx_fck", "sgx_fck"),
274 DT_CLK(NULL, "sgx_ick", "sgx_ick"),
275 DT_CLK(NULL, "cpefuse_fck", "cpefuse_fck"),
276 DT_CLK(NULL, "ts_fck", "ts_fck"),
277 DT_CLK(NULL, "usbtll_fck", "usbtll_fck"),
278 DT_CLK(NULL, "usbtll_ick", "usbtll_ick"),
279 DT_CLK("omap_hsmmc.2", "ick", "mmchs3_ick"),
280 DT_CLK(NULL, "mmchs3_ick", "mmchs3_ick"),
281 DT_CLK(NULL, "mmchs3_fck", "mmchs3_fck"),
282 DT_CLK(NULL, "dss1_alwon_fck", "dss1_alwon_fck_3430es2"),
283 DT_CLK("omapdss_dss", "ick", "dss_ick_3430es2"),
284 DT_CLK(NULL, "dss_ick", "dss_ick_3430es2"),
285 DT_CLK(NULL, "usbhost_120m_fck", "usbhost_120m_fck"),
286 DT_CLK(NULL, "usbhost_48m_fck", "usbhost_48m_fck"),
287 DT_CLK(NULL, "usbhost_ick", "usbhost_ick"),
288 { .node_name = NULL },
289};
290
291static struct ti_dt_clk am35xx_clks[] = {
292 DT_CLK(NULL, "ipss_ick", "ipss_ick"),
293 DT_CLK(NULL, "rmii_ck", "rmii_ck"),
294 DT_CLK(NULL, "pclk_ck", "pclk_ck"),
295 DT_CLK(NULL, "emac_ick", "emac_ick"),
296 DT_CLK(NULL, "emac_fck", "emac_fck"),
297 DT_CLK("davinci_emac.0", NULL, "emac_ick"),
298 DT_CLK("davinci_mdio.0", NULL, "emac_fck"),
299 DT_CLK("vpfe-capture", "master", "vpfe_ick"),
300 DT_CLK("vpfe-capture", "slave", "vpfe_fck"),
301 DT_CLK(NULL, "hsotgusb_ick", "hsotgusb_ick_am35xx"),
302 DT_CLK(NULL, "hsotgusb_fck", "hsotgusb_fck_am35xx"),
303 DT_CLK(NULL, "hecc_ck", "hecc_ck"),
304 DT_CLK(NULL, "uart4_ick", "uart4_ick_am35xx"),
305 DT_CLK(NULL, "uart4_fck", "uart4_fck_am35xx"),
306 { .node_name = NULL },
307};
308
309static struct ti_dt_clk omap36xx_clks[] = {
310 DT_CLK(NULL, "omap_192m_alwon_fck", "omap_192m_alwon_fck"),
311 DT_CLK(NULL, "uart4_fck", "uart4_fck"),
312 { .node_name = NULL },
313};
314
315static const char *enable_init_clks[] = {
316 "sdrc_ick",
317 "gpmc_fck",
318 "omapctrl_ick",
319};
320
321enum {
322 OMAP3_SOC_AM35XX,
323 OMAP3_SOC_OMAP3430_ES1,
324 OMAP3_SOC_OMAP3430_ES2_PLUS,
325 OMAP3_SOC_OMAP3630,
Tero Kristoaafd9002013-08-02 14:04:19 +0300326};
327
328static int __init omap3xxx_dt_clk_init(int soc_type)
329{
330 if (soc_type == OMAP3_SOC_AM35XX || soc_type == OMAP3_SOC_OMAP3630 ||
331 soc_type == OMAP3_SOC_OMAP3430_ES1 ||
332 soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS)
333 ti_dt_clocks_register(omap3xxx_clks);
334
335 if (soc_type == OMAP3_SOC_AM35XX)
336 ti_dt_clocks_register(am35xx_clks);
337
338 if (soc_type == OMAP3_SOC_OMAP3630 || soc_type == OMAP3_SOC_AM35XX ||
339 soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS)
340 ti_dt_clocks_register(omap36xx_am35xx_omap3430es2plus_clks);
341
342 if (soc_type == OMAP3_SOC_OMAP3430_ES1)
343 ti_dt_clocks_register(omap3430es1_clks);
344
345 if (soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS ||
346 soc_type == OMAP3_SOC_OMAP3630)
347 ti_dt_clocks_register(omap36xx_omap3430es2plus_clks);
348
349 if (soc_type == OMAP3_SOC_OMAP3430_ES1 ||
350 soc_type == OMAP3_SOC_OMAP3430_ES2_PLUS ||
351 soc_type == OMAP3_SOC_OMAP3630)
352 ti_dt_clocks_register(omap34xx_omap36xx_clks);
353
354 if (soc_type == OMAP3_SOC_OMAP3630)
355 ti_dt_clocks_register(omap36xx_clks);
356
357 omap2_clk_disable_autoidle_all();
358
359 omap2_clk_enable_init_clocks(enable_init_clks,
360 ARRAY_SIZE(enable_init_clks));
361
362 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
363 (clk_get_rate(clk_get_sys(NULL, "osc_sys_ck")) / 1000000),
364 (clk_get_rate(clk_get_sys(NULL, "osc_sys_ck")) / 100000) % 10,
365 (clk_get_rate(clk_get_sys(NULL, "core_ck")) / 1000000),
366 (clk_get_rate(clk_get_sys(NULL, "arm_fck")) / 1000000));
367
Tony Lindgren1a342752015-01-13 14:51:28 -0800368 if (soc_type != OMAP3_SOC_OMAP3430_ES1)
Tero Kristoaafd9002013-08-02 14:04:19 +0300369 omap3_clk_lock_dpll5();
370
371 return 0;
372}
373
374int __init omap3430_dt_clk_init(void)
375{
376 return omap3xxx_dt_clk_init(OMAP3_SOC_OMAP3430_ES2_PLUS);
377}
378
379int __init omap3630_dt_clk_init(void)
380{
381 return omap3xxx_dt_clk_init(OMAP3_SOC_OMAP3630);
382}
383
384int __init am35xx_dt_clk_init(void)
385{
386 return omap3xxx_dt_clk_init(OMAP3_SOC_AM35XX);
387}