blob: 71db39c8c96cf0c80b1d714cfab95f42d2612762 [file] [log] [blame]
Aneesh V0d2628b2011-07-21 09:10:07 -04001/*
2 * (C) Copyright 2010
3 * Texas Instruments, <www.ti.com>
4 *
5 * Aneesh V <aneesh@ti.com>
6 *
7 * See file CREDITS for list of people who contributed to this
8 * project.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA
24 */
25#ifndef _CLOCKS_OMAP4_H_
26#define _CLOCKS_OMAP4_H_
27#include <common.h>
28
29/*
30 * Assuming a maximum of 1.5 GHz ARM speed and a minimum of 2 cycles per
31 * loop, allow for a minimum of 2 ms wait (in reality the wait will be
32 * much more than that)
33 */
34#define LDELAY 1000000
35
36#define CM_CLKMODE_DPLL_CORE (OMAP44XX_L4_CORE_BASE + 0x4120)
37#define CM_CLKMODE_DPLL_PER (OMAP44XX_L4_CORE_BASE + 0x8140)
38#define CM_CLKMODE_DPLL_MPU (OMAP44XX_L4_CORE_BASE + 0x4160)
39#define CM_CLKSEL_CORE (OMAP44XX_L4_CORE_BASE + 0x4100)
40
41struct omap4_prcm_regs {
42 /* cm1.ckgen */
43 u32 cm_clksel_core;
44 u32 pad001[1];
45 u32 cm_clksel_abe;
46 u32 pad002[1];
47 u32 cm_dll_ctrl;
48 u32 pad003[3];
49 u32 cm_clkmode_dpll_core;
50 u32 cm_idlest_dpll_core;
51 u32 cm_autoidle_dpll_core;
52 u32 cm_clksel_dpll_core;
53 u32 cm_div_m2_dpll_core;
54 u32 cm_div_m3_dpll_core;
55 u32 cm_div_m4_dpll_core;
56 u32 cm_div_m5_dpll_core;
57 u32 cm_div_m6_dpll_core;
58 u32 cm_div_m7_dpll_core;
59 u32 cm_ssc_deltamstep_dpll_core;
60 u32 cm_ssc_modfreqdiv_dpll_core;
61 u32 cm_emu_override_dpll_core;
62 u32 pad004[3];
63 u32 cm_clkmode_dpll_mpu;
64 u32 cm_idlest_dpll_mpu;
65 u32 cm_autoidle_dpll_mpu;
66 u32 cm_clksel_dpll_mpu;
67 u32 cm_div_m2_dpll_mpu;
68 u32 pad005[5];
69 u32 cm_ssc_deltamstep_dpll_mpu;
70 u32 cm_ssc_modfreqdiv_dpll_mpu;
71 u32 pad006[3];
72 u32 cm_bypclk_dpll_mpu;
73 u32 cm_clkmode_dpll_iva;
74 u32 cm_idlest_dpll_iva;
75 u32 cm_autoidle_dpll_iva;
76 u32 cm_clksel_dpll_iva;
77 u32 pad007[2];
78 u32 cm_div_m4_dpll_iva;
79 u32 cm_div_m5_dpll_iva;
80 u32 pad008[2];
81 u32 cm_ssc_deltamstep_dpll_iva;
82 u32 cm_ssc_modfreqdiv_dpll_iva;
83 u32 pad009[3];
84 u32 cm_bypclk_dpll_iva;
85 u32 cm_clkmode_dpll_abe;
86 u32 cm_idlest_dpll_abe;
87 u32 cm_autoidle_dpll_abe;
88 u32 cm_clksel_dpll_abe;
89 u32 cm_div_m2_dpll_abe;
90 u32 cm_div_m3_dpll_abe;
91 u32 pad010[4];
92 u32 cm_ssc_deltamstep_dpll_abe;
93 u32 cm_ssc_modfreqdiv_dpll_abe;
94 u32 pad011[4];
95 u32 cm_clkmode_dpll_ddrphy;
96 u32 cm_idlest_dpll_ddrphy;
97 u32 cm_autoidle_dpll_ddrphy;
98 u32 cm_clksel_dpll_ddrphy;
99 u32 cm_div_m2_dpll_ddrphy;
100 u32 pad012[1];
101 u32 cm_div_m4_dpll_ddrphy;
102 u32 cm_div_m5_dpll_ddrphy;
103 u32 cm_div_m6_dpll_ddrphy;
104 u32 pad013[1];
105 u32 cm_ssc_deltamstep_dpll_ddrphy;
106 u32 pad014[5];
107 u32 cm_shadow_freq_config1;
108
109 /* cm1.dsp */
110 u32 pad015[103];
111 u32 cm_dsp_clkstctrl;
112 u32 pad016[7];
113 u32 cm_dsp_dsp_clkctrl;
114
115 /* cm1.abe */
116 u32 pad017[55];
117 u32 cm1_abe_clkstctrl;
118 u32 pad018[7];
119 u32 cm1_abe_l4abe_clkctrl;
120 u32 pad019[1];
121 u32 cm1_abe_aess_clkctrl;
122 u32 pad020[1];
123 u32 cm1_abe_pdm_clkctrl;
124 u32 pad021[1];
125 u32 cm1_abe_dmic_clkctrl;
126 u32 pad022[1];
127 u32 cm1_abe_mcasp_clkctrl;
128 u32 pad023[1];
129 u32 cm1_abe_mcbsp1_clkctrl;
130 u32 pad024[1];
131 u32 cm1_abe_mcbsp2_clkctrl;
132 u32 pad025[1];
133 u32 cm1_abe_mcbsp3_clkctrl;
134 u32 pad026[1];
135 u32 cm1_abe_slimbus_clkctrl;
136 u32 pad027[1];
137 u32 cm1_abe_timer5_clkctrl;
138 u32 pad028[1];
139 u32 cm1_abe_timer6_clkctrl;
140 u32 pad029[1];
141 u32 cm1_abe_timer7_clkctrl;
142 u32 pad030[1];
143 u32 cm1_abe_timer8_clkctrl;
144 u32 pad031[1];
145 u32 cm1_abe_wdt3_clkctrl;
146
147 /* cm2.ckgen */
148 u32 pad032[3805];
149 u32 cm_clksel_mpu_m3_iss_root;
150 u32 cm_clksel_usb_60mhz;
151 u32 cm_scale_fclk;
152 u32 pad033[1];
153 u32 cm_core_dvfs_perf1;
154 u32 cm_core_dvfs_perf2;
155 u32 cm_core_dvfs_perf3;
156 u32 cm_core_dvfs_perf4;
157 u32 pad034[1];
158 u32 cm_core_dvfs_current;
159 u32 cm_iva_dvfs_perf_tesla;
160 u32 cm_iva_dvfs_perf_ivahd;
161 u32 cm_iva_dvfs_perf_abe;
162 u32 pad035[1];
163 u32 cm_iva_dvfs_current;
164 u32 pad036[1];
165 u32 cm_clkmode_dpll_per;
166 u32 cm_idlest_dpll_per;
167 u32 cm_autoidle_dpll_per;
168 u32 cm_clksel_dpll_per;
169 u32 cm_div_m2_dpll_per;
170 u32 cm_div_m3_dpll_per;
171 u32 cm_div_m4_dpll_per;
172 u32 cm_div_m5_dpll_per;
173 u32 cm_div_m6_dpll_per;
174 u32 cm_div_m7_dpll_per;
175 u32 cm_ssc_deltamstep_dpll_per;
176 u32 cm_ssc_modfreqdiv_dpll_per;
177 u32 cm_emu_override_dpll_per;
178 u32 pad037[3];
179 u32 cm_clkmode_dpll_usb;
180 u32 cm_idlest_dpll_usb;
181 u32 cm_autoidle_dpll_usb;
182 u32 cm_clksel_dpll_usb;
183 u32 cm_div_m2_dpll_usb;
184 u32 pad038[5];
185 u32 cm_ssc_deltamstep_dpll_usb;
186 u32 cm_ssc_modfreqdiv_dpll_usb;
187 u32 pad039[1];
188 u32 cm_clkdcoldo_dpll_usb;
189 u32 pad040[2];
190 u32 cm_clkmode_dpll_unipro;
191 u32 cm_idlest_dpll_unipro;
192 u32 cm_autoidle_dpll_unipro;
193 u32 cm_clksel_dpll_unipro;
194 u32 cm_div_m2_dpll_unipro;
195 u32 pad041[5];
196 u32 cm_ssc_deltamstep_dpll_unipro;
197 u32 cm_ssc_modfreqdiv_dpll_unipro;
198
199 /* cm2.core */
200 u32 pad0411[324];
201 u32 cm_l3_1_clkstctrl;
202 u32 pad042[1];
203 u32 cm_l3_1_dynamicdep;
204 u32 pad043[5];
205 u32 cm_l3_1_l3_1_clkctrl;
206 u32 pad044[55];
207 u32 cm_l3_2_clkstctrl;
208 u32 pad045[1];
209 u32 cm_l3_2_dynamicdep;
210 u32 pad046[5];
211 u32 cm_l3_2_l3_2_clkctrl;
212 u32 pad047[1];
213 u32 cm_l3_2_gpmc_clkctrl;
214 u32 pad048[1];
215 u32 cm_l3_2_ocmc_ram_clkctrl;
216 u32 pad049[51];
217 u32 cm_mpu_m3_clkstctrl;
218 u32 cm_mpu_m3_staticdep;
219 u32 cm_mpu_m3_dynamicdep;
220 u32 pad050[5];
221 u32 cm_mpu_m3_mpu_m3_clkctrl;
222 u32 pad051[55];
223 u32 cm_sdma_clkstctrl;
224 u32 cm_sdma_staticdep;
225 u32 cm_sdma_dynamicdep;
226 u32 pad052[5];
227 u32 cm_sdma_sdma_clkctrl;
228 u32 pad053[55];
229 u32 cm_memif_clkstctrl;
230 u32 pad054[7];
231 u32 cm_memif_dmm_clkctrl;
232 u32 pad055[1];
233 u32 cm_memif_emif_fw_clkctrl;
234 u32 pad056[1];
235 u32 cm_memif_emif_1_clkctrl;
236 u32 pad057[1];
237 u32 cm_memif_emif_2_clkctrl;
238 u32 pad058[1];
239 u32 cm_memif_dll_clkctrl;
240 u32 pad059[3];
241 u32 cm_memif_emif_h1_clkctrl;
242 u32 pad060[1];
243 u32 cm_memif_emif_h2_clkctrl;
244 u32 pad061[1];
245 u32 cm_memif_dll_h_clkctrl;
246 u32 pad062[39];
247 u32 cm_c2c_clkstctrl;
248 u32 cm_c2c_staticdep;
249 u32 cm_c2c_dynamicdep;
250 u32 pad063[5];
251 u32 cm_c2c_sad2d_clkctrl;
252 u32 pad064[1];
253 u32 cm_c2c_modem_icr_clkctrl;
254 u32 pad065[1];
255 u32 cm_c2c_sad2d_fw_clkctrl;
256 u32 pad066[51];
257 u32 cm_l4cfg_clkstctrl;
258 u32 pad067[1];
259 u32 cm_l4cfg_dynamicdep;
260 u32 pad068[5];
261 u32 cm_l4cfg_l4_cfg_clkctrl;
262 u32 pad069[1];
263 u32 cm_l4cfg_hw_sem_clkctrl;
264 u32 pad070[1];
265 u32 cm_l4cfg_mailbox_clkctrl;
266 u32 pad071[1];
267 u32 cm_l4cfg_sar_rom_clkctrl;
268 u32 pad072[49];
269 u32 cm_l3instr_clkstctrl;
270 u32 pad073[7];
271 u32 cm_l3instr_l3_3_clkctrl;
272 u32 pad074[1];
273 u32 cm_l3instr_l3_instr_clkctrl;
274 u32 pad075[5];
275 u32 cm_l3instr_intrconn_wp1_clkctrl;
276
277
278 /* cm2.ivahd */
279 u32 pad076[47];
280 u32 cm_ivahd_clkstctrl;
281 u32 pad077[7];
282 u32 cm_ivahd_ivahd_clkctrl;
283 u32 pad078[1];
284 u32 cm_ivahd_sl2_clkctrl;
285
286 /* cm2.cam */
287 u32 pad079[53];
288 u32 cm_cam_clkstctrl;
289 u32 pad080[7];
290 u32 cm_cam_iss_clkctrl;
291 u32 pad081[1];
292 u32 cm_cam_fdif_clkctrl;
293
294 /* cm2.dss */
295 u32 pad082[53];
296 u32 cm_dss_clkstctrl;
297 u32 pad083[7];
298 u32 cm_dss_dss_clkctrl;
299
300 /* cm2.sgx */
301 u32 pad084[55];
302 u32 cm_sgx_clkstctrl;
303 u32 pad085[7];
304 u32 cm_sgx_sgx_clkctrl;
305
306 /* cm2.l3init */
307 u32 pad086[55];
308 u32 cm_l3init_clkstctrl;
309
310 /* cm2.l3init */
311 u32 pad087[9];
312 u32 cm_l3init_hsmmc1_clkctrl;
313 u32 pad088[1];
314 u32 cm_l3init_hsmmc2_clkctrl;
315 u32 pad089[1];
316 u32 cm_l3init_hsi_clkctrl;
317 u32 pad090[7];
318 u32 cm_l3init_hsusbhost_clkctrl;
319 u32 pad091[1];
320 u32 cm_l3init_hsusbotg_clkctrl;
321 u32 pad092[1];
322 u32 cm_l3init_hsusbtll_clkctrl;
323 u32 pad093[3];
324 u32 cm_l3init_p1500_clkctrl;
325 u32 pad094[21];
326 u32 cm_l3init_fsusb_clkctrl;
327 u32 pad095[3];
328 u32 cm_l3init_usbphy_clkctrl;
329
330 /* cm2.l4per */
331 u32 pad096[7];
332 u32 cm_l4per_clkstctrl;
333 u32 pad097[1];
334 u32 cm_l4per_dynamicdep;
335 u32 pad098[5];
336 u32 cm_l4per_adc_clkctrl;
337 u32 pad100[1];
338 u32 cm_l4per_gptimer10_clkctrl;
339 u32 pad101[1];
340 u32 cm_l4per_gptimer11_clkctrl;
341 u32 pad102[1];
342 u32 cm_l4per_gptimer2_clkctrl;
343 u32 pad103[1];
344 u32 cm_l4per_gptimer3_clkctrl;
345 u32 pad104[1];
346 u32 cm_l4per_gptimer4_clkctrl;
347 u32 pad105[1];
348 u32 cm_l4per_gptimer9_clkctrl;
349 u32 pad106[1];
350 u32 cm_l4per_elm_clkctrl;
351 u32 pad107[1];
352 u32 cm_l4per_gpio2_clkctrl;
353 u32 pad108[1];
354 u32 cm_l4per_gpio3_clkctrl;
355 u32 pad109[1];
356 u32 cm_l4per_gpio4_clkctrl;
357 u32 pad110[1];
358 u32 cm_l4per_gpio5_clkctrl;
359 u32 pad111[1];
360 u32 cm_l4per_gpio6_clkctrl;
361 u32 pad112[1];
362 u32 cm_l4per_hdq1w_clkctrl;
363 u32 pad113[1];
364 u32 cm_l4per_hecc1_clkctrl;
365 u32 pad114[1];
366 u32 cm_l4per_hecc2_clkctrl;
367 u32 pad115[1];
368 u32 cm_l4per_i2c1_clkctrl;
369 u32 pad116[1];
370 u32 cm_l4per_i2c2_clkctrl;
371 u32 pad117[1];
372 u32 cm_l4per_i2c3_clkctrl;
373 u32 pad118[1];
374 u32 cm_l4per_i2c4_clkctrl;
375 u32 pad119[1];
376 u32 cm_l4per_l4per_clkctrl;
377 u32 pad1191[3];
378 u32 cm_l4per_mcasp2_clkctrl;
379 u32 pad120[1];
380 u32 cm_l4per_mcasp3_clkctrl;
381 u32 pad121[1];
382 u32 cm_l4per_mcbsp4_clkctrl;
383 u32 pad122[1];
384 u32 cm_l4per_mgate_clkctrl;
385 u32 pad123[1];
386 u32 cm_l4per_mcspi1_clkctrl;
387 u32 pad124[1];
388 u32 cm_l4per_mcspi2_clkctrl;
389 u32 pad125[1];
390 u32 cm_l4per_mcspi3_clkctrl;
391 u32 pad126[1];
392 u32 cm_l4per_mcspi4_clkctrl;
393 u32 pad127[5];
394 u32 cm_l4per_mmcsd3_clkctrl;
395 u32 pad128[1];
396 u32 cm_l4per_mmcsd4_clkctrl;
397 u32 pad129[1];
398 u32 cm_l4per_msprohg_clkctrl;
399 u32 pad130[1];
400 u32 cm_l4per_slimbus2_clkctrl;
401 u32 pad131[1];
402 u32 cm_l4per_uart1_clkctrl;
403 u32 pad132[1];
404 u32 cm_l4per_uart2_clkctrl;
405 u32 pad133[1];
406 u32 cm_l4per_uart3_clkctrl;
407 u32 pad134[1];
408 u32 cm_l4per_uart4_clkctrl;
409 u32 pad135[1];
410 u32 cm_l4per_mmcsd5_clkctrl;
411 u32 pad136[1];
412 u32 cm_l4per_i2c5_clkctrl;
413 u32 pad137[5];
414 u32 cm_l4sec_clkstctrl;
415 u32 cm_l4sec_staticdep;
416 u32 cm_l4sec_dynamicdep;
417 u32 pad138[5];
418 u32 cm_l4sec_aes1_clkctrl;
419 u32 pad139[1];
420 u32 cm_l4sec_aes2_clkctrl;
421 u32 pad140[1];
422 u32 cm_l4sec_des3des_clkctrl;
423 u32 pad141[1];
424 u32 cm_l4sec_pkaeip29_clkctrl;
425 u32 pad142[1];
426 u32 cm_l4sec_rng_clkctrl;
427 u32 pad143[1];
428 u32 cm_l4sec_sha2md51_clkctrl;
429 u32 pad144[3];
430 u32 cm_l4sec_cryptodma_clkctrl;
431 u32 pad145[776841];
432
433 /* l4 wkup regs */
434 u32 pad201[6211];
435 u32 cm_abe_pll_ref_clksel;
436 u32 cm_sys_clksel;
437 u32 pad202[1467];
438 u32 cm_wkup_clkstctrl;
439 u32 pad203[7];
440 u32 cm_wkup_l4wkup_clkctrl;
441 u32 pad204;
442 u32 cm_wkup_wdtimer1_clkctrl;
443 u32 pad205;
444 u32 cm_wkup_wdtimer2_clkctrl;
445 u32 pad206;
446 u32 cm_wkup_gpio1_clkctrl;
447 u32 pad207;
448 u32 cm_wkup_gptimer1_clkctrl;
449 u32 pad208;
450 u32 cm_wkup_gptimer12_clkctrl;
451 u32 pad209;
452 u32 cm_wkup_synctimer_clkctrl;
453 u32 pad210;
454 u32 cm_wkup_usim_clkctrl;
455 u32 pad211;
456 u32 cm_wkup_sarram_clkctrl;
457 u32 pad212[5];
458 u32 cm_wkup_keyboard_clkctrl;
459 u32 pad213;
460 u32 cm_wkup_rtc_clkctrl;
461 u32 pad214;
462 u32 cm_wkup_bandgap_clkctrl;
463 u32 pad215[197];
464 u32 prm_vc_val_bypass;
465 u32 prm_vc_cfg_channel;
466 u32 prm_vc_cfg_i2c_mode;
467 u32 prm_vc_cfg_i2c_clk;
468
469};
470
471/* DPLL register offsets */
472#define CM_CLKMODE_DPLL 0
473#define CM_IDLEST_DPLL 0x4
474#define CM_AUTOIDLE_DPLL 0x8
475#define CM_CLKSEL_DPLL 0xC
476#define CM_DIV_M2_DPLL 0x10
477#define CM_DIV_M3_DPLL 0x14
478#define CM_DIV_M4_DPLL 0x18
479#define CM_DIV_M5_DPLL 0x1C
480#define CM_DIV_M6_DPLL 0x20
481#define CM_DIV_M7_DPLL 0x24
482
483#define DPLL_CLKOUT_DIV_MASK 0x1F /* post-divider mask */
484
485/* CM_CLKMODE_DPLL */
486#define CM_CLKMODE_DPLL_REGM4XEN_SHIFT 11
487#define CM_CLKMODE_DPLL_REGM4XEN_MASK (1 << 11)
488#define CM_CLKMODE_DPLL_LPMODE_EN_SHIFT 10
489#define CM_CLKMODE_DPLL_LPMODE_EN_MASK (1 << 10)
490#define CM_CLKMODE_DPLL_RELOCK_RAMP_EN_SHIFT 9
491#define CM_CLKMODE_DPLL_RELOCK_RAMP_EN_MASK (1 << 9)
492#define CM_CLKMODE_DPLL_DRIFTGUARD_EN_SHIFT 8
493#define CM_CLKMODE_DPLL_DRIFTGUARD_EN_MASK (1 << 8)
494#define CM_CLKMODE_DPLL_RAMP_RATE_SHIFT 5
495#define CM_CLKMODE_DPLL_RAMP_RATE_MASK (0x7 << 5)
496#define CM_CLKMODE_DPLL_EN_SHIFT 0
497#define CM_CLKMODE_DPLL_EN_MASK (0x7 << 0)
498
499#define CM_CLKMODE_DPLL_DPLL_EN_SHIFT 0
500#define CM_CLKMODE_DPLL_DPLL_EN_MASK 7
501
502#define DPLL_EN_STOP 1
503#define DPLL_EN_MN_BYPASS 4
504#define DPLL_EN_LOW_POWER_BYPASS 5
505#define DPLL_EN_FAST_RELOCK_BYPASS 6
506#define DPLL_EN_LOCK 7
507
508/* CM_IDLEST_DPLL fields */
509#define ST_DPLL_CLK_MASK 1
510
511/* CM_CLKSEL_DPLL */
512#define CM_CLKSEL_DPLL_DPLL_SD_DIV_SHIFT 24
513#define CM_CLKSEL_DPLL_DPLL_SD_DIV_MASK (0xFF << 24)
514#define CM_CLKSEL_DPLL_M_SHIFT 8
515#define CM_CLKSEL_DPLL_M_MASK (0x7FF << 8)
516#define CM_CLKSEL_DPLL_N_SHIFT 0
517#define CM_CLKSEL_DPLL_N_MASK 0x7F
518
519#define OMAP4_DPLL_MAX_N 127
520
521/* CM_SYS_CLKSEL */
522#define CM_SYS_CLKSEL_SYS_CLKSEL_MASK 7
523
524/* CM_CLKSEL_CORE */
525#define CLKSEL_CORE_SHIFT 0
526#define CLKSEL_L3_SHIFT 4
527#define CLKSEL_L4_SHIFT 8
528
529#define CLKSEL_CORE_X2_DIV_1 0
530#define CLKSEL_L3_CORE_DIV_2 1
531#define CLKSEL_L4_L3_DIV_2 1
532
533/* CM_ABE_PLL_REF_CLKSEL */
534#define CM_ABE_PLL_REF_CLKSEL_CLKSEL_SHIFT 0
535#define CM_ABE_PLL_REF_CLKSEL_CLKSEL_MASK 1
536#define CM_ABE_PLL_REF_CLKSEL_CLKSEL_SYSCLK 0
537#define CM_ABE_PLL_REF_CLKSEL_CLKSEL_32KCLK 1
538
539/* CM_BYPCLK_DPLL_IVA */
540#define CM_BYPCLK_DPLL_IVA_CLKSEL_SHIFT 0
541#define CM_BYPCLK_DPLL_IVA_CLKSEL_MASK 3
542
543#define DPLL_IVA_CLKSEL_CORE_X2_DIV_2 1
544
545/* CM_SHADOW_FREQ_CONFIG1 */
546#define SHADOW_FREQ_CONFIG1_FREQ_UPDATE_MASK 1
547#define SHADOW_FREQ_CONFIG1_DLL_OVERRIDE_MASK 4
548#define SHADOW_FREQ_CONFIG1_DLL_RESET_MASK 8
549
550#define SHADOW_FREQ_CONFIG1_DPLL_EN_SHIFT 8
551#define SHADOW_FREQ_CONFIG1_DPLL_EN_MASK (7 << 8)
552
553#define SHADOW_FREQ_CONFIG1_M2_DIV_SHIFT 11
554#define SHADOW_FREQ_CONFIG1_M2_DIV_MASK (0x1F << 11)
555
556/*CM_<clock_domain>__CLKCTRL */
557#define CD_CLKCTRL_CLKTRCTRL_SHIFT 0
558#define CD_CLKCTRL_CLKTRCTRL_MASK 3
559
560#define CD_CLKCTRL_CLKTRCTRL_NO_SLEEP 0
561#define CD_CLKCTRL_CLKTRCTRL_SW_SLEEP 1
562#define CD_CLKCTRL_CLKTRCTRL_SW_WKUP 2
563#define CD_CLKCTRL_CLKTRCTRL_HW_AUTO 3
564
565
566/* CM_<clock_domain>_<module>_CLKCTRL */
567#define MODULE_CLKCTRL_MODULEMODE_SHIFT 0
568#define MODULE_CLKCTRL_MODULEMODE_MASK 3
569#define MODULE_CLKCTRL_IDLEST_SHIFT 16
570#define MODULE_CLKCTRL_IDLEST_MASK (3 << 16)
571
572#define MODULE_CLKCTRL_MODULEMODE_SW_DISABLE 0
573#define MODULE_CLKCTRL_MODULEMODE_HW_AUTO 1
574#define MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN 2
575
576#define MODULE_CLKCTRL_IDLEST_FULLY_FUNCTIONAL 0
577#define MODULE_CLKCTRL_IDLEST_TRANSITIONING 1
578#define MODULE_CLKCTRL_IDLEST_IDLE 2
579#define MODULE_CLKCTRL_IDLEST_DISABLED 3
580
581/* CM_L4PER_GPIO4_CLKCTRL */
582#define GPIO4_CLKCTRL_OPTFCLKEN_MASK (1 << 8)
583
584/* CM_L3INIT_HSMMCn_CLKCTRL */
585#define HSMMC_CLKCTRL_CLKSEL_MASK (1 << 24)
586
587/* CM_WKUP_GPTIMER1_CLKCTRL */
588#define GPTIMER1_CLKCTRL_CLKSEL_MASK (1 << 24)
589
590/* CM_CAM_ISS_CLKCTRL */
591#define ISS_CLKCTRL_OPTFCLKEN_MASK (1 << 8)
592
593/* CM_DSS_DSS_CLKCTRL */
594#define DSS_CLKCTRL_OPTFCLKEN_MASK 0xF00
595
596/* CM_L3INIT_USBPHY_CLKCTRL */
597#define USBPHY_CLKCTRL_OPTFCLKEN_PHY_48M_MASK 8
598
599/* Clock frequencies */
600#define OMAP_SYS_CLK_FREQ_38_4_MHZ 38400000
601#define OMAP_SYS_CLK_IND_38_4_MHZ 6
602#define OMAP_32K_CLK_FREQ 32768
603
604/* PRM_VC_CFG_I2C_CLK */
605#define PRM_VC_CFG_I2C_CLK_SCLH_SHIFT 0
606#define PRM_VC_CFG_I2C_CLK_SCLH_MASK 0xFF
607#define PRM_VC_CFG_I2C_CLK_SCLL_SHIFT 8
608#define PRM_VC_CFG_I2C_CLK_SCLL_MASK (0xFF << 8)
609
610/* PRM_VC_VAL_BYPASS */
611#define PRM_VC_I2C_CHANNEL_FREQ_KHZ 400
612
613#define PRM_VC_VAL_BYPASS_VALID_BIT 0x1000000
614#define PRM_VC_VAL_BYPASS_SLAVEADDR_SHIFT 0
615#define PRM_VC_VAL_BYPASS_SLAVEADDR_MASK 0x7F
616#define PRM_VC_VAL_BYPASS_REGADDR_SHIFT 8
617#define PRM_VC_VAL_BYPASS_REGADDR_MASK 0xFF
618#define PRM_VC_VAL_BYPASS_DATA_SHIFT 16
619#define PRM_VC_VAL_BYPASS_DATA_MASK 0xFF
620
621#define SMPS_I2C_SLAVE_ADDR 0x12
622#define SMPS_REG_ADDR_VCORE1 0x55
623#define SMPS_REG_ADDR_VCORE2 0x5B
624#define SMPS_REG_ADDR_VCORE3 0x61
625
626#define PHOENIX_SMPS_BASE_VOLT_STD_MODE_UV 607700
627#define PHOENIX_SMPS_BASE_VOLT_STD_MODE_WITH_OFFSET_UV 709000
628
629/* Defines for DPLL setup */
630#define DPLL_LOCKED_FREQ_TOLERANCE_0 0
631#define DPLL_LOCKED_FREQ_TOLERANCE_500_KHZ 500
632#define DPLL_LOCKED_FREQ_TOLERANCE_1_MHZ 1000
633
634#define DPLL_NO_LOCK 0
635#define DPLL_LOCK 1
636
637#define NUM_SYS_CLKS 7
638
639struct dpll_regs {
640 u32 cm_clkmode_dpll;
641 u32 cm_idlest_dpll;
642 u32 cm_autoidle_dpll;
643 u32 cm_clksel_dpll;
644 u32 cm_div_m2_dpll;
645 u32 cm_div_m3_dpll;
646 u32 cm_div_m4_dpll;
647 u32 cm_div_m5_dpll;
648 u32 cm_div_m6_dpll;
649 u32 cm_div_m7_dpll;
650};
651
652/* DPLL parameter table */
653struct dpll_params {
654 u32 m;
655 u32 n;
656 u8 m2;
657 u8 m3;
658 u8 m4;
659 u8 m5;
660 u8 m6;
661 u8 m7;
662};
663
664#endif /* _CLOCKS_OMAP4_H_ */