aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm/arch-arm1136/clocks243x.h
blob: 18d2e4677217114975a5757f80591c2571c996b8 (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
/*
 * (C) Copyright 2005
 * Texas Instruments, <www.ti.com>
 * Richard Woodruff <r-woodruff2@ti.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
  */
#ifndef _OMAP243X_CLOCKS_H_
#define _OMAP243X_CLOCKS_H_

/* cm_clksel core fields not ratio governed */
#define RX_CLKSEL_DSS1		(0x10 << 8)
#define RX_CLKSEL_DSS2		(0x0 << 13)
#define RX_CLKSEL_SSI		(0x5 << 20)

/* 2430 Ratio's */
/* 2430-Ratio Config 1 */
#define R1_CLKSEL_L3		(4 << 0)
#define R1_CLKSEL_L4		(2 << 5)
#define R1_CLKSEL_USB		(4 << 25)
#define R1_CM_CLKSEL1_CORE_VAL	R1_CLKSEL_USB | RX_CLKSEL_SSI | RX_CLKSEL_DSS2 \
                                | RX_CLKSEL_DSS1 | R1_CLKSEL_L4 | R1_CLKSEL_L3
#define R1_CLKSEL_MPU		(2 << 0)
#define R1_CM_CLKSEL_MPU_VAL	R1_CLKSEL_MPU
#define R1_CLKSEL_DSP		(2 << 0)
#define R1_CLKSEL_DSP_IF	(2 << 5)
#define R1_CM_CLKSEL_DSP_VAL	R1_CLKSEL_DSP | R1_CLKSEL_DSP_IF
#define R1_CLKSEL_GFX		(2 << 0)
#define R1_CM_CLKSEL_GFX_VAL	R1_CLKSEL_GFX
#define R1_CLKSEL_MDM		(4 << 0)
#define R1_CM_CLKSEL_MDM_VAL	R1_CLKSEL_MDM

/* 2430-Ratio Config 2 */
#define R2_CLKSEL_L3		(6 << 0)
#define R2_CLKSEL_L4		(2 << 5)
#define R2_CLKSEL_USB		(2 << 25)
#define R2_CM_CLKSEL1_CORE_VAL	R2_CLKSEL_USB | RX_CLKSEL_SSI | RX_CLKSEL_DSS2 \
                                | RX_CLKSEL_DSS1 | R2_CLKSEL_L4 | R2_CLKSEL_L3
#define R2_CLKSEL_MPU		(2 << 0)
#define R2_CM_CLKSEL_MPU_VAL	R2_CLKSEL_MPU
#define R2_CLKSEL_DSP		(2 << 0)
#define R2_CLKSEL_DSP_IF	(3 << 5)
#define R2_CM_CLKSEL_DSP_VAL	R2_CLKSEL_DSP | R2_CLKSEL_DSP_IF
#define R2_CLKSEL_GFX		(2 << 0)
#define R2_CM_CLKSEL_GFX_VAL    R2_CLKSEL_GFX
#define R2_CLKSEL_MDM		(6 << 0)
#define R2_CM_CLKSEL_MDM_VAL	R2_CLKSEL_MDM

/* 2430-Ratio Boot */
#define RB_CLKSEL_L3		(1 << 0)
#define RB_CLKSEL_L4		(1 << 5)
#define RB_CLKSEL_USB		(1 << 25)
#define RB_CM_CLKSEL1_CORE_VAL	RB_CLKSEL_USB | RX_CLKSEL_SSI | RX_CLKSEL_DSS2 \
                                | RX_CLKSEL_DSS1 | RB_CLKSEL_L4 | RB_CLKSEL_L3
#define RB_CLKSEL_MPU		(1 << 0)
#define RB_CM_CLKSEL_MPU_VAL	RB_CLKSEL_MPU
#define RB_CLKSEL_DSP		(1 << 0)
#define RB_CLKSEL_DSP_IF	(1 << 5)
#define RB_CM_CLKSEL_DSP_VAL	RB_CLKSEL_DSP | RB_CLKSEL_DSP_IF
#define RB_CLKSEL_GFX		(1 << 0)
#define RB_CM_CLKSEL_GFX_VAL	RB_CLKSEL_GFX
#define RB_CLKSEL_MDM		(1 << 0)
#define RB_CM_CLKSEL_MDM_VAL	RB_CLKSEL_MDM

/* 2430 Target modes: Along with each configuration the CPU has several modes
 * which goes along with them. Modes mainly are the addition of descrite DPLL
 * combinations to go along with a ratio.
 */
/* hardware goverend */
#define MX_48M_SRC		(0 << 3)
#define MX_54M_SRC		(0 << 5)
#define MX_APLLS_CLIKIN_12	(3 << 23)
#define MX_APLLS_CLIKIN_13	(2 << 23)
#define MX_APLLS_CLIKIN_19_2	(0 << 23)

/* 2430 - standalone, 2*ref*M/(n+1), M/N is for exactness not relock speed */

/* boot (boot) */
#define MB_DPLL_MULT				(1 << 12)
#define MB_DPLL_DIV					(0 << 8)
#define MB_CM_CLKSEL1_PLL_12_VAL     MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV \
                                    | MB_DPLL_MULT | MX_APLLS_CLIKIN_12

#define MB_CM_CLKSEL1_PLL_13_VAL    MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV \
                                    | MB_DPLL_MULT | MX_APLLS_CLIKIN_13

#define MB_CM_CLKSEL1_PLL_19_VAL    MX_48M_SRC | MX_54M_SRC | MB_DPLL_DIV \
                                    | MB_DPLL_MULT | MX_APLLS_CLIKIN_19

/* #2   (ratio1) DPLL = 330*2 = 660MHz, L3=165MHz */

#define M2_DPLL_MULT_12		        (55 << 12)
#define M2_DPLL_DIV_12		        (1 << 8)
#define M2_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | M2_DPLL_DIV_12 \
                                    | M2_DPLL_MULT_12 | MX_APLLS_CLIKIN_12
/* Use 658.7MHz instead of 660MHz for LP-Refresh M=76 N=2, relock time issue */
#define M2_DPLL_MULT_13		        (330 << 12)
#define M2_DPLL_DIV_13		        (12 << 8)
#define M2_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | M2_DPLL_DIV_13 \
                                    | M2_DPLL_MULT_13 | MX_APLLS_CLIKIN_13
#define M2_DPLL_MULT_19		        (275 << 12)
#define M2_DPLL_DIV_19		        (15 << 8)
#define M2_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | M2_DPLL_DIV_19 \
                                    | M2_DPLL_MULT_19 | MX_APLLS_CLIKIN_19_2

/* #3   (ratio2) DPLL = 330*2 = 660MHz, L3=110MHz */
#define M3_DPLL_MULT_12		        (55 << 12)
#define M3_DPLL_DIV_12		        (1 << 8)
#define M3_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | M3_DPLL_DIV_12 \
                                    | M3_DPLL_MULT_12 | MX_APLLS_CLIKIN_12
#define M3_DPLL_MULT_13		        (330 << 12)
#define M3_DPLL_DIV_13		        (12 << 8)
#define M3_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | M3_DPLL_DIV_13 \
                                    | M3_DPLL_MULT_13 | MX_APLLS_CLIKIN_13
#define M3_DPLL_MULT_19		        (275 << 12)
#define M3_DPLL_DIV_19		        (15 << 8)
#define M3_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | M3_DPLL_DIV_19 \
                                    | M3_DPLL_MULT_19 | MX_APLLS_CLIKIN_19_2

/* #4   (ratio2), DPLL = 399*2 = 798MHz, L3=133MHz*/
#define M4_DPLL_MULT_12		        (133 << 12)
#define M4_DPLL_DIV_12		        (3 << 8)
#define M4_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | M4_DPLL_DIV_12 \
                                    | M4_DPLL_MULT_12 | MX_APLLS_CLIKIN_12
#define M4_DPLL_MULT_13		        (399 << 12)
#define M4_DPLL_DIV_13		        (12 << 8)
#define M4_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | M4_DPLL_DIV_13 \
                                    | M4_DPLL_MULT_13 | MX_APLLS_CLIKIN_13
#define M4_DPLL_MULT_19		        (145 << 12)
#define M4_DPLL_DIV_19		        (6 << 8)
#define M4_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | M4_DPLL_DIV_19 \
                                    | M4_DPLL_MULT_19 | MX_APLLS_CLIKIN_19_2

/* #5a  (ratio1) baseport-target, target DPLL = 266*2 = 532MHz, L3=133MHz */
#define M5A_DPLL_MULT_12	        (133 << 12)
#define M5A_DPLL_DIV_12		        (5 << 8)
#define M5A_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | M5A_DPLL_DIV_12 \
                                    | M5A_DPLL_MULT_12 | MX_APLLS_CLIKIN_12
#define M5A_DPLL_MULT_13	        (266 << 12)
#define M5A_DPLL_DIV_13		        (12 << 8)
#define M5A_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | M5A_DPLL_DIV_13 \
                                    | M5A_DPLL_MULT_13 | MX_APLLS_CLIKIN_13
#define M5A_DPLL_MULT_19	        (180 << 12)
#define M5A_DPLL_DIV_19		        (12 << 8)
#define M5A_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | M5A_DPLL_DIV_19 \
                                    | M5A_DPLL_MULT_19 | MX_APLLS_CLIKIN_19_2

/* #5b  (ratio1) target DPLL = 200*2 = 400MHz, L3=100MHz */
#define M5B_DPLL_MULT_12	        (50 << 12)
#define M5B_DPLL_DIV_12		        (2 << 8)
#define M5B_CM_CLKSEL1_PLL_12_VAL	MX_48M_SRC | MX_54M_SRC | M5B_DPLL_DIV_12 \
                                    | M5B_DPLL_MULT_12 | MX_APLLS_CLIKIN_12
#define M5B_DPLL_MULT_13	        (200 << 12)
#define M5B_DPLL_DIV_13		        (12 << 8)

#define M5B_CM_CLKSEL1_PLL_13_VAL	MX_48M_SRC | MX_54M_SRC | M5B_DPLL_DIV_13 \
                                    | M5B_DPLL_MULT_13 | MX_APLLS_CLIKIN_13
#define M5B_DPLL_MULT_19	        (125 << 12)
#define M5B_DPLL_DIV_19		        (31 << 8)
#define M5B_CM_CLKSEL1_PLL_19_VAL	MX_48M_SRC | MX_54M_SRC | M5B_DPLL_DIV_19 \
                                    | M5B_DPLL_MULT_19 | MX_APLLS_CLIKIN_19_2

/* 2430 - chassis (sedna) */
	/* 165 (ratio1) same as above #2 */
	/* 150 (ratio1)*/
	/* 133 (ratio2) same as above #4 */
	/* 110 (ratio2) same as above #3*/
	/* 104 (ratio2)*/
	/* boot (boot) */

/* high and low operation value */
#define MX_CLKSEL2_PLL_2x_VAL   (2 << 0)
#define MX_CLKSEL2_PLL_1x_VAL   (1 << 0)

/* set defaults for boot up */
#if defined(PRCM_CONFIG_2)     /* ARM-330MHz IVA2-330MHz L3-165MHz */
# define DPLL_OUT	MX_CLKSEL2_PLL_2x_VAL
# define MPU_DIV	R1_CLKSEL_MPU
# define DSP_DIV	R1_CM_CLKSEL_DSP_VAL
# define GFX_DIV	R1_CM_CLKSEL_GFX_VAL
# define BUS_DIV	R1_CM_CLKSEL1_CORE_VAL
# define DPLL_VAL	M2_CM_CLKSEL1_PLL_13_VAL
# define MDM_DIV	R2_CM_CLKSEL_MDM_VAL
#elif defined(PRCM_CONFIG_3)     /* ARM-330MHz IVA2-330MHz L3-110MHz */
# define DPLL_OUT	MX_CLKSEL2_PLL_2x_VAL
# define MPU_DIV	R2_CLKSEL_MPU
# define DSP_DIV	R2_CM_CLKSEL_DSP_VAL
# define GFX_DIV	R2_CM_CLKSEL_GFX_VAL
# define BUS_DIV	R2_CM_CLKSEL1_CORE_VAL
# define DPLL_VAL	M3_CM_CLKSEL1_PLL_13_VAL
# define MDM_DIV	R2_CM_CLKSEL_MDM_VAL
#elif defined(PRCM_CONFIG_5A)  /* ARM-266MHz IVA2-266MHz L3-133MHz */
# define DPLL_OUT	MX_CLKSEL2_PLL_2x_VAL
# define MPU_DIV	R1_CLKSEL_MPU
# define DSP_DIV	R1_CM_CLKSEL_DSP_VAL
# define GFX_DIV	R1_CM_CLKSEL_GFX_VAL
# define BUS_DIV	R1_CM_CLKSEL1_CORE_VAL
# define DPLL_VAL	M5A_CM_CLKSEL1_PLL_13_VAL
# define MDM_DIV	R2_CM_CLKSEL_MDM_VAL
#elif defined(PRCM_CONFIG_5B)  /* ARM-200MHz IVA2-200MHz L3-100MHz */
# define DPLL_OUT	MX_CLKSEL2_PLL_2x_VAL
# define MPU_DIV	R1_CLKSEL_MPU
# define DSP_DIV	R1_CM_CLKSEL_DSP_VAL
# define GFX_DIV	R1_CM_CLKSEL_GFX_VAL
# define BUS_DIV	R1_CM_CLKSEL1_CORE_VAL
# define DPLL_VAL	M5B_CM_CLKSEL1_PLL_13_VAL
# define MDM_DIV	R1_CM_CLKSEL_MDM_VAL
#endif

#endif