blob: 43b2bb690c71882dbae60876db2809c4ed0351ab [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Tero Kristo251a449d2013-07-18 17:41:00 +03002/*
3 * DRA7 Clock init
4 *
5 * Copyright (C) 2013 Texas Instruments, Inc.
6 *
7 * Tero Kristo (t-kristo@ti.com)
Tero Kristo251a449d2013-07-18 17:41:00 +03008 */
9
10#include <linux/kernel.h>
11#include <linux/list.h>
Stephen Boyde3870882015-01-22 15:40:20 -080012#include <linux/clk.h>
Tero Kristo251a449d2013-07-18 17:41:00 +030013#include <linux/clkdev.h>
14#include <linux/clk/ti.h>
Tero Kristo24d504a2017-08-04 17:25:08 +030015#include <dt-bindings/clock/dra7.h>
Tero Kristo251a449d2013-07-18 17:41:00 +030016
Tero Kristoa3314e92015-03-04 21:02:05 +020017#include "clock.h"
18
Tero Kristo251a449d2013-07-18 17:41:00 +030019#define DRA7_DPLL_GMAC_DEFFREQ 1000000000
Roger Quadros94e72ae2014-03-07 15:09:04 +020020#define DRA7_DPLL_USB_DEFFREQ 960000000
Tero Kristo251a449d2013-07-18 17:41:00 +030021
Tero Kristodffa9052018-08-13 14:30:49 +030022static const struct omap_clkctrl_reg_data dra7_mpu_clkctrl_regs[] __initconst = {
23 { DRA7_MPU_MPU_CLKCTRL, NULL, 0, "dpll_mpu_m2_ck" },
24 { 0 },
25};
26
27static const struct omap_clkctrl_reg_data dra7_dsp1_clkctrl_regs[] __initconst = {
Tero Kristo9063ea42019-09-12 16:26:09 +030028 { DRA7_DSP1_MMU0_DSP1_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_dsp_m2_ck" },
Tero Kristodffa9052018-08-13 14:30:49 +030029 { 0 },
30};
31
32static const char * const dra7_ipu1_gfclk_mux_parents[] __initconst = {
33 "dpll_abe_m2x2_ck",
34 "dpll_core_h22x2_ck",
35 NULL,
36};
37
38static const struct omap_clkctrl_bit_data dra7_mmu_ipu1_bit_data[] __initconst = {
39 { 24, TI_CLK_MUX, dra7_ipu1_gfclk_mux_parents, NULL },
40 { 0 },
41};
42
43static const struct omap_clkctrl_reg_data dra7_ipu1_clkctrl_regs[] __initconst = {
Tero Kristo9063ea42019-09-12 16:26:09 +030044 { DRA7_IPU1_MMU_IPU1_CLKCTRL, dra7_mmu_ipu1_bit_data, CLKF_HW_SUP | CLKF_NO_IDLEST, "ipu1-clkctrl:0000:24" },
Tero Kristodffa9052018-08-13 14:30:49 +030045 { 0 },
46};
47
48static const char * const dra7_mcasp1_aux_gfclk_mux_parents[] __initconst = {
49 "per_abe_x1_gfclk2_div",
50 "video1_clk2_div",
51 "video2_clk2_div",
52 "hdmi_clk2_div",
53 NULL,
54};
55
56static const char * const dra7_mcasp1_ahclkx_mux_parents[] __initconst = {
57 "abe_24m_fclk",
58 "abe_sys_clk_div",
59 "func_24m_clk",
60 "atl_clkin3_ck",
61 "atl_clkin2_ck",
62 "atl_clkin1_ck",
63 "atl_clkin0_ck",
64 "sys_clkin2",
65 "ref_clkin0_ck",
66 "ref_clkin1_ck",
67 "ref_clkin2_ck",
68 "ref_clkin3_ck",
69 "mlb_clk",
70 "mlbp_clk",
71 NULL,
72};
73
74static const struct omap_clkctrl_bit_data dra7_mcasp1_bit_data[] __initconst = {
75 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
76 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
77 { 28, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
78 { 0 },
79};
80
81static const char * const dra7_timer5_gfclk_mux_parents[] __initconst = {
82 "timer_sys_clk_div",
83 "sys_32k_ck",
84 "sys_clkin2",
85 "ref_clkin0_ck",
86 "ref_clkin1_ck",
87 "ref_clkin2_ck",
88 "ref_clkin3_ck",
89 "abe_giclk_div",
90 "video1_div_clk",
91 "video2_div_clk",
92 "hdmi_div_clk",
93 "clkoutmux0_clk_mux",
94 NULL,
95};
96
97static const struct omap_clkctrl_bit_data dra7_timer5_bit_data[] __initconst = {
98 { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
99 { 0 },
100};
101
102static const struct omap_clkctrl_bit_data dra7_timer6_bit_data[] __initconst = {
103 { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
104 { 0 },
105};
106
107static const struct omap_clkctrl_bit_data dra7_timer7_bit_data[] __initconst = {
108 { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
109 { 0 },
110};
111
112static const struct omap_clkctrl_bit_data dra7_timer8_bit_data[] __initconst = {
113 { 24, TI_CLK_MUX, dra7_timer5_gfclk_mux_parents, NULL },
114 { 0 },
115};
116
117static const char * const dra7_uart6_gfclk_mux_parents[] __initconst = {
118 "func_48m_fclk",
119 "dpll_per_m2x2_ck",
120 NULL,
121};
122
123static const struct omap_clkctrl_bit_data dra7_uart6_bit_data[] __initconst = {
124 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
125 { 0 },
126};
127
128static const struct omap_clkctrl_reg_data dra7_ipu_clkctrl_regs[] __initconst = {
129 { DRA7_IPU_MCASP1_CLKCTRL, dra7_mcasp1_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0000:22" },
130 { DRA7_IPU_TIMER5_CLKCTRL, dra7_timer5_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0008:24" },
131 { DRA7_IPU_TIMER6_CLKCTRL, dra7_timer6_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0010:24" },
132 { DRA7_IPU_TIMER7_CLKCTRL, dra7_timer7_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0018:24" },
133 { DRA7_IPU_TIMER8_CLKCTRL, dra7_timer8_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0020:24" },
134 { DRA7_IPU_I2C5_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
135 { DRA7_IPU_UART6_CLKCTRL, dra7_uart6_bit_data, CLKF_SW_SUP, "ipu-clkctrl:0030:24" },
136 { 0 },
137};
138
139static const struct omap_clkctrl_reg_data dra7_dsp2_clkctrl_regs[] __initconst = {
Tero Kristo9063ea42019-09-12 16:26:09 +0300140 { DRA7_DSP2_MMU0_DSP2_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_dsp_m2_ck" },
Tero Kristodffa9052018-08-13 14:30:49 +0300141 { 0 },
142};
143
144static const struct omap_clkctrl_reg_data dra7_rtc_clkctrl_regs[] __initconst = {
145 { DRA7_RTC_RTCSS_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" },
146 { 0 },
147};
148
Benoit Parrot7054c142019-12-11 08:05:49 -0600149static const char * const dra7_cam_gfclk_mux_parents[] __initconst = {
150 "l3_iclk_div",
151 "core_iss_main_clk",
152 NULL,
153};
154
155static const struct omap_clkctrl_bit_data dra7_cam_bit_data[] __initconst = {
156 { 24, TI_CLK_MUX, dra7_cam_gfclk_mux_parents, NULL },
157 { 0 },
158};
159
160static const struct omap_clkctrl_reg_data dra7_cam_clkctrl_regs[] __initconst = {
161 { DRA7_CAM_VIP1_CLKCTRL, dra7_cam_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
162 { DRA7_CAM_VIP2_CLKCTRL, dra7_cam_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
163 { DRA7_CAM_VIP3_CLKCTRL, dra7_cam_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
164 { 0 },
165};
166
Tero Kristodffa9052018-08-13 14:30:49 +0300167static const struct omap_clkctrl_reg_data dra7_coreaon_clkctrl_regs[] __initconst = {
168 { DRA7_COREAON_SMARTREFLEX_MPU_CLKCTRL, NULL, CLKF_SW_SUP, "wkupaon_iclk_mux" },
169 { DRA7_COREAON_SMARTREFLEX_CORE_CLKCTRL, NULL, CLKF_SW_SUP, "wkupaon_iclk_mux" },
170 { 0 },
171};
172
173static const struct omap_clkctrl_reg_data dra7_l3main1_clkctrl_regs[] __initconst = {
174 { DRA7_L3MAIN1_L3_MAIN_1_CLKCTRL, NULL, 0, "l3_iclk_div" },
175 { DRA7_L3MAIN1_GPMC_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
176 { DRA7_L3MAIN1_TPCC_CLKCTRL, NULL, 0, "l3_iclk_div" },
177 { DRA7_L3MAIN1_TPTC0_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
178 { DRA7_L3MAIN1_TPTC1_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
179 { DRA7_L3MAIN1_VCP1_CLKCTRL, NULL, 0, "l3_iclk_div" },
180 { DRA7_L3MAIN1_VCP2_CLKCTRL, NULL, 0, "l3_iclk_div" },
181 { 0 },
182};
183
184static const struct omap_clkctrl_reg_data dra7_ipu2_clkctrl_regs[] __initconst = {
Tero Kristo9063ea42019-09-12 16:26:09 +0300185 { DRA7_IPU2_MMU_IPU2_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_core_h22x2_ck" },
Tero Kristodffa9052018-08-13 14:30:49 +0300186 { 0 },
187};
188
189static const struct omap_clkctrl_reg_data dra7_dma_clkctrl_regs[] __initconst = {
190 { DRA7_DMA_DMA_SYSTEM_CLKCTRL, NULL, 0, "l3_iclk_div" },
191 { 0 },
192};
193
194static const struct omap_clkctrl_reg_data dra7_emif_clkctrl_regs[] __initconst = {
195 { DRA7_EMIF_DMM_CLKCTRL, NULL, 0, "l3_iclk_div" },
196 { 0 },
197};
198
199static const char * const dra7_atl_dpll_clk_mux_parents[] __initconst = {
200 "sys_32k_ck",
201 "video1_clkin_ck",
202 "video2_clkin_ck",
203 "hdmi_clkin_ck",
204 NULL,
205};
206
207static const char * const dra7_atl_gfclk_mux_parents[] __initconst = {
208 "l3_iclk_div",
209 "dpll_abe_m2_ck",
210 "atl-clkctrl:0000:24",
211 NULL,
212};
213
214static const struct omap_clkctrl_bit_data dra7_atl_bit_data[] __initconst = {
215 { 24, TI_CLK_MUX, dra7_atl_dpll_clk_mux_parents, NULL },
216 { 26, TI_CLK_MUX, dra7_atl_gfclk_mux_parents, NULL },
217 { 0 },
218};
219
220static const struct omap_clkctrl_reg_data dra7_atl_clkctrl_regs[] __initconst = {
221 { DRA7_ATL_ATL_CLKCTRL, dra7_atl_bit_data, CLKF_SW_SUP, "atl-clkctrl:0000:26" },
222 { 0 },
223};
224
225static const struct omap_clkctrl_reg_data dra7_l4cfg_clkctrl_regs[] __initconst = {
226 { DRA7_L4CFG_L4_CFG_CLKCTRL, NULL, 0, "l3_iclk_div" },
227 { DRA7_L4CFG_SPINLOCK_CLKCTRL, NULL, 0, "l3_iclk_div" },
228 { DRA7_L4CFG_MAILBOX1_CLKCTRL, NULL, 0, "l3_iclk_div" },
229 { DRA7_L4CFG_MAILBOX2_CLKCTRL, NULL, 0, "l3_iclk_div" },
230 { DRA7_L4CFG_MAILBOX3_CLKCTRL, NULL, 0, "l3_iclk_div" },
231 { DRA7_L4CFG_MAILBOX4_CLKCTRL, NULL, 0, "l3_iclk_div" },
232 { DRA7_L4CFG_MAILBOX5_CLKCTRL, NULL, 0, "l3_iclk_div" },
233 { DRA7_L4CFG_MAILBOX6_CLKCTRL, NULL, 0, "l3_iclk_div" },
234 { DRA7_L4CFG_MAILBOX7_CLKCTRL, NULL, 0, "l3_iclk_div" },
235 { DRA7_L4CFG_MAILBOX8_CLKCTRL, NULL, 0, "l3_iclk_div" },
236 { DRA7_L4CFG_MAILBOX9_CLKCTRL, NULL, 0, "l3_iclk_div" },
237 { DRA7_L4CFG_MAILBOX10_CLKCTRL, NULL, 0, "l3_iclk_div" },
238 { DRA7_L4CFG_MAILBOX11_CLKCTRL, NULL, 0, "l3_iclk_div" },
239 { DRA7_L4CFG_MAILBOX12_CLKCTRL, NULL, 0, "l3_iclk_div" },
240 { DRA7_L4CFG_MAILBOX13_CLKCTRL, NULL, 0, "l3_iclk_div" },
241 { 0 },
242};
243
244static const struct omap_clkctrl_reg_data dra7_l3instr_clkctrl_regs[] __initconst = {
245 { DRA7_L3INSTR_L3_MAIN_2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
246 { DRA7_L3INSTR_L3_INSTR_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
247 { 0 },
248};
249
250static const char * const dra7_dss_dss_clk_parents[] __initconst = {
251 "dpll_per_h12x2_ck",
252 NULL,
253};
254
255static const char * const dra7_dss_48mhz_clk_parents[] __initconst = {
256 "func_48m_fclk",
257 NULL,
258};
259
260static const char * const dra7_dss_hdmi_clk_parents[] __initconst = {
261 "hdmi_dpll_clk_mux",
262 NULL,
263};
264
265static const char * const dra7_dss_32khz_clk_parents[] __initconst = {
266 "sys_32k_ck",
267 NULL,
268};
269
270static const char * const dra7_dss_video1_clk_parents[] __initconst = {
271 "video1_dpll_clk_mux",
272 NULL,
273};
274
275static const char * const dra7_dss_video2_clk_parents[] __initconst = {
276 "video2_dpll_clk_mux",
277 NULL,
278};
279
280static const struct omap_clkctrl_bit_data dra7_dss_core_bit_data[] __initconst = {
281 { 8, TI_CLK_GATE, dra7_dss_dss_clk_parents, NULL },
282 { 9, TI_CLK_GATE, dra7_dss_48mhz_clk_parents, NULL },
283 { 10, TI_CLK_GATE, dra7_dss_hdmi_clk_parents, NULL },
284 { 11, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
285 { 12, TI_CLK_GATE, dra7_dss_video1_clk_parents, NULL },
286 { 13, TI_CLK_GATE, dra7_dss_video2_clk_parents, NULL },
287 { 0 },
288};
289
290static const struct omap_clkctrl_reg_data dra7_dss_clkctrl_regs[] __initconst = {
291 { DRA7_DSS_DSS_CORE_CLKCTRL, dra7_dss_core_bit_data, CLKF_SW_SUP, "dss-clkctrl:0000:8" },
292 { DRA7_DSS_BB2D_CLKCTRL, NULL, CLKF_SW_SUP, "dpll_core_h24x2_ck" },
293 { 0 },
294};
295
296static const char * const dra7_mmc1_fclk_mux_parents[] __initconst = {
297 "func_128m_clk",
298 "dpll_per_m2x2_ck",
299 NULL,
300};
301
302static const char * const dra7_mmc1_fclk_div_parents[] __initconst = {
303 "l3init-clkctrl:0008:24",
304 NULL,
305};
306
307static const struct omap_clkctrl_div_data dra7_mmc1_fclk_div_data __initconst = {
308 .max_div = 4,
309 .flags = CLK_DIVIDER_POWER_OF_TWO,
310};
311
312static const struct omap_clkctrl_bit_data dra7_mmc1_bit_data[] __initconst = {
313 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
314 { 24, TI_CLK_MUX, dra7_mmc1_fclk_mux_parents, NULL },
315 { 25, TI_CLK_DIVIDER, dra7_mmc1_fclk_div_parents, &dra7_mmc1_fclk_div_data },
316 { 0 },
317};
318
319static const char * const dra7_mmc2_fclk_div_parents[] __initconst = {
320 "l3init-clkctrl:0010:24",
321 NULL,
322};
323
324static const struct omap_clkctrl_div_data dra7_mmc2_fclk_div_data __initconst = {
325 .max_div = 4,
326 .flags = CLK_DIVIDER_POWER_OF_TWO,
327};
328
329static const struct omap_clkctrl_bit_data dra7_mmc2_bit_data[] __initconst = {
330 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
331 { 24, TI_CLK_MUX, dra7_mmc1_fclk_mux_parents, NULL },
332 { 25, TI_CLK_DIVIDER, dra7_mmc2_fclk_div_parents, &dra7_mmc2_fclk_div_data },
333 { 0 },
334};
335
336static const char * const dra7_usb_otg_ss2_refclk960m_parents[] __initconst = {
337 "l3init_960m_gfclk",
338 NULL,
339};
340
341static const struct omap_clkctrl_bit_data dra7_usb_otg_ss2_bit_data[] __initconst = {
342 { 8, TI_CLK_GATE, dra7_usb_otg_ss2_refclk960m_parents, NULL },
343 { 0 },
344};
345
346static const char * const dra7_sata_ref_clk_parents[] __initconst = {
347 "sys_clkin1",
348 NULL,
349};
350
351static const struct omap_clkctrl_bit_data dra7_sata_bit_data[] __initconst = {
352 { 8, TI_CLK_GATE, dra7_sata_ref_clk_parents, NULL },
353 { 0 },
354};
355
356static const struct omap_clkctrl_bit_data dra7_usb_otg_ss1_bit_data[] __initconst = {
357 { 8, TI_CLK_GATE, dra7_usb_otg_ss2_refclk960m_parents, NULL },
358 { 0 },
359};
360
361static const struct omap_clkctrl_reg_data dra7_l3init_clkctrl_regs[] __initconst = {
362 { DRA7_L3INIT_MMC1_CLKCTRL, dra7_mmc1_bit_data, CLKF_SW_SUP, "l3init-clkctrl:0008:25" },
363 { DRA7_L3INIT_MMC2_CLKCTRL, dra7_mmc2_bit_data, CLKF_SW_SUP, "l3init-clkctrl:0010:25" },
364 { DRA7_L3INIT_USB_OTG_SS2_CLKCTRL, dra7_usb_otg_ss2_bit_data, CLKF_HW_SUP, "dpll_core_h13x2_ck" },
365 { DRA7_L3INIT_USB_OTG_SS3_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_core_h13x2_ck" },
Tero Kristo2b1202d2019-04-04 11:11:04 +0300366 { DRA7_L3INIT_USB_OTG_SS4_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_DRA74 | CLKF_SOC_DRA76, "dpll_core_h13x2_ck" },
Tero Kristodffa9052018-08-13 14:30:49 +0300367 { DRA7_L3INIT_SATA_CLKCTRL, dra7_sata_bit_data, CLKF_SW_SUP, "func_48m_fclk" },
368 { DRA7_L3INIT_OCP2SCP1_CLKCTRL, NULL, CLKF_HW_SUP, "l4_root_clk_div" },
369 { DRA7_L3INIT_OCP2SCP3_CLKCTRL, NULL, CLKF_HW_SUP, "l4_root_clk_div" },
370 { DRA7_L3INIT_USB_OTG_SS1_CLKCTRL, dra7_usb_otg_ss1_bit_data, CLKF_HW_SUP, "dpll_core_h13x2_ck" },
371 { 0 },
372};
373
374static const char * const dra7_optfclk_pciephy1_clk_parents[] __initconst = {
375 "apll_pcie_ck",
376 NULL,
377};
378
379static const char * const dra7_optfclk_pciephy1_div_clk_parents[] __initconst = {
380 "optfclk_pciephy_div",
381 NULL,
382};
383
384static const struct omap_clkctrl_bit_data dra7_pcie1_bit_data[] __initconst = {
385 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
386 { 9, TI_CLK_GATE, dra7_optfclk_pciephy1_clk_parents, NULL },
387 { 10, TI_CLK_GATE, dra7_optfclk_pciephy1_div_clk_parents, NULL },
388 { 0 },
389};
390
391static const struct omap_clkctrl_bit_data dra7_pcie2_bit_data[] __initconst = {
392 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
393 { 9, TI_CLK_GATE, dra7_optfclk_pciephy1_clk_parents, NULL },
394 { 10, TI_CLK_GATE, dra7_optfclk_pciephy1_div_clk_parents, NULL },
395 { 0 },
396};
397
398static const struct omap_clkctrl_reg_data dra7_pcie_clkctrl_regs[] __initconst = {
399 { DRA7_PCIE_PCIE1_CLKCTRL, dra7_pcie1_bit_data, CLKF_SW_SUP, "l4_root_clk_div" },
400 { DRA7_PCIE_PCIE2_CLKCTRL, dra7_pcie2_bit_data, CLKF_SW_SUP, "l4_root_clk_div" },
401 { 0 },
402};
403
404static const char * const dra7_rmii_50mhz_clk_mux_parents[] __initconst = {
405 "dpll_gmac_h11x2_ck",
406 "rmii_clk_ck",
407 NULL,
408};
409
410static const char * const dra7_gmac_rft_clk_mux_parents[] __initconst = {
411 "video1_clkin_ck",
412 "video2_clkin_ck",
413 "dpll_abe_m2_ck",
414 "hdmi_clkin_ck",
415 "l3_iclk_div",
416 NULL,
417};
418
419static const struct omap_clkctrl_bit_data dra7_gmac_bit_data[] __initconst = {
420 { 24, TI_CLK_MUX, dra7_rmii_50mhz_clk_mux_parents, NULL },
421 { 25, TI_CLK_MUX, dra7_gmac_rft_clk_mux_parents, NULL },
422 { 0 },
423};
424
425static const struct omap_clkctrl_reg_data dra7_gmac_clkctrl_regs[] __initconst = {
426 { DRA7_GMAC_GMAC_CLKCTRL, dra7_gmac_bit_data, CLKF_SW_SUP, "dpll_gmac_ck" },
427 { 0 },
428};
429
430static const char * const dra7_timer10_gfclk_mux_parents[] __initconst = {
431 "timer_sys_clk_div",
432 "sys_32k_ck",
433 "sys_clkin2",
434 "ref_clkin0_ck",
435 "ref_clkin1_ck",
436 "ref_clkin2_ck",
437 "ref_clkin3_ck",
438 "abe_giclk_div",
439 "video1_div_clk",
440 "video2_div_clk",
441 "hdmi_div_clk",
442 NULL,
443};
444
445static const struct omap_clkctrl_bit_data dra7_timer10_bit_data[] __initconst = {
446 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
447 { 0 },
448};
449
450static const struct omap_clkctrl_bit_data dra7_timer11_bit_data[] __initconst = {
451 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
452 { 0 },
453};
454
455static const struct omap_clkctrl_bit_data dra7_timer2_bit_data[] __initconst = {
456 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
457 { 0 },
458};
459
460static const struct omap_clkctrl_bit_data dra7_timer3_bit_data[] __initconst = {
461 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
462 { 0 },
463};
464
465static const struct omap_clkctrl_bit_data dra7_timer4_bit_data[] __initconst = {
466 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
467 { 0 },
468};
469
470static const struct omap_clkctrl_bit_data dra7_timer9_bit_data[] __initconst = {
471 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
472 { 0 },
473};
474
475static const struct omap_clkctrl_bit_data dra7_gpio2_bit_data[] __initconst = {
476 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
477 { 0 },
478};
479
480static const struct omap_clkctrl_bit_data dra7_gpio3_bit_data[] __initconst = {
481 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
482 { 0 },
483};
484
485static const struct omap_clkctrl_bit_data dra7_gpio4_bit_data[] __initconst = {
486 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
487 { 0 },
488};
489
490static const struct omap_clkctrl_bit_data dra7_gpio5_bit_data[] __initconst = {
491 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
492 { 0 },
493};
494
495static const struct omap_clkctrl_bit_data dra7_gpio6_bit_data[] __initconst = {
496 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
497 { 0 },
498};
499
500static const struct omap_clkctrl_bit_data dra7_gpio7_bit_data[] __initconst = {
501 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
502 { 0 },
503};
504
505static const struct omap_clkctrl_bit_data dra7_gpio8_bit_data[] __initconst = {
506 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
507 { 0 },
508};
509
510static const char * const dra7_mmc3_gfclk_div_parents[] __initconst = {
511 "l4per-clkctrl:00f8:24",
512 NULL,
513};
514
515static const struct omap_clkctrl_div_data dra7_mmc3_gfclk_div_data __initconst = {
516 .max_div = 4,
517 .flags = CLK_DIVIDER_POWER_OF_TWO,
518};
519
520static const struct omap_clkctrl_bit_data dra7_mmc3_bit_data[] __initconst = {
521 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
522 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
523 { 25, TI_CLK_DIVIDER, dra7_mmc3_gfclk_div_parents, &dra7_mmc3_gfclk_div_data },
524 { 0 },
525};
526
527static const char * const dra7_mmc4_gfclk_div_parents[] __initconst = {
528 "l4per-clkctrl:0100:24",
529 NULL,
530};
531
532static const struct omap_clkctrl_div_data dra7_mmc4_gfclk_div_data __initconst = {
533 .max_div = 4,
534 .flags = CLK_DIVIDER_POWER_OF_TWO,
535};
536
537static const struct omap_clkctrl_bit_data dra7_mmc4_bit_data[] __initconst = {
538 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
539 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
540 { 25, TI_CLK_DIVIDER, dra7_mmc4_gfclk_div_parents, &dra7_mmc4_gfclk_div_data },
541 { 0 },
542};
543
544static const struct omap_clkctrl_bit_data dra7_uart1_bit_data[] __initconst = {
545 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
546 { 0 },
547};
548
549static const struct omap_clkctrl_bit_data dra7_uart2_bit_data[] __initconst = {
550 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
551 { 0 },
552};
553
554static const struct omap_clkctrl_bit_data dra7_uart3_bit_data[] __initconst = {
555 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
556 { 0 },
557};
558
559static const struct omap_clkctrl_bit_data dra7_uart4_bit_data[] __initconst = {
560 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
561 { 0 },
562};
563
564static const struct omap_clkctrl_bit_data dra7_uart5_bit_data[] __initconst = {
565 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
566 { 0 },
567};
568
569static const struct omap_clkctrl_reg_data dra7_l4per_clkctrl_regs[] __initconst = {
570 { DRA7_L4PER_TIMER10_CLKCTRL, dra7_timer10_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0000:24" },
571 { DRA7_L4PER_TIMER11_CLKCTRL, dra7_timer11_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0008:24" },
572 { DRA7_L4PER_TIMER2_CLKCTRL, dra7_timer2_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0010:24" },
573 { DRA7_L4PER_TIMER3_CLKCTRL, dra7_timer3_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0018:24" },
574 { DRA7_L4PER_TIMER4_CLKCTRL, dra7_timer4_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0020:24" },
575 { DRA7_L4PER_TIMER9_CLKCTRL, dra7_timer9_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0028:24" },
576 { DRA7_L4PER_ELM_CLKCTRL, NULL, 0, "l3_iclk_div" },
577 { DRA7_L4PER_GPIO2_CLKCTRL, dra7_gpio2_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
578 { DRA7_L4PER_GPIO3_CLKCTRL, dra7_gpio3_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
579 { DRA7_L4PER_GPIO4_CLKCTRL, dra7_gpio4_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
580 { DRA7_L4PER_GPIO5_CLKCTRL, dra7_gpio5_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
581 { DRA7_L4PER_GPIO6_CLKCTRL, dra7_gpio6_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
582 { DRA7_L4PER_HDQ1W_CLKCTRL, NULL, CLKF_SW_SUP, "func_12m_fclk" },
583 { DRA7_L4PER_I2C1_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
584 { DRA7_L4PER_I2C2_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
585 { DRA7_L4PER_I2C3_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
586 { DRA7_L4PER_I2C4_CLKCTRL, NULL, CLKF_SW_SUP, "func_96m_fclk" },
587 { DRA7_L4PER_L4_PER1_CLKCTRL, NULL, 0, "l3_iclk_div" },
588 { DRA7_L4PER_MCSPI1_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
589 { DRA7_L4PER_MCSPI2_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
590 { DRA7_L4PER_MCSPI3_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
591 { DRA7_L4PER_MCSPI4_CLKCTRL, NULL, CLKF_SW_SUP, "func_48m_fclk" },
592 { DRA7_L4PER_GPIO7_CLKCTRL, dra7_gpio7_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
593 { DRA7_L4PER_GPIO8_CLKCTRL, dra7_gpio8_bit_data, CLKF_HW_SUP, "l3_iclk_div" },
594 { DRA7_L4PER_MMC3_CLKCTRL, dra7_mmc3_bit_data, CLKF_SW_SUP, "l4per-clkctrl:00f8:25" },
595 { DRA7_L4PER_MMC4_CLKCTRL, dra7_mmc4_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0100:25" },
596 { DRA7_L4PER_UART1_CLKCTRL, dra7_uart1_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0118:24" },
597 { DRA7_L4PER_UART2_CLKCTRL, dra7_uart2_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0120:24" },
598 { DRA7_L4PER_UART3_CLKCTRL, dra7_uart3_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0128:24" },
599 { DRA7_L4PER_UART4_CLKCTRL, dra7_uart4_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0130:24" },
600 { DRA7_L4PER_UART5_CLKCTRL, dra7_uart5_bit_data, CLKF_SW_SUP, "l4per-clkctrl:0148:24" },
601 { 0 },
602};
603
604static const struct omap_clkctrl_reg_data dra7_l4sec_clkctrl_regs[] __initconst = {
605 { DRA7_L4SEC_AES1_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
606 { DRA7_L4SEC_AES2_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
607 { DRA7_L4SEC_DES_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
Tero Kristo869decd2019-04-04 11:11:05 +0300608 { DRA7_L4SEC_RNG_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_SOC_NONSEC, "" },
Tero Kristodffa9052018-08-13 14:30:49 +0300609 { DRA7_L4SEC_SHAM_CLKCTRL, NULL, CLKF_HW_SUP, "l3_iclk_div" },
610 { 0 },
611};
612
613static const char * const dra7_qspi_gfclk_mux_parents[] __initconst = {
614 "func_128m_clk",
615 "dpll_per_h13x2_ck",
616 NULL,
617};
618
619static const char * const dra7_qspi_gfclk_div_parents[] __initconst = {
620 "l4per2-clkctrl:012c:24",
621 NULL,
622};
623
624static const struct omap_clkctrl_div_data dra7_qspi_gfclk_div_data __initconst = {
625 .max_div = 4,
626 .flags = CLK_DIVIDER_POWER_OF_TWO,
627};
628
629static const struct omap_clkctrl_bit_data dra7_qspi_bit_data[] __initconst = {
630 { 24, TI_CLK_MUX, dra7_qspi_gfclk_mux_parents, NULL },
631 { 25, TI_CLK_DIVIDER, dra7_qspi_gfclk_div_parents, &dra7_qspi_gfclk_div_data },
632 { 0 },
633};
634
635static const struct omap_clkctrl_bit_data dra7_mcasp2_bit_data[] __initconst = {
636 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
637 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
638 { 28, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
639 { 0 },
640};
641
642static const struct omap_clkctrl_bit_data dra7_mcasp3_bit_data[] __initconst = {
643 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
644 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
645 { 0 },
646};
647
648static const struct omap_clkctrl_bit_data dra7_mcasp5_bit_data[] __initconst = {
649 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
650 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
651 { 0 },
652};
653
654static const struct omap_clkctrl_bit_data dra7_mcasp8_bit_data[] __initconst = {
655 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
656 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
657 { 0 },
658};
659
660static const struct omap_clkctrl_bit_data dra7_mcasp4_bit_data[] __initconst = {
661 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
662 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
663 { 0 },
664};
665
666static const struct omap_clkctrl_bit_data dra7_uart7_bit_data[] __initconst = {
667 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
668 { 0 },
669};
670
671static const struct omap_clkctrl_bit_data dra7_uart8_bit_data[] __initconst = {
672 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
673 { 0 },
674};
675
676static const struct omap_clkctrl_bit_data dra7_uart9_bit_data[] __initconst = {
677 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
678 { 0 },
679};
680
681static const struct omap_clkctrl_bit_data dra7_mcasp6_bit_data[] __initconst = {
682 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
683 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
684 { 0 },
685};
686
687static const struct omap_clkctrl_bit_data dra7_mcasp7_bit_data[] __initconst = {
688 { 22, TI_CLK_MUX, dra7_mcasp1_aux_gfclk_mux_parents, NULL },
689 { 24, TI_CLK_MUX, dra7_mcasp1_ahclkx_mux_parents, NULL },
690 { 0 },
691};
692
693static const struct omap_clkctrl_reg_data dra7_l4per2_clkctrl_regs[] __initconst = {
694 { DRA7_L4PER2_L4_PER2_CLKCTRL, NULL, 0, "l3_iclk_div" },
695 { DRA7_L4PER2_PRUSS1_CLKCTRL, NULL, CLKF_SW_SUP, "" },
696 { DRA7_L4PER2_PRUSS2_CLKCTRL, NULL, CLKF_SW_SUP, "" },
697 { DRA7_L4PER2_EPWMSS1_CLKCTRL, NULL, CLKF_SW_SUP, "l4_root_clk_div" },
698 { DRA7_L4PER2_EPWMSS2_CLKCTRL, NULL, CLKF_SW_SUP, "l4_root_clk_div" },
699 { DRA7_L4PER2_EPWMSS0_CLKCTRL, NULL, CLKF_SW_SUP, "l4_root_clk_div" },
700 { DRA7_L4PER2_QSPI_CLKCTRL, dra7_qspi_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:012c:25" },
701 { DRA7_L4PER2_MCASP2_CLKCTRL, dra7_mcasp2_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:0154:22" },
702 { DRA7_L4PER2_MCASP3_CLKCTRL, dra7_mcasp3_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:015c:22" },
703 { DRA7_L4PER2_MCASP5_CLKCTRL, dra7_mcasp5_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:016c:22" },
Tony Lindgrendd8882a2019-09-23 10:32:37 -0700704 { DRA7_L4PER2_MCASP8_CLKCTRL, dra7_mcasp8_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:0184:22" },
Tero Kristodffa9052018-08-13 14:30:49 +0300705 { DRA7_L4PER2_MCASP4_CLKCTRL, dra7_mcasp4_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:018c:22" },
706 { DRA7_L4PER2_UART7_CLKCTRL, dra7_uart7_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01c4:24" },
707 { DRA7_L4PER2_UART8_CLKCTRL, dra7_uart8_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01d4:24" },
708 { DRA7_L4PER2_UART9_CLKCTRL, dra7_uart9_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01dc:24" },
709 { DRA7_L4PER2_DCAN2_CLKCTRL, NULL, CLKF_SW_SUP, "sys_clkin1" },
710 { DRA7_L4PER2_MCASP6_CLKCTRL, dra7_mcasp6_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01f8:22" },
711 { DRA7_L4PER2_MCASP7_CLKCTRL, dra7_mcasp7_bit_data, CLKF_SW_SUP, "l4per2-clkctrl:01fc:22" },
712 { 0 },
713};
714
715static const struct omap_clkctrl_bit_data dra7_timer13_bit_data[] __initconst = {
716 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
717 { 0 },
718};
719
720static const struct omap_clkctrl_bit_data dra7_timer14_bit_data[] __initconst = {
721 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
722 { 0 },
723};
724
725static const struct omap_clkctrl_bit_data dra7_timer15_bit_data[] __initconst = {
726 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
727 { 0 },
728};
729
730static const struct omap_clkctrl_bit_data dra7_timer16_bit_data[] __initconst = {
731 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
732 { 0 },
733};
734
735static const struct omap_clkctrl_reg_data dra7_l4per3_clkctrl_regs[] __initconst = {
736 { DRA7_L4PER3_L4_PER3_CLKCTRL, NULL, 0, "l3_iclk_div" },
737 { DRA7_L4PER3_TIMER13_CLKCTRL, dra7_timer13_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:00b4:24" },
738 { DRA7_L4PER3_TIMER14_CLKCTRL, dra7_timer14_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:00bc:24" },
739 { DRA7_L4PER3_TIMER15_CLKCTRL, dra7_timer15_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:00c4:24" },
740 { DRA7_L4PER3_TIMER16_CLKCTRL, dra7_timer16_bit_data, CLKF_SW_SUP, "l4per3-clkctrl:011c:24" },
741 { 0 },
742};
743
744static const struct omap_clkctrl_bit_data dra7_gpio1_bit_data[] __initconst = {
745 { 8, TI_CLK_GATE, dra7_dss_32khz_clk_parents, NULL },
746 { 0 },
747};
748
749static const struct omap_clkctrl_bit_data dra7_timer1_bit_data[] __initconst = {
750 { 24, TI_CLK_MUX, dra7_timer10_gfclk_mux_parents, NULL },
751 { 0 },
752};
753
754static const struct omap_clkctrl_bit_data dra7_uart10_bit_data[] __initconst = {
755 { 24, TI_CLK_MUX, dra7_uart6_gfclk_mux_parents, NULL },
756 { 0 },
757};
758
759static const char * const dra7_dcan1_sys_clk_mux_parents[] __initconst = {
760 "sys_clkin1",
761 "sys_clkin2",
762 NULL,
763};
764
765static const struct omap_clkctrl_bit_data dra7_dcan1_bit_data[] __initconst = {
766 { 24, TI_CLK_MUX, dra7_dcan1_sys_clk_mux_parents, NULL },
767 { 0 },
768};
769
770static const struct omap_clkctrl_reg_data dra7_wkupaon_clkctrl_regs[] __initconst = {
771 { DRA7_WKUPAON_L4_WKUP_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" },
772 { DRA7_WKUPAON_WD_TIMER2_CLKCTRL, NULL, CLKF_SW_SUP, "sys_32k_ck" },
773 { DRA7_WKUPAON_GPIO1_CLKCTRL, dra7_gpio1_bit_data, CLKF_HW_SUP, "wkupaon_iclk_mux" },
774 { DRA7_WKUPAON_TIMER1_CLKCTRL, dra7_timer1_bit_data, CLKF_SW_SUP, "wkupaon-clkctrl:0020:24" },
Tero Kristo869decd2019-04-04 11:11:05 +0300775 { DRA7_WKUPAON_TIMER12_CLKCTRL, NULL, CLKF_SOC_NONSEC, "secure_32k_clk_src_ck" },
Tero Kristodffa9052018-08-13 14:30:49 +0300776 { DRA7_WKUPAON_COUNTER_32K_CLKCTRL, NULL, 0, "wkupaon_iclk_mux" },
777 { DRA7_WKUPAON_UART10_CLKCTRL, dra7_uart10_bit_data, CLKF_SW_SUP, "wkupaon-clkctrl:0060:24" },
778 { DRA7_WKUPAON_DCAN1_CLKCTRL, dra7_dcan1_bit_data, CLKF_SW_SUP, "wkupaon-clkctrl:0068:24" },
779 { DRA7_WKUPAON_ADC_CLKCTRL, NULL, CLKF_SW_SUP, "mcan_clk" },
780 { 0 },
781};
782
783const struct omap_clkctrl_data dra7_clkctrl_data[] __initconst = {
784 { 0x4a005320, dra7_mpu_clkctrl_regs },
785 { 0x4a005420, dra7_dsp1_clkctrl_regs },
786 { 0x4a005520, dra7_ipu1_clkctrl_regs },
787 { 0x4a005550, dra7_ipu_clkctrl_regs },
788 { 0x4a005620, dra7_dsp2_clkctrl_regs },
789 { 0x4a005720, dra7_rtc_clkctrl_regs },
790 { 0x4a008620, dra7_coreaon_clkctrl_regs },
791 { 0x4a008720, dra7_l3main1_clkctrl_regs },
792 { 0x4a008920, dra7_ipu2_clkctrl_regs },
793 { 0x4a008a20, dra7_dma_clkctrl_regs },
794 { 0x4a008b20, dra7_emif_clkctrl_regs },
795 { 0x4a008c00, dra7_atl_clkctrl_regs },
796 { 0x4a008d20, dra7_l4cfg_clkctrl_regs },
797 { 0x4a008e20, dra7_l3instr_clkctrl_regs },
Benoit Parrot7054c142019-12-11 08:05:49 -0600798 { 0x4a009020, dra7_cam_clkctrl_regs },
Tero Kristodffa9052018-08-13 14:30:49 +0300799 { 0x4a009120, dra7_dss_clkctrl_regs },
800 { 0x4a009320, dra7_l3init_clkctrl_regs },
801 { 0x4a0093b0, dra7_pcie_clkctrl_regs },
802 { 0x4a0093d0, dra7_gmac_clkctrl_regs },
803 { 0x4a009728, dra7_l4per_clkctrl_regs },
804 { 0x4a0098a0, dra7_l4sec_clkctrl_regs },
805 { 0x4a00970c, dra7_l4per2_clkctrl_regs },
806 { 0x4a009714, dra7_l4per3_clkctrl_regs },
807 { 0x4ae07820, dra7_wkupaon_clkctrl_regs },
808 { 0 },
809};
810
811static struct ti_dt_clk dra7xx_clks[] = {
812 DT_CLK(NULL, "timer_32k_ck", "sys_32k_ck"),
813 DT_CLK(NULL, "sys_clkin_ck", "timer_sys_clk_div"),
814 DT_CLK(NULL, "sys_clkin", "sys_clkin1"),
815 DT_CLK(NULL, "atl_dpll_clk_mux", "atl-clkctrl:0000:24"),
816 DT_CLK(NULL, "atl_gfclk_mux", "atl-clkctrl:0000:26"),
817 DT_CLK(NULL, "dcan1_sys_clk_mux", "wkupaon-clkctrl:0068:24"),
818 DT_CLK(NULL, "dss_32khz_clk", "dss-clkctrl:0000:11"),
819 DT_CLK(NULL, "dss_48mhz_clk", "dss-clkctrl:0000:9"),
820 DT_CLK(NULL, "dss_dss_clk", "dss-clkctrl:0000:8"),
821 DT_CLK(NULL, "dss_hdmi_clk", "dss-clkctrl:0000:10"),
822 DT_CLK(NULL, "dss_video1_clk", "dss-clkctrl:0000:12"),
823 DT_CLK(NULL, "dss_video2_clk", "dss-clkctrl:0000:13"),
824 DT_CLK(NULL, "gmac_rft_clk_mux", "gmac-clkctrl:0000:25"),
825 DT_CLK(NULL, "gpio1_dbclk", "wkupaon-clkctrl:0018:8"),
826 DT_CLK(NULL, "gpio2_dbclk", "l4per-clkctrl:0038:8"),
827 DT_CLK(NULL, "gpio3_dbclk", "l4per-clkctrl:0040:8"),
828 DT_CLK(NULL, "gpio4_dbclk", "l4per-clkctrl:0048:8"),
829 DT_CLK(NULL, "gpio5_dbclk", "l4per-clkctrl:0050:8"),
830 DT_CLK(NULL, "gpio6_dbclk", "l4per-clkctrl:0058:8"),
831 DT_CLK(NULL, "gpio7_dbclk", "l4per-clkctrl:00e8:8"),
832 DT_CLK(NULL, "gpio8_dbclk", "l4per-clkctrl:00f0:8"),
833 DT_CLK(NULL, "ipu1_gfclk_mux", "ipu1-clkctrl:0000:24"),
834 DT_CLK(NULL, "mcasp1_ahclkr_mux", "ipu-clkctrl:0000:28"),
835 DT_CLK(NULL, "mcasp1_ahclkx_mux", "ipu-clkctrl:0000:24"),
836 DT_CLK(NULL, "mcasp1_aux_gfclk_mux", "ipu-clkctrl:0000:22"),
837 DT_CLK(NULL, "mcasp2_ahclkr_mux", "l4per2-clkctrl:0154:28"),
838 DT_CLK(NULL, "mcasp2_ahclkx_mux", "l4per2-clkctrl:0154:24"),
839 DT_CLK(NULL, "mcasp2_aux_gfclk_mux", "l4per2-clkctrl:0154:22"),
840 DT_CLK(NULL, "mcasp3_ahclkx_mux", "l4per2-clkctrl:015c:24"),
841 DT_CLK(NULL, "mcasp3_aux_gfclk_mux", "l4per2-clkctrl:015c:22"),
842 DT_CLK(NULL, "mcasp4_ahclkx_mux", "l4per2-clkctrl:018c:24"),
843 DT_CLK(NULL, "mcasp4_aux_gfclk_mux", "l4per2-clkctrl:018c:22"),
844 DT_CLK(NULL, "mcasp5_ahclkx_mux", "l4per2-clkctrl:016c:24"),
845 DT_CLK(NULL, "mcasp5_aux_gfclk_mux", "l4per2-clkctrl:016c:22"),
846 DT_CLK(NULL, "mcasp6_ahclkx_mux", "l4per2-clkctrl:01f8:24"),
847 DT_CLK(NULL, "mcasp6_aux_gfclk_mux", "l4per2-clkctrl:01f8:22"),
848 DT_CLK(NULL, "mcasp7_ahclkx_mux", "l4per2-clkctrl:01fc:24"),
849 DT_CLK(NULL, "mcasp7_aux_gfclk_mux", "l4per2-clkctrl:01fc:22"),
Tony Lindgrendd8882a2019-09-23 10:32:37 -0700850 DT_CLK(NULL, "mcasp8_ahclkx_mux", "l4per2-clkctrl:0184:24"),
851 DT_CLK(NULL, "mcasp8_aux_gfclk_mux", "l4per2-clkctrl:0184:22"),
Tero Kristodffa9052018-08-13 14:30:49 +0300852 DT_CLK(NULL, "mmc1_clk32k", "l3init-clkctrl:0008:8"),
853 DT_CLK(NULL, "mmc1_fclk_div", "l3init-clkctrl:0008:25"),
854 DT_CLK(NULL, "mmc1_fclk_mux", "l3init-clkctrl:0008:24"),
855 DT_CLK(NULL, "mmc2_clk32k", "l3init-clkctrl:0010:8"),
856 DT_CLK(NULL, "mmc2_fclk_div", "l3init-clkctrl:0010:25"),
857 DT_CLK(NULL, "mmc2_fclk_mux", "l3init-clkctrl:0010:24"),
858 DT_CLK(NULL, "mmc3_clk32k", "l4per-clkctrl:00f8:8"),
859 DT_CLK(NULL, "mmc3_gfclk_div", "l4per-clkctrl:00f8:25"),
860 DT_CLK(NULL, "mmc3_gfclk_mux", "l4per-clkctrl:00f8:24"),
861 DT_CLK(NULL, "mmc4_clk32k", "l4per-clkctrl:0100:8"),
862 DT_CLK(NULL, "mmc4_gfclk_div", "l4per-clkctrl:0100:25"),
863 DT_CLK(NULL, "mmc4_gfclk_mux", "l4per-clkctrl:0100:24"),
864 DT_CLK(NULL, "optfclk_pciephy1_32khz", "pcie-clkctrl:0000:8"),
865 DT_CLK(NULL, "optfclk_pciephy1_clk", "pcie-clkctrl:0000:9"),
866 DT_CLK(NULL, "optfclk_pciephy1_div_clk", "pcie-clkctrl:0000:10"),
867 DT_CLK(NULL, "optfclk_pciephy2_32khz", "pcie-clkctrl:0008:8"),
868 DT_CLK(NULL, "optfclk_pciephy2_clk", "pcie-clkctrl:0008:9"),
869 DT_CLK(NULL, "optfclk_pciephy2_div_clk", "pcie-clkctrl:0008:10"),
870 DT_CLK(NULL, "qspi_gfclk_div", "l4per2-clkctrl:012c:25"),
871 DT_CLK(NULL, "qspi_gfclk_mux", "l4per2-clkctrl:012c:24"),
872 DT_CLK(NULL, "rmii_50mhz_clk_mux", "gmac-clkctrl:0000:24"),
873 DT_CLK(NULL, "sata_ref_clk", "l3init-clkctrl:0068:8"),
874 DT_CLK(NULL, "timer10_gfclk_mux", "l4per-clkctrl:0000:24"),
875 DT_CLK(NULL, "timer11_gfclk_mux", "l4per-clkctrl:0008:24"),
876 DT_CLK(NULL, "timer13_gfclk_mux", "l4per3-clkctrl:00b4:24"),
877 DT_CLK(NULL, "timer14_gfclk_mux", "l4per3-clkctrl:00bc:24"),
878 DT_CLK(NULL, "timer15_gfclk_mux", "l4per3-clkctrl:00c4:24"),
879 DT_CLK(NULL, "timer16_gfclk_mux", "l4per3-clkctrl:011c:24"),
880 DT_CLK(NULL, "timer1_gfclk_mux", "wkupaon-clkctrl:0020:24"),
881 DT_CLK(NULL, "timer2_gfclk_mux", "l4per-clkctrl:0010:24"),
882 DT_CLK(NULL, "timer3_gfclk_mux", "l4per-clkctrl:0018:24"),
883 DT_CLK(NULL, "timer4_gfclk_mux", "l4per-clkctrl:0020:24"),
884 DT_CLK(NULL, "timer5_gfclk_mux", "ipu-clkctrl:0008:24"),
885 DT_CLK(NULL, "timer6_gfclk_mux", "ipu-clkctrl:0010:24"),
886 DT_CLK(NULL, "timer7_gfclk_mux", "ipu-clkctrl:0018:24"),
887 DT_CLK(NULL, "timer8_gfclk_mux", "ipu-clkctrl:0020:24"),
888 DT_CLK(NULL, "timer9_gfclk_mux", "l4per-clkctrl:0028:24"),
889 DT_CLK(NULL, "uart10_gfclk_mux", "wkupaon-clkctrl:0060:24"),
890 DT_CLK(NULL, "uart1_gfclk_mux", "l4per-clkctrl:0118:24"),
891 DT_CLK(NULL, "uart2_gfclk_mux", "l4per-clkctrl:0120:24"),
892 DT_CLK(NULL, "uart3_gfclk_mux", "l4per-clkctrl:0128:24"),
893 DT_CLK(NULL, "uart4_gfclk_mux", "l4per-clkctrl:0130:24"),
894 DT_CLK(NULL, "uart5_gfclk_mux", "l4per-clkctrl:0148:24"),
895 DT_CLK(NULL, "uart6_gfclk_mux", "ipu-clkctrl:0030:24"),
896 DT_CLK(NULL, "uart7_gfclk_mux", "l4per2-clkctrl:01c4:24"),
897 DT_CLK(NULL, "uart8_gfclk_mux", "l4per2-clkctrl:01d4:24"),
898 DT_CLK(NULL, "uart9_gfclk_mux", "l4per2-clkctrl:01dc:24"),
899 DT_CLK(NULL, "usb_otg_ss1_refclk960m", "l3init-clkctrl:00d0:8"),
900 DT_CLK(NULL, "usb_otg_ss2_refclk960m", "l3init-clkctrl:0020:8"),
901 { .node_name = NULL },
902};
903
Tero Kristo251a449d2013-07-18 17:41:00 +0300904int __init dra7xx_dt_clk_init(void)
905{
906 int rc;
Peter Ujfalusi4b3061b2015-08-24 10:35:02 +0300907 struct clk *dpll_ck, *hdcp_ck;
Tero Kristo251a449d2013-07-18 17:41:00 +0300908
Tero Kristodffa9052018-08-13 14:30:49 +0300909 if (ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT)
910 ti_dt_clocks_register(dra7xx_compat_clks);
911 else
912 ti_dt_clocks_register(dra7xx_clks);
Tero Kristo251a449d2013-07-18 17:41:00 +0300913
914 omap2_clk_disable_autoidle_all();
915
Tero Kristoa8202cd2017-08-21 11:04:53 +0300916 ti_clk_add_aliases();
917
Tero Kristo251a449d2013-07-18 17:41:00 +0300918 dpll_ck = clk_get_sys(NULL, "dpll_gmac_ck");
919 rc = clk_set_rate(dpll_ck, DRA7_DPLL_GMAC_DEFFREQ);
920 if (rc)
921 pr_err("%s: failed to configure GMAC DPLL!\n", __func__);
922
Roger Quadros94e72ae2014-03-07 15:09:04 +0200923 dpll_ck = clk_get_sys(NULL, "dpll_usb_ck");
924 rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ);
925 if (rc)
926 pr_err("%s: failed to configure USB DPLL!\n", __func__);
927
928 dpll_ck = clk_get_sys(NULL, "dpll_usb_m2_ck");
929 rc = clk_set_rate(dpll_ck, DRA7_DPLL_USB_DEFFREQ/2);
930 if (rc)
931 pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
932
Tomi Valkeinenf892b202015-02-23 09:11:24 +0200933 hdcp_ck = clk_get_sys(NULL, "dss_deshdcp_clk");
934 rc = clk_prepare_enable(hdcp_ck);
935 if (rc)
936 pr_err("%s: failed to set dss_deshdcp_clk\n", __func__);
937
Tero Kristo251a449d2013-07-18 17:41:00 +0300938 return rc;
939}