summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mvf/crm_regs.h
blob: bf923f355174660bed0fedf46324df6dc881920d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
/*
 * based on arch/arm/mach-mx6/crm_regs.h
 *
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:
 *
 * http://www.opensource.org/licenses/gpl-license.html
 * http://www.gnu.org/copyleft/gpl.html
 */
#ifndef __ARCH_ARM_MACH_MVF_CRM_REGS_H__
#define __ARCH_ARM_MACH_MVF_CRM_REGS_H__

/* PLLs */
#define MXC_PLL_BASE			MVF_IO_ADDRESS(MVF_ANADIG_BASE_ADDR)
#define PLL3_480_USB1_BASE_ADDR		(MXC_PLL_BASE + 0x10)
#define ANADIG_USB2_PLL_CTRL		(MXC_PLL_BASE + 0x20)
#define PLL2_528_BASE_ADDR		(MXC_PLL_BASE + 0x30)
#define PLL4_AUDIO_BASE_ADDR		(MXC_PLL_BASE + 0x70)
#define PLL6_VIDEO_BASE_ADDR		(MXC_PLL_BASE + 0xA0)
#define PLL5_ENET_BASE_ADDR		(MXC_PLL_BASE + 0xE0)
#define ANADIG_PLL_PFD_480_USB1		(MXC_PLL_BASE + 0xF0)
#define ANADIG_PLL_PFD_528		(MXC_PLL_BASE + 0x100)
#define ANADIG_REG_1P1			(MXC_PLL_BASE + 0x110)
#define ANADIG_REG_3P0			(MXC_PLL_BASE + 0x120)
#define ANADIG_REG_2P5			(MXC_PLL_BASE + 0x130)
#define ANADIG_ANA_MISC0		(MXC_PLL_BASE + 0x150)
#define ANADIG_ANA_MISC1		(MXC_PLL_BASE + 0x160)
#define ANADIG_TEMPSENS0		(MXC_PLL_BASE + 0x180)
#define ANADIG_TEMPSENS1		(MXC_PLL_BASE + 0x190)
#define ANADIG_USB1_VBUS_DETECT		(MXC_PLL_BASE + 0x1A0)
#define ANADIG_USB1_CHRG_DETECT		(MXC_PLL_BASE + 0x1B0)
#define ANADIG_USB1_VBUS_DETECT_STAT	(MXC_PLL_BASE + 0x1C0)
#define ANADIG_USB1_CHRG_DETECT_STAT	(MXC_PLL_BASE + 0x1D0)
#define ANADIG_USB1_LOOPBACK		(MXC_PLL_BASE + 0x1E0)
#define ANADIG_USB1_MISC		(MXC_PLL_BASE + 0x1F0)
#define ANADIG_USB2_VBUS_DETECT		(MXC_PLL_BASE + 0x200)
#define ANADIG_USB2_CHRG_DETECT		(MXC_PLL_BASE + 0x210)
#define ANADIG_USB2_VBUS_DETECT_STAT	(MXC_PLL_BASE + 0x220)
#define ANADIG_USB2_CHRG_DETECT_STAT	(MXC_PLL_BASE + 0x230)
#define ANADIG_USB2_LOOPBACK		(MXC_PLL_BASE + 0x240)
#define ANADIG_USB2_MISC		(MXC_PLL_BASE + 0x250)
#define ANADIG_DEGPROG			(MXC_PLL_BASE + 0x260)
#define PLL1_SYS_BASE_ADDR		(MXC_PLL_BASE + 0x270)
#define ANADIG_PLL_PFD_528_SYS		(MXC_PLL_BASE + 0x2B0)
#define ANADIG_PLL_LOCK_REG		(MXC_PLL_BASE + 0x2C0)

#define PLL_NUM_DIV_OFFSET		0x10
#define PLL_DENOM_DIV_OFFSET		0x20
#define PLL_528_SS_OFFSET		0x10
#define PLL_528_NUM_DIV_OFFSET		0x20
#define PLL_528_DENOM_DIV_OFFSET	0x30

/* Common PLL register bit defines. */
#define ANADIG_PLL_LOCK				(1 << 31)
#define ANADIG_PLL_PFD_OFFSET_EN		(1 << 18)
#define ANADIG_PLL_DITHER_ENABLE		(1 << 17)
#define ANADIG_PLL_BYPASS			(1 << 16)
#define ANADIG_PLL_BYPASS_CLK_SRC		(14)
#define ANADIG_PLL_ENABLE			(1 << 13)
#define ANADIG_PLL_POWER_DOWN			(1 << 12)
#define ANADIG_PLL_HOLD_RING_OFF		(1 << 11)
#define ANADIG_PLL_DOUBLE_CP			(1 << 10)
#define ANADIG_PLL_HALF_CP			(1 << 9)
#define ANADIG_PLL_DOUBLE_LF			(1 << 8)
#define ANADIG_PLL_HALF_LF			(1 << 7)

/* PLL1_SYS defines */
#define ANADIG_PLL_SYS_DIV_SELECT		(1)

/* PLL2_528 defines */
#define ANADIG_PLL_528_DIV_SELECT		(1)

/* PLL3_480 defines. */
#define ANADIG_PLL_480_EN_USB_CLKS		(1 << 6)
#define ANADIG_PLL_480_DIV_SELECT_MASK		(0x3)
#define ANADIG_PLL_480_DIV_SELECT_OFFSET	(0)

/* PLL4_AUDIO PLL6_VIDEO defines. */
#define ANADIG_PLL_AV_DIV_SELECT_MASK		(0x7F)
#define ANADIG_PLL_AV_DIV_SELECT_OFFSET		(0)
#define ANADIG_PLL_AV_TEST_DIV_SEL_MASK		(0x180000)
#define ANADIG_PLL_AV_TEST_DIV_SEL_OFFSET	(19)

/* PLL5_ENET defines. */
#define ANADIG_PLL_ENET_DIV_SELECT_MASK		(0x3)
#define ANADIG_PLL_ENET_DIV_SELECT_OFFSET	(0)

/* PFD register defines. */
#define ANADIG_PFD_CLKGATE			(1 << 7)
#define ANADIG_PFD_STABLE			(1 << 6)
#define ANADIG_PFD_FRAC_MASK			0x3F
#define ANADIG_PFD4_FRAC_SHIFT			24
#define ANADIG_PFD3_FRAC_SHIFT			16
#define ANADIG_PFD2_FRAC_SHIFT			8
#define ANADIG_PFD1_FRAC_SHIFT			0

/* ANATOP  Regulator/LDO defines */
#define ANADIG_REG_OK				(1 << 17)
#define ANADIG_REG_BO				(1 << 16)
#define ANADIG_REG_3P0_VBUS_SEL			(1 << 7)
#define ANADIG_REG_1P1_2P5_ENABLE_PULL_DOWN	(1 << 3)
#define ANADIG_REG_ENABLE_LIMIT			(1 << 2)
#define ANADIG_REG_ENABLE_BO			(1 << 1)
#define ANADIG_REG_ENABLE_LINREG		(1)

/* ANA MISC0 register defines */
#define ANADIG_ANA_MISC0_CLKGATE_DELAY_MASK	0x1C000000
#define ANADIG_ANA_MISC0_CLKGATE_DELAY_OFFSET	26
#define ANADIG_ANA_MISC0_CLKGATE_CTRL		(1 << 25)
#define ANADIG_ANA_MISC0_ANAMUX_MASK		0x01E00000
#define ANADIG_ANA_MISC0_ANAMUX_OFFSET		21
#define ANADIG_ANA_MISC0_ANAMUX_EN		(1 << 20)
#define ANADIG_ANA_MISC0_WBCP_VPN_THRESH_MASK	0x000C0000
#define ANADIG_ANA_MISC0_WBCP_VPN_THRESH_OFFSET	18
#define ANADIG_ANA_MISC0_OSC_XTALOC_EN		(1 << 17)
#define ANADIG_ANA_MISC0_OSC_XTALOC		(1 << 16)
#define ANADIG_ANA_MISC0_OSC_I_MASK		0x0000C000
#define ANADIG_ANA_MISC0_OSC_I_OFFSET		14
#define ANADIG_ANA_MISC0_CLK_24M_IRC_XTAL_SEL	(1 << 13)
#define ANADIG_ANA_MISC0_STOP_MODE_CONFIG	(1 << 12)
#define ANADIG_ANA_MISC0_REFTOP_VBGUP		(1 << 7)
#define ANADIG_ANA_MISC0_REFTOP_SELBIASOFF	(1 << 3)
#define ANADIG_ANA_MISC0_REFTOP_LOWPOWER	(1 << 2)
#define ANADIG_ANA_MISC0_REFTOP_PWDVBGUP	(1 << 1)
#define ANADIG_ANA_MISC0_REFTOP_PWD		(1)

/* ANA MISC1 register defines */
#define ANADIG_ANA_MISC1_IRQ_ANA_BO		(1 << 30)
#define ANADIG_ANA_MISC1_IRQ_TEMPSENSE		(1 << 29)
#define ANADIG_ANA_MISC1_LVDSCLK1_IBEN		(1 << 12)
#define ANADIG_ANA_MISC1_LVDSCLK1_OBEN		(1 << 10)
#define ANADIG_ANA_MISC1_LVDS1_CLK_SEL_MASK	0x0000001F
#define ANADIG_ANA_MISC1_LVDS1_CLK_SEL_OFFSET	0

#define MXC_CCM_BASE		MVF_IO_ADDRESS(MVF_CCM_BASE_ADDR)
/* CCM Register Offsets. */
//#define MXC_CCM_CDCR_OFFSET			0x4C
#define MXC_CCM_CACRR_OFFSET			0x0c
//#define MXC_CCM_CDHIPR_OFFSET			0x48

/* Register addresses of CCM*/
#define MXC_CCM_CCR		(MXC_CCM_BASE + 0x00)
#define MXC_CCM_CSR		(MXC_CCM_BASE + 0x04)
#define MXC_CCM_CCSR		(MXC_CCM_BASE + 0x08)
#define MXC_CCM_CACRR		(MXC_CCM_BASE + 0x0c)
#define MXC_CCM_CSCMR1		(MXC_CCM_BASE + 0x10)
#define MXC_CCM_CSCDR1		(MXC_CCM_BASE + 0x14)
#define MXC_CCM_CSCDR2		(MXC_CCM_BASE + 0x18)
#define MXC_CCM_CSCDR3		(MXC_CCM_BASE + 0x1c)
#define MXC_CCM_CSCMR2		(MXC_CCM_BASE + 0x20)
#define MXC_CCM_CSCDR4		(MXC_CCM_BASE + 0x24)
#define MXC_CCM_CLPCR		(MXC_CCM_BASE + 0x2c)
#define MXC_CCM_CISR		(MXC_CCM_BASE + 0x30)
#define MXC_CCM_CIMR		(MXC_CCM_BASE + 0x34)
#define MXC_CCM_CCGR0		(MXC_CCM_BASE + 0x40)
#define MXC_CCM_CCGR1		(MXC_CCM_BASE + 0x44)
#define MXC_CCM_CCGR2		(MXC_CCM_BASE + 0x48)
#define MXC_CCM_CCGR3		(MXC_CCM_BASE + 0x4c)
#define MXC_CCM_CCGR4		(MXC_CCM_BASE + 0x50)
#define MXC_CCM_CCGR5		(MXC_CCM_BASE + 0x54)
#define MXC_CCM_CCGR6		(MXC_CCM_BASE + 0x58)
#define MXC_CCM_CCGR7		(MXC_CCM_BASE + 0x5c)
#define MXC_CCM_CCGR8		(MXC_CCM_BASE + 0x60)
#define MXC_CCM_CCGR9		(MXC_CCM_BASE + 0x64)
#define MXC_CCM_CCGR10		(MXC_CCM_BASE + 0x68)
#define MXC_CCM_CCGR11		(MXC_CCM_BASE + 0x6c)
#define MXC_CCM_CMEOR0		(MXC_CCM_BASE + 0x70)
#define MXC_CCM_CMEOR1		(MXC_CCM_BASE + 0x74)
#define MXC_CCM_CMEOR2		(MXC_CCM_BASE + 0x78)
#define MXC_CCM_CMEOR3		(MXC_CCM_BASE + 0x7c)
#define MXC_CCM_CMEOR4		(MXC_CCM_BASE + 0x80)
#define MXC_CCM_CMEOR5		(MXC_CCM_BASE + 0x84)
#define MXC_CCM_CPPDSR		(MXC_CCM_BASE + 0x88)
#define MXC_CCM_CCOWR		(MXC_CCM_BASE + 0x8c)
#define MXC_CCM_CCPGR0		(MXC_CCM_BASE + 0x90)
#define MXC_CCM_CCPGR1		(MXC_CCM_BASE + 0x94)
#define MXC_CCM_CCPGR2		(MXC_CCM_BASE + 0x98)
#define MXC_CCM_CCPGR3		(MXC_CCM_BASE + 0x9c)

/* Define the bits in register CCR */
#define MXC_CCM_CCR_FIRC_EN			(1 << 16)
#define MXC_CCM_CCR_FXOSC_EN			(1 << 12)
#define MXC_CCM_CCR_OSCNT_MASK			(0xFF)
#define MXC_CCM_CCR_OSCNT_OFFSET		(0)

/* Define the bits in register CSR */
#define MXC_CCM_CSR_FXOSC_RDY			(1 << 5)

/* Define the bits in register CCSR */
#define MXC_CCM_CCSR_PLL3_PFD4_EN		(1 << 31)
#define MXC_CCM_CCSR_PLL3_PFD3_EN		(1 << 30)
#define MXC_CCM_CCSR_PLL3_PFD2_EN		(1 << 29)
#define MXC_CCM_CCSR_PLL3_PFD1_EN		(1 << 28)
#define MXC_CCM_CCSR_DAP_EN			(1 << 24)
#define MXC_CCM_CCSR_PLL2_PFD_CLK_SEL_MASK	(0x7 << 19)
#define MXC_CCM_CCSR_PLL2_PFD_CLK_SEL_OFFSET	(19)
#define MXC_CCM_CCSR_PLL1_PFD_CLK_SEL_MASK	(0x7 << 16)
#define MXC_CCM_CCSR_PLL1_PFD_CLK_SEL_OFFSET	(16)
#define MXC_CCM_CCSR_PLL2_PFD4_EN		(1 << 15)
#define MXC_CCM_CCSR_PLL2_PFD3_EN		(1 << 14)
#define MXC_CCM_CCSR_PLL2_PFD2_EN		(1 << 13)
#define MXC_CCM_CCSR_PLL2_PFD1_EN		(1 << 12)
#define MXC_CCM_CCSR_PLL1_PFD4_EN		(1 << 11)
#define MXC_CCM_CCSR_PLL1_PFD3_EN		(1 << 10)
#define MXC_CCM_CCSR_PLL1_PFD2_EN		(1 << 9)
#define MXC_CCM_CCSR_PLL1_PFD1_EN		(1 << 8)
#define MXC_CCM_CCSR_DDRC_CLK_SEL		(1 << 6)
#define MXC_CCM_CCSR_DDRC_CLK_SEL_OFFSET	(6)
#define MXC_CCM_CCSR_FAST_CLK_SEL		(1 << 5)
#define MXC_CCM_CCSR_SLOW_CLK_SEL		(1 << 4)
#define MXC_CCM_CCSR_CA5_CLK_SEL		(1 << 3)
#define MXC_CCM_CCSR_CA5_CLK_SEL_OFFSET		(3)
#define MXC_CCM_CCSR_SYS_CLK_SEL_MASK		(0x7)
#define MXC_CCM_CCSR_SYS_CLK_SE_OFFSET		(0)

/* Define the bits in register CACRR */
#define MXC_CCM_CACRR_FLEX_CLK_DIV_MASK		(0x7 << 22)
#define MXC_CCM_CACRR_FLEX_CLK_DIV_OFFSET	(22)
#define MXC_CCM_CACRR_PLL6_CLK_DIV		(1 << 21)
#define MXC_CCM_CACRR_PLL6_CLK_DIV_OFFSET	(21)
#define MXC_CCM_CACRR_PLL3_CLK_DIV		(1 << 20)
#define MXC_CCM_CACRR_PLL3_CLK_DIV_OFFSET	(20)
#define MXC_CCM_CACRR_PLL1_PFD_CLK_DIV_MASK	(0x3 << 16)
#define MXC_CCM_CACRR_PLL1_PFD_CLK_DIV_OFFSET	(16)
#define MXC_CCM_CACRR_IPG_CLK_DIV_MASK		(0x3 << 11)
#define MXC_CCM_CACRR_IPG_CLK_DIV_OFFSET	(11)
#define MXC_CCM_CACRR_PLL4_CLK_DIV_MASK		(0x7 << 6)
#define MXC_CCM_CACRR_PLL4_CLK_DIV_OFFSET	(6)
#define MXC_CCM_CACRR_BUS_CLK_DIV_MASK		(0x7 << 3)
#define MXC_CCM_CACRR_BUS_CLK_DIV_OFFSET	(3)
#define MXC_CCM_CACRR_ARM_CLK_DIV_MASK		(0x7)
#define MXC_CCM_CACRR_ARM_CLK_DIV_OFFSET	(0)

/* Define the bits in register CSCMR1 */
#define MXC_CCM_CSCMR1_DCU1_CLK_SEL		(1 << 29)
#define MXC_CCM_CSCMR1_DCU1_CLK_SEL_OFFSET	(29)
#define MXC_CCM_CSCMR1_DCU0_CLK_SEL		(1 << 28)
#define MXC_CCM_CSCMR1_DCU0_CLK_SEL_OFFSET	(28)
#define MXC_CCM_CSCMR1_QSPI1_CLK_SEL_MASK	(0x3 << 24)
#define MXC_CCM_CSCMR1_QSPI1_CLK_SEL_OFFSET	(24)
#define MXC_CCM_CSCMR1_QSPI0_CLK_SEL_MASK	(0x3 << 22)
#define MXC_CCM_CSCMR1_QSPI0_CLK_SEL_OFFSET	(22)
#define MXC_CCM_CSCMR1_ESAI_CLK_SEL_MASK	(0x3 << 20)
#define MXC_CCM_CSCMR1_ESAI_CLK_SEL_OFFSET	(20)
#define MXC_CCM_CSCMR1_ESDHC1_CLK_SEL_MASK	(0x3 << 18)
#define MXC_CCM_CSCMR1_ESDHC1_CLK_SEL_OFFSET	(18)
#define MXC_CCM_CSCMR1_ESDHC0_CLK_SEL_MASK	(0x3 << 16)
#define MXC_CCM_CSCMR1_ESDHC0_CLK_SEL_OFFSET	(16)
#define MXC_CCM_CSCMR1_GPU_CLK_SEL		(1 << 14)
#define MXC_CCM_CSCMR1_GPU_CLK_SEL_OFFSET	(14)
#define MXC_CCM_CSCMR1_NFC_CLK_SEL_MASK		(0x3 << 12)
#define MXC_CCM_CSCMR1_NFC_CLK_SEL_OFFSET	(12)
#define MXC_CCM_CSCMR1_SPDIF_CLK_SEL_MASK	(0x3 << 10)
#define MXC_CCM_CSCMR1_SPDIF_CLK_SEL_OFFSET	(10)
#define MXC_CCM_CSCMR1_VADC_CLK_SEL_MASK	(0x3 << 8)
#define MXC_CCM_CSCMR1_VADC_CLK_SEL_OFFSET	(8)
#define MXC_CCM_CSCMR1_SAI3_CLK_SEL_MASK	(0x3 << 6)
#define MXC_CCM_CSCMR1_SAI3_CLK_SEL_OFFSET	(6)
#define MXC_CCM_CSCMR1_SAI2_CLK_SEL_MASK	(0x3 << 4)
#define MXC_CCM_CSCMR1_SAI2_CLK_SEL_OFFSET	(4)
#define MXC_CCM_CSCMR1_SAI1_CLK_SEL_MASK	(0x3 << 2)
#define MXC_CCM_CSCMR1_SAI1_CLK_SEL_OFFSET	(2)
#define MXC_CCM_CSCMR1_SAI0_CLK_SEL_MASK	(0x3)
#define MXC_CCM_CSCMR1_SAI0_CLK_SEL_OFFSET	(0)

/* Define the bits in register CSCDR1 */
#define MXC_CCM_CSCDR1_FTM3_CLK_EN		(1 << 28)
#define MXC_CCM_CSCDR1_FTM3_CLK_EN_OFFSET	(28)
#define MXC_CCM_CSCDR1_FTM2_CLK_EN		(1 << 27)
#define MXC_CCM_CSCDR1_FTM2_CLK_EN_OFFSET	(27)
#define MXC_CCM_CSCDR1_FTM1_CLK_EN		(1 << 26)
#define MXC_CCM_CSCDR1_FTM1_CLK_EN_OFFSET	(26)
#define MXC_CCM_CSCDR1_FTM0_CLK_EN		(1 << 25)
#define MXC_CCM_CSCDR1_FTM0_CLK_EN_OFFSET	(25)
#define MXC_CCM_CSCDR1_RMII_CLK_EN		(1 << 24)
#define MXC_CCM_CSCDR1_ENET_ST_EN		(1 << 23)
#define MXC_CCM_CSCDR1_VADC_EN			(1 << 22)
#define MXC_CCM_CSCDR1_VADC_DIV_MASK		(0x3 << 20)
#define MXC_CCM_CSCDR1_VADC_DIV_OFFSET		(20)
#define MXC_CCM_CSCDR1_SAI3_EN			(1 << 19)
#define MXC_CCM_CSCDR1_SAI2_EN			(1 << 18)
#define MXC_CCM_CSCDR1_SAI1_EN			(1 << 17)
#define MXC_CCM_CSCDR1_SAI0_EN			(1 << 16)
#define MXC_CCM_CSCDR1_SAI3_DIV_MASK		(0xF << 12)
#define MXC_CCM_CSCDR1_SAI3_DIV_OFFSET		(12)
#define MXC_CCM_CSCDR1_SAI2_DIV_MASK		(0xF << 8)
#define MXC_CCM_CSCDR1_SAI2_DIV_OFFSET		(8)
#define MXC_CCM_CSCDR1_SAI1_DIV_MASK		(0xF << 4)
#define MXC_CCM_CSCDR1_SAI1_DIV_OFFSET		(4)
#define MXC_CCM_CSCDR1_SAI0_DIV_MASK		(0xF)
#define MXC_CCM_CSCDR1_SAI0_DIV_OFFSET		(0)

/* Define the bits in register CSCDR2 */
#define MXC_CCM_CSCDR2_ESAI_EN			(1 << 30)
#define MXC_CCM_CSCDR2_ESDHC1_EN		(1 << 29)
#define MXC_CCM_CSCDR2_ESDHC0_EN		(1 << 28)
#define MXC_CCM_CSCDR2_ESAI_DIV_MASK		(0xF << 24)
#define MXC_CCM_CSCDR2_ESAI_DIV_OFFSET		(24)
#define MXC_CCM_CSCDR2_ESDHC1_DIV_MASK		(0xF << 20)
#define MXC_CCM_CSCDR2_ESDHC1_DIV_OFFSET	(20)
#define MXC_CCM_CSCDR2_ESDHC0_DIV_MASK		(0xF << 16)
#define MXC_CCM_CSCDR2_ESDHC0_DIV_OFFSET	(16)
#define MXC_CCM_CSCDR2_NFC_CLK_INV		(1 << 14)
#define MXC_CCM_CSCDR2_NFC_FRAC_DIV_EN		(1 << 13)
#define MXC_CCM_CSCDR2_CAN1_EN			(1 << 12)
#define MXC_CCM_CSCDR2_CAN0_EN			(1 << 11)
#define MXC_CCM_CSCDR2_GPU_EN			(1 << 10)
#define MXC_CCM_CSCDR2_NFC_EN			(1 << 9)
#define MXC_CCM_CSCDR2_SPDIF_EN			(1 << 8)
#define MXC_CCM_CSCDR2_NFC_FRAC_DIV_MASK	(0xF << 4)
#define MXC_CCM_CSCDR2_NFC_FRAC_DIV_OFFSET	(4)
#define MXC_CCM_CSCDR2_SPDIF_DIV_MASK		(0xF)
#define MXC_CCM_CSCDR2_SPDIF_DIV_OFFSET		(0)

/* Define the bits in register CSCDR3 */
#define MXC_CCM_CSCDR3_SWO_EN			(1 << 28)
#define MXC_CCM_CSCDR3_SWO_DIV			(1 << 27)
#define MXC_CCM_CSCDR3_TRACE_EN			(1 << 26)
#define MXC_CCM_CSCDR3_TRACE_DIV_MASK		(0x3 << 24)
#define MXC_CCM_CSCDR3_TRACE_DIV_OFFSET		(24)
#define MXC_CCM_CSCDR3_DCU1_EN			(1 << 23)
#define MXC_CCM_CSCDR3_DCU1_EN_OFFSET		(23)
#define MXC_CCM_CSCDR3_DCU1_DIV_MASK		(0x7 << 20)
#define MXC_CCM_CSCDR3_DCU1_DIV_OFFSET		(20)
#define MXC_CCM_CSCDR3_DCU0_EN			(1 << 19)
#define MXC_CCM_CSCDR3_DCU0_EN_OFFSET		(19)
#define MXC_CCM_CSCDR3_DCU0_DIV_MASK		(0x7 << 16)
#define MXC_CCM_CSCDR3_DCU0_DIV_OFFSET		(16)
#define MXC_CCM_CSCDR3_NFC_PRE_DIV_MASK		(0x7 << 13)
#define MXC_CCM_CSCDR3_NFC_PRE_DIV_OFFSET	(13)
#define MXC_CCM_CSCDR3_QSPI1_EN			(1 << 12)
#define MXC_CCM_CSCDR3_QSPI1_DIV		(1 << 11)
#define MXC_CCM_CSCDR3_QSPI1_X2_DIV		(1 << 10)
#define MXC_CCM_CSCDR3_QSPI1_X4_DIV_MASK	(0x3 << 8)
#define MXC_CCM_CSCDR3_QSPI1_X4_DIV_OFFSET	(8)
#define MXC_CCM_CSCDR3_QSPI0_EN			(1 << 4)
#define MXC_CCM_CSCDR3_QSPI0_DIV		(1 << 3)
#define MXC_CCM_CSCDR3_QSPI0_X2_DIV		(1 << 2)
#define MXC_CCM_CSCDR3_QSPI0_X4_DIV_MASK	(0x3)
#define MXC_CCM_CSCDR3_QSPI0_X4_DIV_OFFSET	(0)

/* Define the bits in register CSCMR2 */
#define MXC_CCM_CSCMR2_SWO_CLK_SEL		(1 << 19)
#define MXC_CCM_CSCMR2_TRACE_CLK_SEL		(1 << 18)
#define MXC_CCM_CSCMR2_FTM3_FIX_CLK_SEL		(1 << 17)
#define MXC_CCM_CSCMR2_FTM2_FIX_CLK_SEL		(1 << 16)
#define MXC_CCM_CSCMR2_FTM1_FIX_CLK_SEL		(1 << 15)
#define MXC_CCM_CSCMR2_FTM0_FIX_CLK_SEL		(1 << 14)
#define MXC_CCM_CSCMR2_FTM3_EXT_CLK_SEL_MASK	(0x3 << 12)
#define MXC_CCM_CSCMR2_FTM3_EXT_CLK_SEL_OFFSET	(12)
#define MXC_CCM_CSCMR2_FTM2_EXT_CLK_SEL_MASK	(0x3 << 10)
#define MXC_CCM_CSCMR2_FTM2_EXT_CLK_SEL_OFFSET	(10)
#define MXC_CCM_CSCMR2_FTM1_EXT_CLK_SEL_MASK	(0x3 << 8)
#define MXC_CCM_CSCMR2_FTM1_EXT_CLK_SEL_OFFSET	(8)
#define MXC_CCM_CSCMR2_FTM0_EXT_CLK_SEL_MASK	(0x3 << 6)
#define MXC_CCM_CSCMR2_FTM0_EXT_CLK_SEL_OFFSET	(6)
#define MXC_CCM_CSCMR2_RMII_CLK_SEL_MASK	(0x3 << 4)
#define MXC_CCM_CSCMR2_RMII_CLK_SEL_OFFSET	(4)
#define MXC_CCM_CSCMR2_ENET_TS_CLK_SEL_MASK	(0x7)
#define MXC_CCM_CSCMR2_ENET_TS_CLK_SEL_OFFSET	(0)

/* Define the bits in register CSCDR4 */
#define MXC_CCM_CSCDR4_SNVS_CLK_DIV_MASK	(0x7F)
#define MXC_CCM_CSCDR4_SNVS_CLK_DIV_OFFSET	(0)

/* Define the bits in register CLPCR */
#define MXC_CCM_CLPCR_M_L2CC_IDLE		(1 << 25)
#define MXC_CCM_CLPCR_M_SCU_IDLE		(1 << 24)
#define MXC_CCM_CLPCR_M_CORE1_WFI		(1 << 23)
#define MXC_CCM_CLPCR_MASK_CORE0_WFI		(1 << 22)
#define MXC_CCM_CLPCR_XOSC_PWRDOWN		(1 << 11)
#define MXC_CCM_CLPCR_ANATOP_STOP_MODE		(1 << 8)
#define MXC_CCM_CLPCR_DIS_REF_OSC		(1 << 7)
#define MXC_CCM_CLPCR_SBYOS			(1 << 6)
#define MXC_CCM_CLPCR_ARM_CLK_LPM		(1 << 5)

/* Define the bits in register CISR */
#define MXC_CCM_CISR_XOSC_READY			(1 << 6)
#define MXC_CCM_CISR_LRF_PLL4			(1 << 3)
#define MXC_CCM_CISR_LRF_PLL3			(1 << 2)
#define MXC_CCM_CISR_LRF_PLL2			(1 << 1)
#define MXC_CCM_CISR_LRF_PLL1			(1)

/* Define the bits in register CIMR */
#define MXC_CCM_CIMR_M_XOSC_READY		(1 << 6)
#define MXC_CCM_CIMR_M_LRF_PLL4			(1 << 3)
#define MXC_CCM_CIMR_M_LRF_PLL3			(1 << 2)
#define MXC_CCM_CIMR_M_LRF_PLL2			(1 << 1)
#define MXC_CCM_CIMR_M_LRF_PLL1			(1)

/* Define the bits in registers CCGRx */
#define MXC_CCM_CCGRx_CG_MASK			0x3
#define MXC_CCM_CCGRx_MOD_OFF			0x0
#define MXC_CCM_CCGRx_MOD_IDLE			0x1
#define MXC_CCM_CCGRx_MOD_FORCE_ON		0x2
#define MXC_CCM_CCGRx_MOD_ON			0x3

#define MXC_CCM_CCGRx_CG15_MASK			(0x3 << 30)
#define MXC_CCM_CCGRx_CG14_MASK			(0x3 << 28)
#define MXC_CCM_CCGRx_CG13_MASK			(0x3 << 26)
#define MXC_CCM_CCGRx_CG12_MASK			(0x3 << 24)
#define MXC_CCM_CCGRx_CG11_MASK			(0x3 << 22)
#define MXC_CCM_CCGRx_CG10_MASK			(0x3 << 20)
#define MXC_CCM_CCGRx_CG9_MASK			(0x3 << 18)
#define MXC_CCM_CCGRx_CG8_MASK			(0x3 << 16)
#define MXC_CCM_CCGRx_CG7_MASK			(0x3 << 14)
#define MXC_CCM_CCGRx_CG5_MASK			(0x3 << 10)
#define MXC_CCM_CCGRx_CG4_MASK			(0x3 << 8)
#define MXC_CCM_CCGRx_CG3_MASK			(0x3 << 6)
#define MXC_CCM_CCGRx_CG2_MASK			(0x3 << 4)
#define MXC_CCM_CCGRx_CG1_MASK			(0x3 << 2)
#define MXC_CCM_CCGRx_CG0_MASK			(0x3 << 0)

#define MXC_CCM_CCGRx_CG15_OFFSET		30
#define MXC_CCM_CCGRx_CG14_OFFSET		28
#define MXC_CCM_CCGRx_CG13_OFFSET		26
#define MXC_CCM_CCGRx_CG12_OFFSET		24
#define MXC_CCM_CCGRx_CG11_OFFSET		22
#define MXC_CCM_CCGRx_CG10_OFFSET		20
#define MXC_CCM_CCGRx_CG9_OFFSET		18
#define MXC_CCM_CCGRx_CG8_OFFSET		16
#define MXC_CCM_CCGRx_CG7_OFFSET		14
#define MXC_CCM_CCGRx_CG6_OFFSET		12
#define MXC_CCM_CCGRx_CG5_OFFSET		10
#define MXC_CCM_CCGRx_CG4_OFFSET		8
#define MXC_CCM_CCGRx_CG3_OFFSET		6
#define MXC_CCM_CCGRx_CG2_OFFSET		4
#define MXC_CCM_CCGRx_CG1_OFFSET		2
#define MXC_CCM_CCGRx_CG0_OFFSET		0

/* Define the bits in registers CMEORx */
#define MXC_CCM_CMEORx_MO31			(1 << 31)
#define MXC_CCM_CMEORx_MO30			(1 << 30)
#define MXC_CCM_CMEORx_MO29			(1 << 29)
#define MXC_CCM_CMEORx_MO28			(1 << 28)
#define MXC_CCM_CMEORx_MO27			(1 << 27)
#define MXC_CCM_CMEORx_MO26			(1 << 26)
#define MXC_CCM_CMEORx_MO25			(1 << 25)
#define MXC_CCM_CMEORx_MO24			(1 << 24)
#define MXC_CCM_CMEORx_MO23			(1 << 23)
#define MXC_CCM_CMEORx_MO22			(1 << 22)
#define MXC_CCM_CMEORx_MO21			(1 << 21)
#define MXC_CCM_CMEORx_MO20			(1 << 20)
#define MXC_CCM_CMEORx_MO19			(1 << 19)
#define MXC_CCM_CMEORx_MO18			(1 << 18)
#define MXC_CCM_CMEORx_MO17			(1 << 17)
#define MXC_CCM_CMEORx_MO16			(1 << 16)
#define MXC_CCM_CMEORx_MO15			(1 << 15)
#define MXC_CCM_CMEORx_MO14			(1 << 14)
#define MXC_CCM_CMEORx_MO13			(1 << 13)
#define MXC_CCM_CMEORx_MO12			(1 << 12)
#define MXC_CCM_CMEORx_MO11			(1 << 11)
#define MXC_CCM_CMEORx_MO10			(1 << 10)
#define MXC_CCM_CMEORx_MO9			(1 << 9)
#define MXC_CCM_CMEORx_MO8			(1 << 8)
#define MXC_CCM_CMEORx_MO7			(1 << 7)
#define MXC_CCM_CMEORx_MO6			(1 << 6)
#define MXC_CCM_CMEORx_MO5			(1 << 5)
#define MXC_CCM_CMEORx_MO4			(1 << 4)
#define MXC_CCM_CMEORx_MO3			(1 << 3)
#define MXC_CCM_CMEORx_MO2			(1 << 2)
#define MXC_CCM_CMEORx_MO1			(1 << 1)
#define MXC_CCM_CMEORx_MO0			(1)

/* Define the bits in registers CPPDSR */
#define MXC_CCM_CPPDSR_PLL3_PFD4		(1 << 11)
#define MXC_CCM_CPPDSR_PLL3_PFD3		(1 << 10)
#define MXC_CCM_CPPDSR_PLL3_PFD2		(1 << 9)
#define MXC_CCM_CPPDSR_PLL3_PFD1		(1 << 8)
#define MXC_CCM_CPPDSR_PLL2_PFD4		(1 << 7)
#define MXC_CCM_CPPDSR_PLL2_PFD3		(1 << 6)
#define MXC_CCM_CPPDSR_PLL2_PFD2		(1 << 5)
#define MXC_CCM_CPPDSR_PLL2_PFD1		(1 << 4)
#define MXC_CCM_CPPDSR_PLL1_PFD4		(1 << 3)
#define MXC_CCM_CPPDSR_PLL1_PFD3		(1 << 2)
#define MXC_CCM_CPPDSR_PLL1_PFD2		(1 << 1)
#define MXC_CCM_CPPDSR_PLL1_PFD1		(1)

/* Define the bits in registers CCOWR */
#define MXC_CCM_CCOWR_AUX_CORE_WKUP		(1)

/* Define the bits in registers CCPGRn */
#define MXC_CCM_CCPGRx_CG_MASK			0x3
#define MXC_CCM_CCPGRx_MOD_OFF			0x0
#define MXC_CCM_CCPGRx_MOD_IDLE			0x1
#define MXC_CCM_CCPGRx_MOD_FORCE_ON		0x2
#define MXC_CCM_CCPGRx_MOD_ON			0x3

#define MXC_CCM_CCPGRx_PPCG15_MASK		(0x3 << 30)
#define MXC_CCM_CCPGRx_PPCG14_MASK		(0x3 << 28)
#define MXC_CCM_CCPGRx_PPCG13_MASK		(0x3 << 26)
#define MXC_CCM_CCPGRx_PPCG12_MASK		(0x3 << 24)
#define MXC_CCM_CCPGRx_PPCG11_MASK		(0x3 << 22)
#define MXC_CCM_CCPGRx_PPCG10_MASK		(0x3 << 20)
#define MXC_CCM_CCPGRx_PPCG9_MASK		(0x3 << 18)
#define MXC_CCM_CCPGRx_PPCG8_MASK		(0x3 << 16)
#define MXC_CCM_CCPGRx_PPCG7_MASK		(0x3 << 14)
#define MXC_CCM_CCPGRx_PPCG5_MASK		(0x3 << 10)
#define MXC_CCM_CCPGRx_PPCG4_MASK		(0x3 << 8)
#define MXC_CCM_CCPGRx_PPCG3_MASK		(0x3 << 6)
#define MXC_CCM_CCPGRx_PPCG2_MASK		(0x3 << 4)
#define MXC_CCM_CCPGRx_PPCG1_MASK		(0x3 << 2)
#define MXC_CCM_CCPGRx_PPCG0_MASK		(0x3 << 0)

#define MXC_CCM_CCPGRx_PPCG15_OFFSET		30
#define MXC_CCM_CCPGRx_PPCG14_OFFSET		28
#define MXC_CCM_CCPGRx_PPCG13_OFFSET		26
#define MXC_CCM_CCPGRx_PPCG12_OFFSET		24
#define MXC_CCM_CCPGRx_PPCG11_OFFSET		22
#define MXC_CCM_CCPGRx_PPCG10_OFFSET		20
#define MXC_CCM_CCPGRx_PPCG9_OFFSET		18
#define MXC_CCM_CCPGRx_PPCG8_OFFSET		16
#define MXC_CCM_CCPGRx_PPCG7_OFFSET		14
#define MXC_CCM_CCPGRx_PPCG6_OFFSET		12
#define MXC_CCM_CCPGRx_PPCG5_OFFSET		10
#define MXC_CCM_CCPGRx_PPCG4_OFFSET		8
#define MXC_CCM_CCPGRx_PPCG3_OFFSET		6
#define MXC_CCM_CCPGRx_PPCG2_OFFSET		4
#define MXC_CCM_CCPGRx_PPCG1_OFFSET		2
#define MXC_CCM_CCPGRx_PPCG0_OFFSET		0

/* CAN */
#define MXC_CAN0_BASE		MVF_IO_ADDRESS(MVF_FLEX_CAN0_BASE_ADDR)
#define CAN0_CTRL1		(MXC_CAN0_BASE + 0x4)

#define MXC_CAN1_BASE		MVF_IO_ADDRESS(MVF_FLEX_CAN1_BASE_ADDR)
#define CAN1_CTRL1		(MXC_CAN1_BASE + 0x4)

#define CAN_CTRL_CLKSRC		(1 << 13)
#define CAN_CTRL_CLKSRC_OFFSET	(13)

/* FTM */
#define MXC_FTM0_BASE		MVF_IO_ADDRESS(MVF_FTM0_BASE_ADDR)
#define FTM0_SC			(MXC_FTM0_BASE + 0x0)

#define MXC_FTM1_BASE		MVF_IO_ADDRESS(MVF_FTM1_BASE_ADDR)
#define FTM1_SC			(MXC_FTM1_BASE + 0x0)

#define MXC_FTM2_BASE		MVF_IO_ADDRESS(MVF_FTM2_BASE_ADDR)
#define FTM2_SC			(MXC_FTM2_BASE + 0x0)

#define MXC_FTM3_BASE		MVF_IO_ADDRESS(MVF_FTM3_BASE_ADDR)
#define FTM3_SC			(MXC_FTM3_BASE + 0x0)

#define FTM_SC_CLKS_MASK	(0x3 << 3)
#define FTM_SC_CLKS_OFFSET	(3)

#endif				/* __ARCH_ARM_MACH_MVF_CRM_REGS_H__ */