blob: 930b9485055693c1413524bf36a9c2b49560480d [file] [log] [blame]
Chander Kashyap0e7ab682011-08-18 22:37:19 +00001/*
2 * Machine Specific Values for ORIGEN board based on S5PV310
3 *
4 * Copyright (C) 2011 Samsung Electronics
5 *
6 * See file CREDITS for list of people who contributed to this
7 * project.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * MA 02111-1307 USA
23 */
24
25#ifndef _ORIGEN_SETUP_H
26#define _ORIGEN_SETUP_H
27
28#include <config.h>
29#include <version.h>
30#include <asm/arch/cpu.h>
31
32/* Offsets of clock registers (sources and dividers) */
33#define CLK_SRC_CPU_OFFSET 0x14200
34#define CLK_DIV_CPU0_OFFSET 0x14500
35#define CLK_DIV_CPU1_OFFSET 0x14504
36
37#define CLK_SRC_DMC_OFFSET 0x10200
38#define CLK_DIV_DMC0_OFFSET 0x10500
39#define CLK_DIV_DMC1_OFFSET 0x10504
40
41#define CLK_SRC_TOP0_OFFSET 0xC210
42#define CLK_SRC_TOP1_OFFSET 0xC214
43#define CLK_DIV_TOP_OFFSET 0xC510
44
45#define CLK_SRC_LEFTBUS_OFFSET 0x4200
46#define CLK_DIV_LEFTBUS_OFFSET 0x4500
47
48#define CLK_SRC_RIGHTBUS_OFFSET 0x8200
49#define CLK_DIV_RIGHTBUS_OFFSET 0x8500
50
51#define CLK_SRC_FSYS_OFFSET 0xC240
52#define CLK_DIV_FSYS1_OFFSET 0xC544
53#define CLK_DIV_FSYS2_OFFSET 0xC548
54#define CLK_DIV_FSYS3_OFFSET 0xC54C
55
Annamalai Lakshmanan59988c22012-08-30 20:33:58 +000056#define CLK_SRC_CAM_OFFSET 0xC220
57#define CLK_SRC_TV_OFFSET 0xC224
58#define CLK_SRC_MFC_OFFSET 0xC228
59#define CLK_SRC_G3D_OFFSET 0xC22C
60#define CLK_SRC_LCD0_OFFSET 0xC234
Chander Kashyap0e7ab682011-08-18 22:37:19 +000061#define CLK_SRC_PERIL0_OFFSET 0xC250
Annamalai Lakshmanan59988c22012-08-30 20:33:58 +000062
63#define CLK_DIV_CAM_OFFSET 0xC520
64#define CLK_DIV_TV_OFFSET 0xC524
65#define CLK_DIV_MFC_OFFSET 0xC528
66#define CLK_DIV_G3D_OFFSET 0xC52C
67#define CLK_DIV_LCD0_OFFSET 0xC534
Chander Kashyap0e7ab682011-08-18 22:37:19 +000068#define CLK_DIV_PERIL0_OFFSET 0xC550
69
Chander Kashyap5fc569a2011-12-18 20:16:32 +000070#define CLK_SRC_LCD0_OFFSET 0xC234
71
Chander Kashyap0e7ab682011-08-18 22:37:19 +000072#define APLL_LOCK_OFFSET 0x14000
73#define MPLL_LOCK_OFFSET 0x14008
74#define APLL_CON0_OFFSET 0x14100
75#define APLL_CON1_OFFSET 0x14104
76#define MPLL_CON0_OFFSET 0x14108
77#define MPLL_CON1_OFFSET 0x1410C
78
79#define EPLL_LOCK_OFFSET 0xC010
80#define VPLL_LOCK_OFFSET 0xC020
81#define EPLL_CON0_OFFSET 0xC110
82#define EPLL_CON1_OFFSET 0xC114
83#define VPLL_CON0_OFFSET 0xC120
84#define VPLL_CON1_OFFSET 0xC124
85
86/* DMC: DRAM Controllor Register offsets */
87#define DMC_CONCONTROL 0x00
88#define DMC_MEMCONTROL 0x04
89#define DMC_MEMCONFIG0 0x08
90#define DMC_MEMCONFIG1 0x0C
91#define DMC_DIRECTCMD 0x10
92#define DMC_PRECHCONFIG 0x14
93#define DMC_PHYCONTROL0 0x18
94#define DMC_PHYCONTROL1 0x1C
95#define DMC_PHYCONTROL2 0x20
96#define DMC_TIMINGAREF 0x30
97#define DMC_TIMINGROW 0x34
98#define DMC_TIMINGDATA 0x38
99#define DMC_TIMINGPOWER 0x3C
100#define DMC_PHYZQCONTROL 0x44
101
102/* Bus Configuration Register Address */
103#define ASYNC_CONFIG 0x10010350
104
105/* MIU Config Register Offsets*/
106#define APB_SFR_INTERLEAVE_CONF_OFFSET 0x400
107#define APB_SFR_ARBRITATION_CONF_OFFSET 0xC00
108
109/* Offset for inform registers */
110#define INFORM0_OFFSET 0x800
111#define INFORM1_OFFSET 0x804
112
113/* GPIO Offsets for UART: GPIO Contol Register */
Chander Kashyap4131a772011-12-06 23:34:12 +0000114#define EXYNOS4_GPIO_A0_CON_OFFSET 0x00
115#define EXYNOS4_GPIO_A1_CON_OFFSET 0x20
Chander Kashyap0e7ab682011-08-18 22:37:19 +0000116
117/* UART Register offsets */
118#define ULCON_OFFSET 0x00
119#define UCON_OFFSET 0x04
120#define UFCON_OFFSET 0x08
121#define UBRDIV_OFFSET 0x28
122#define UFRACVAL_OFFSET 0x2C
123
124/* TZPC : Register Offsets */
125#define TZPC0_BASE 0x10110000
126#define TZPC1_BASE 0x10120000
127#define TZPC2_BASE 0x10130000
128#define TZPC3_BASE 0x10140000
129#define TZPC4_BASE 0x10150000
130#define TZPC5_BASE 0x10160000
131
132#define TZPC_DECPROT0SET_OFFSET 0x804
133#define TZPC_DECPROT1SET_OFFSET 0x810
134#define TZPC_DECPROT2SET_OFFSET 0x81C
135#define TZPC_DECPROT3SET_OFFSET 0x828
136
137/* CLK_SRC_CPU */
138#define MUX_HPM_SEL_MOUTAPLL 0x0
139#define MUX_HPM_SEL_SCLKMPLL 0x1
140#define MUX_CORE_SEL_MOUTAPLL 0x0
141#define MUX_CORE_SEL_SCLKMPLL 0x1
142#define MUX_MPLL_SEL_FILPLL 0x0
143#define MUX_MPLL_SEL_MOUTMPLLFOUT 0x1
144#define MUX_APLL_SEL_FILPLL 0x0
145#define MUX_APLL_SEL_MOUTMPLLFOUT 0x1
146#define CLK_SRC_CPU_VAL ((MUX_HPM_SEL_MOUTAPLL << 20) \
147 | (MUX_CORE_SEL_MOUTAPLL << 16) \
148 | (MUX_MPLL_SEL_MOUTMPLLFOUT << 8)\
149 | (MUX_APLL_SEL_MOUTMPLLFOUT << 0))
150
151/* CLK_DIV_CPU0 */
152#define APLL_RATIO 0x0
153#define PCLK_DBG_RATIO 0x1
154#define ATB_RATIO 0x3
155#define PERIPH_RATIO 0x3
156#define COREM1_RATIO 0x7
157#define COREM0_RATIO 0x3
158#define CORE_RATIO 0x0
159#define CLK_DIV_CPU0_VAL ((APLL_RATIO << 24) \
160 | (PCLK_DBG_RATIO << 20) \
161 | (ATB_RATIO << 16) \
162 | (PERIPH_RATIO << 12) \
163 | (COREM1_RATIO << 8) \
164 | (COREM0_RATIO << 4) \
165 | (CORE_RATIO << 0))
166
167/* CLK_DIV_CPU1 */
168#define HPM_RATIO 0x0
169#define COPY_RATIO 0x3
170#define CLK_DIV_CPU1_VAL ((HPM_RATIO << 4) | (COPY_RATIO))
171
172/* CLK_SRC_DMC */
173#define MUX_PWI_SEL_XXTI 0x0
174#define MUX_PWI_SEL_XUSBXTI 0x1
175#define MUX_PWI_SEL_SCLK_HDMI24M 0x2
176#define MUX_PWI_SEL_SCLK_USBPHY0 0x3
177#define MUX_PWI_SEL_SCLK_USBPHY1 0x4
178#define MUX_PWI_SEL_SCLK_HDMIPHY 0x5
179#define MUX_PWI_SEL_SCLKMPLL 0x6
180#define MUX_PWI_SEL_SCLKEPLL 0x7
181#define MUX_PWI_SEL_SCLKVPLL 0x8
182#define MUX_DPHY_SEL_SCLKMPLL 0x0
183#define MUX_DPHY_SEL_SCLKAPLL 0x1
184#define MUX_DMC_BUS_SEL_SCLKMPLL 0x0
185#define MUX_DMC_BUS_SEL_SCLKAPLL 0x1
186#define CLK_SRC_DMC_VAL ((MUX_PWI_SEL_XUSBXTI << 16) \
187 | (MUX_DPHY_SEL_SCLKMPLL << 8) \
188 | (MUX_DMC_BUS_SEL_SCLKMPLL << 4))
189
190/* CLK_DIV_DMC0 */
191#define CORE_TIMERS_RATIO 0x1
192#define COPY2_RATIO 0x3
193#define DMCP_RATIO 0x1
194#define DMCD_RATIO 0x1
195#define DMC_RATIO 0x1
196#define DPHY_RATIO 0x1
197#define ACP_PCLK_RATIO 0x1
198#define ACP_RATIO 0x3
199#define CLK_DIV_DMC0_VAL ((CORE_TIMERS_RATIO << 28) \
200 | (COPY2_RATIO << 24) \
201 | (DMCP_RATIO << 20) \
202 | (DMCD_RATIO << 16) \
203 | (DMC_RATIO << 12) \
204 | (DPHY_RATIO << 8) \
205 | (ACP_PCLK_RATIO << 4) \
206 | (ACP_RATIO << 0))
207
208/* CLK_DIV_DMC1 */
209#define DPM_RATIO 0x1
210#define DVSEM_RATIO 0x1
211#define PWI_RATIO 0x1
212#define CLK_DIV_DMC1_VAL ((DPM_RATIO << 24) \
213 | (DVSEM_RATIO << 16) \
214 | (PWI_RATIO << 8))
215
216/* CLK_SRC_TOP0 */
217#define MUX_ONENAND_SEL_ACLK_133 0x0
218#define MUX_ONENAND_SEL_ACLK_160 0x1
219#define MUX_ACLK_133_SEL_SCLKMPLL 0x0
220#define MUX_ACLK_133_SEL_SCLKAPLL 0x1
221#define MUX_ACLK_160_SEL_SCLKMPLL 0x0
222#define MUX_ACLK_160_SEL_SCLKAPLL 0x1
223#define MUX_ACLK_100_SEL_SCLKMPLL 0x0
224#define MUX_ACLK_100_SEL_SCLKAPLL 0x1
225#define MUX_ACLK_200_SEL_SCLKMPLL 0x0
226#define MUX_ACLK_200_SEL_SCLKAPLL 0x1
227#define MUX_VPLL_SEL_FINPLL 0x0
228#define MUX_VPLL_SEL_FOUTVPLL 0x1
229#define MUX_EPLL_SEL_FINPLL 0x0
230#define MUX_EPLL_SEL_FOUTEPLL 0x1
231#define MUX_ONENAND_1_SEL_MOUTONENAND 0x0
232#define MUX_ONENAND_1_SEL_SCLKVPLL 0x1
233#define CLK_SRC_TOP0_VAL ((MUX_ONENAND_SEL_ACLK_133 << 28) \
234 | (MUX_ACLK_133_SEL_SCLKMPLL << 24) \
235 | (MUX_ACLK_160_SEL_SCLKMPLL << 20) \
236 | (MUX_ACLK_100_SEL_SCLKMPLL << 16) \
237 | (MUX_ACLK_200_SEL_SCLKMPLL << 12) \
238 | (MUX_VPLL_SEL_FINPLL << 8) \
239 | (MUX_EPLL_SEL_FINPLL << 4)\
240 | (MUX_ONENAND_1_SEL_MOUTONENAND << 0))
241
242/* CLK_SRC_TOP1 */
243#define VPLLSRC_SEL_FINPLL 0x0
244#define VPLLSRC_SEL_SCLKHDMI24M 0x1
245#define CLK_SRC_TOP1_VAL (VPLLSRC_SEL_FINPLL)
246
247/* CLK_DIV_TOP */
248#define ONENAND_RATIO 0x0
249#define ACLK_133_RATIO 0x5
250#define ACLK_160_RATIO 0x4
251#define ACLK_100_RATIO 0x7
252#define ACLK_200_RATIO 0x3
253#define CLK_DIV_TOP_VAL ((ONENAND_RATIO << 16) \
254 | (ACLK_133_RATIO << 12)\
255 | (ACLK_160_RATIO << 8) \
256 | (ACLK_100_RATIO << 4) \
257 | (ACLK_200_RATIO << 0))
258
259/* CLK_SRC_LEFTBUS */
260#define MUX_GDL_SEL_SCLKMPLL 0x0
261#define MUX_GDL_SEL_SCLKAPLL 0x1
262#define CLK_SRC_LEFTBUS_VAL (MUX_GDL_SEL_SCLKMPLL)
263
264/* CLK_DIV_LEFTBUS */
265#define GPL_RATIO 0x1
266#define GDL_RATIO 0x3
267#define CLK_DIV_LEFTBUS_VAL ((GPL_RATIO << 4) | (GDL_RATIO))
268
269/* CLK_SRC_RIGHTBUS */
270#define MUX_GDR_SEL_SCLKMPLL 0x0
271#define MUX_GDR_SEL_SCLKAPLL 0x1
272#define CLK_SRC_RIGHTBUS_VAL (MUX_GDR_SEL_SCLKMPLL)
273
274/* CLK_DIV_RIGHTBUS */
275#define GPR_RATIO 0x1
276#define GDR_RATIO 0x3
277#define CLK_DIV_RIGHTBUS_VAL ((GPR_RATIO << 4) | (GDR_RATIO))
278
279/* CLK_SRS_FSYS: 6 = SCLKMPLL */
280#define SATA_SEL_SCLKMPLL 0
281#define SATA_SEL_SCLKAPLL 1
282
283#define MMC_SEL_XXTI 0
284#define MMC_SEL_XUSBXTI 1
285#define MMC_SEL_SCLK_HDMI24M 2
286#define MMC_SEL_SCLK_USBPHY0 3
287#define MMC_SEL_SCLK_USBPHY1 4
288#define MMC_SEL_SCLK_HDMIPHY 5
289#define MMC_SEL_SCLKMPLL 6
290#define MMC_SEL_SCLKEPLL 7
291#define MMC_SEL_SCLKVPLL 8
292
293#define MMCC0_SEL MMC_SEL_SCLKMPLL
294#define MMCC1_SEL MMC_SEL_SCLKMPLL
295#define MMCC2_SEL MMC_SEL_SCLKMPLL
296#define MMCC3_SEL MMC_SEL_SCLKMPLL
297#define MMCC4_SEL MMC_SEL_SCLKMPLL
298#define CLK_SRC_FSYS_VAL ((SATA_SEL_SCLKMPLL << 24) \
299 | (MMCC4_SEL << 16) \
300 | (MMCC3_SEL << 12) \
301 | (MMCC2_SEL << 8) \
302 | (MMCC1_SEL << 4) \
303 | (MMCC0_SEL << 0))
304
305/* SCLK_MMC[0-4] = MOUTMMC[0-4]/(MMC[0-4]_RATIO + 1)/(MMC[0-4]_PRE_RATIO +1) */
306/* CLK_DIV_FSYS1 */
307#define MMC0_RATIO 0xF
308#define MMC0_PRE_RATIO 0x0
309#define MMC1_RATIO 0xF
310#define MMC1_PRE_RATIO 0x0
311#define CLK_DIV_FSYS1_VAL ((MMC1_PRE_RATIO << 24) \
312 | (MMC1_RATIO << 16) \
313 | (MMC0_PRE_RATIO << 8) \
314 | (MMC0_RATIO << 0))
315
316/* CLK_DIV_FSYS2 */
317#define MMC2_RATIO 0xF
318#define MMC2_PRE_RATIO 0x0
319#define MMC3_RATIO 0xF
320#define MMC3_PRE_RATIO 0x0
321#define CLK_DIV_FSYS2_VAL ((MMC3_PRE_RATIO << 24) \
322 | (MMC3_RATIO << 16) \
323 | (MMC2_PRE_RATIO << 8) \
324 | (MMC2_RATIO << 0))
325
326/* CLK_DIV_FSYS3 */
327#define MMC4_RATIO 0xF
328#define MMC4_PRE_RATIO 0x0
329#define CLK_DIV_FSYS3_VAL ((MMC4_PRE_RATIO << 8) \
330 | (MMC4_RATIO << 0))
331
332/* CLK_SRC_PERIL0 */
333#define UART_SEL_XXTI 0
334#define UART_SEL_XUSBXTI 1
335#define UART_SEL_SCLK_HDMI24M 2
336#define UART_SEL_SCLK_USBPHY0 3
337#define UART_SEL_SCLK_USBPHY1 4
338#define UART_SEL_SCLK_HDMIPHY 5
339#define UART_SEL_SCLKMPLL 6
340#define UART_SEL_SCLKEPLL 7
341#define UART_SEL_SCLKVPLL 8
342
343#define UART0_SEL UART_SEL_SCLKMPLL
344#define UART1_SEL UART_SEL_SCLKMPLL
345#define UART2_SEL UART_SEL_SCLKMPLL
346#define UART3_SEL UART_SEL_SCLKMPLL
347#define UART4_SEL UART_SEL_SCLKMPLL
348#define CLK_SRC_PERIL0_VAL ((UART4_SEL << 16) \
349 | (UART3_SEL << 12) \
350 | (UART2_SEL << 8) \
351 | (UART1_SEL << 4) \
352 | (UART0_SEL << 0))
353
354/* SCLK_UART[0-4] = MOUTUART[0-4]/(UART[0-4]_RATIO + 1) */
355/* CLK_DIV_PERIL0 */
356#define UART0_RATIO 7
357#define UART1_RATIO 7
358#define UART2_RATIO 7
359#define UART3_RATIO 7
360#define UART4_RATIO 7
361#define CLK_DIV_PERIL0_VAL ((UART4_RATIO << 16) \
362 | (UART3_RATIO << 12) \
363 | (UART2_RATIO << 8) \
364 | (UART1_RATIO << 4) \
365 | (UART0_RATIO << 0))
366
Annamalai Lakshmanan59988c22012-08-30 20:33:58 +0000367/* Clock Source CAM/FIMC */
368/* CLK_SRC_CAM */
369#define CAM0_SEL_XUSBXTI 1
370#define CAM1_SEL_XUSBXTI 1
371#define CSIS0_SEL_XUSBXTI 1
372#define CSIS1_SEL_XUSBXTI 1
373
374#define FIMC_SEL_SCLKMPLL 6
375#define FIMC0_LCLK_SEL FIMC_SEL_SCLKMPLL
376#define FIMC1_LCLK_SEL FIMC_SEL_SCLKMPLL
377#define FIMC2_LCLK_SEL FIMC_SEL_SCLKMPLL
378#define FIMC3_LCLK_SEL FIMC_SEL_SCLKMPLL
379
380#define CLK_SRC_CAM_VAL ((CSIS1_SEL_XUSBXTI << 28) \
381 | (CSIS0_SEL_XUSBXTI << 24) \
382 | (CAM1_SEL_XUSBXTI << 20) \
383 | (CAM0_SEL_XUSBXTI << 16) \
384 | (FIMC3_LCLK_SEL << 12) \
385 | (FIMC2_LCLK_SEL << 8) \
386 | (FIMC1_LCLK_SEL << 4) \
387 | (FIMC0_LCLK_SEL << 0))
388
389/* SCLK CAM */
390/* CLK_DIV_CAM */
391#define FIMC0_LCLK_RATIO 4
392#define FIMC1_LCLK_RATIO 4
393#define FIMC2_LCLK_RATIO 4
394#define FIMC3_LCLK_RATIO 4
395#define CLK_DIV_CAM_VAL ((FIMC3_LCLK_RATIO << 12) \
396 | (FIMC2_LCLK_RATIO << 8) \
397 | (FIMC1_LCLK_RATIO << 4) \
398 | (FIMC0_LCLK_RATIO << 0))
399
400/* SCLK MFC */
401/* CLK_SRC_MFC */
402#define MFC_SEL_MPLL 0
403#define MOUTMFC_0 0
404#define MFC_SEL MOUTMFC_0
405#define MFC_0_SEL MFC_SEL_MPLL
406#define CLK_SRC_MFC_VAL ((MFC_SEL << 8) | (MFC_0_SEL))
407
408
409/* CLK_DIV_MFC */
410#define MFC_RATIO 3
411#define CLK_DIV_MFC_VAL (MFC_RATIO)
412
413/* SCLK G3D */
414/* CLK_SRC_G3D */
415#define G3D_SEL_MPLL 0
416#define MOUTG3D_0 0
417#define G3D_SEL MOUTG3D_0
418#define G3D_0_SEL G3D_SEL_MPLL
419#define CLK_SRC_G3D_VAL ((G3D_SEL << 8) | (G3D_0_SEL))
420
421/* CLK_DIV_G3D */
422#define G3D_RATIO 1
423#define CLK_DIV_G3D_VAL (G3D_RATIO)
424
425/* SCLK LCD0 */
Chander Kashyap5fc569a2011-12-18 20:16:32 +0000426/* CLK_SRC_LCD0 */
427#define FIMD_SEL_SCLKMPLL 6
428#define MDNIE0_SEL_XUSBXTI 1
429#define MDNIE_PWM0_SEL_XUSBXTI 1
430#define MIPI0_SEL_XUSBXTI 1
431#define CLK_SRC_LCD0_VAL ((MIPI0_SEL_XUSBXTI << 12) \
432 | (MDNIE_PWM0_SEL_XUSBXTI << 8) \
433 | (MDNIE0_SEL_XUSBXTI << 4) \
434 | (FIMD_SEL_SCLKMPLL << 0))
435
Annamalai Lakshmanan59988c22012-08-30 20:33:58 +0000436/* CLK_DIV_LCD0 */
437#define FIMD0_RATIO 4
438#define CLK_DIV_LCD0_VAL (FIMD0_RATIO)
439
Chander Kashyap0e7ab682011-08-18 22:37:19 +0000440/* Required period to generate a stable clock output */
441/* PLL_LOCK_TIME */
442#define PLL_LOCKTIME 0x1C20
443
444/* PLL Values */
445#define DISABLE 0
446#define ENABLE 1
447#define SET_PLL(mdiv, pdiv, sdiv) ((ENABLE << 31)\
448 | (mdiv << 16) \
449 | (pdiv << 8) \
450 | (sdiv << 0))
451
452/* APLL_CON0 */
453#define APLL_MDIV 0xFA
454#define APLL_PDIV 0x6
455#define APLL_SDIV 0x1
456#define APLL_CON0_VAL SET_PLL(APLL_MDIV, APLL_PDIV, APLL_SDIV)
457
458/* APLL_CON1 */
459#define APLL_AFC_ENB 0x1
460#define APLL_AFC 0xC
461#define APLL_CON1_VAL ((APLL_AFC_ENB << 31) | (APLL_AFC << 0))
462
463/* MPLL_CON0 */
464#define MPLL_MDIV 0xC8
465#define MPLL_PDIV 0x6
466#define MPLL_SDIV 0x1
467#define MPLL_CON0_VAL SET_PLL(MPLL_MDIV, MPLL_PDIV, MPLL_SDIV)
468
469/* MPLL_CON1 */
470#define MPLL_AFC_ENB 0x0
471#define MPLL_AFC 0x1C
472#define MPLL_CON1_VAL ((MPLL_AFC_ENB << 31) | (MPLL_AFC << 0))
473
474/* EPLL_CON0 */
475#define EPLL_MDIV 0x30
476#define EPLL_PDIV 0x3
477#define EPLL_SDIV 0x2
478#define EPLL_CON0_VAL SET_PLL(EPLL_MDIV, EPLL_PDIV, EPLL_SDIV)
479
480/* EPLL_CON1 */
481#define EPLL_K 0x0
482#define EPLL_CON1_VAL (EPLL_K >> 0)
483
484/* VPLL_CON0 */
485#define VPLL_MDIV 0x35
486#define VPLL_PDIV 0x3
487#define VPLL_SDIV 0x2
488#define VPLL_CON0_VAL SET_PLL(VPLL_MDIV, VPLL_PDIV, VPLL_SDIV)
489
490/* VPLL_CON1 */
491#define VPLL_SSCG_EN DISABLE
492#define VPLL_SEL_PF_DN_SPREAD 0x0
493#define VPLL_MRR 0x11
494#define VPLL_MFR 0x0
495#define VPLL_K 0x400
496#define VPLL_CON1_VAL ((VPLL_SSCG_EN << 31)\
497 | (VPLL_SEL_PF_DN_SPREAD << 29) \
498 | (VPLL_MRR << 24) \
499 | (VPLL_MFR << 16) \
500 | (VPLL_K << 0))
501/*
502 * UART GPIO_A0/GPIO_A1 Control Register Value
503 * 0x2: UART Function
504 */
Chander Kashyap4131a772011-12-06 23:34:12 +0000505#define EXYNOS4_GPIO_A0_CON_VAL 0x22222222
506#define EXYNOS4_GPIO_A1_CON_VAL 0x222222
Chander Kashyap0e7ab682011-08-18 22:37:19 +0000507
508/* ULCON: UART Line Control Value 8N1 */
509#define WORD_LEN_5_BIT 0x00
510#define WORD_LEN_6_BIT 0x01
511#define WORD_LEN_7_BIT 0x02
512#define WORD_LEN_8_BIT 0x03
513
514#define STOP_BIT_1 0x00
515#define STOP_BIT_2 0x01
516
517#define NO_PARITY 0x00
518#define ODD_PARITY 0x4
519#define EVEN_PARITY 0x5
520#define FORCED_PARITY_CHECK_AS_1 0x6
521#define FORCED_PARITY_CHECK_AS_0 0x7
522
523#define INFRAMODE_NORMAL 0x00
524#define INFRAMODE_INFRARED 0x01
525
526#define ULCON_VAL ((INFRAMODE_NORMAL << 6) \
527 | (NO_PARITY << 3) \
528 | (STOP_BIT_1 << 2) \
529 | (WORD_LEN_8_BIT << 0))
530
531/*
532 * UCON: UART Control Value
533 * Tx_interrupt Type: Level
534 * Rx_interrupt Type: Level
535 * Rx Timeout Enabled: Yes
536 * Rx-Error Atatus_Int Enable: Yes
537 * Loop_Back: No
538 * Break Signal: No
539 * Transmit mode : Interrupt request/polling
540 * Receive mode : Interrupt request/polling
541 */
542#define TX_PULSE_INTERRUPT 0
543#define TX_LEVEL_INTERRUPT 1
544#define RX_PULSE_INTERRUPT 0
545#define RX_LEVEL_INTERRUPT 1
546
547#define RX_TIME_OUT ENABLE
548#define RX_ERROR_STATE_INT_ENB ENABLE
549#define LOOP_BACK DISABLE
550#define BREAK_SIGNAL DISABLE
551
552#define TX_MODE_DISABLED 0X00
553#define TX_MODE_IRQ_OR_POLL 0X01
554#define TX_MODE_DMA 0X02
555
556#define RX_MODE_DISABLED 0X00
557#define RX_MODE_IRQ_OR_POLL 0X01
558#define RX_MODE_DMA 0X02
559
560#define UCON_VAL ((TX_LEVEL_INTERRUPT << 9) \
561 | (RX_LEVEL_INTERRUPT << 8) \
562 | (RX_TIME_OUT << 7) \
563 | (RX_ERROR_STATE_INT_ENB << 6) \
564 | (LOOP_BACK << 5) \
565 | (BREAK_SIGNAL << 4) \
566 | (TX_MODE_IRQ_OR_POLL << 2) \
567 | (RX_MODE_IRQ_OR_POLL << 0))
568
569/*
570 * UFCON: UART FIFO Control Value
571 * Tx FIFO Trigger LEVEL: 2 Bytes (001)
572 * Rx FIFO Trigger LEVEL: 2 Bytes (001)
573 * Tx Fifo Reset: No
574 * Rx Fifo Reset: No
575 * FIFO Enable: Yes
576 */
577#define TX_FIFO_TRIGGER_LEVEL_0_BYTES 0x00
578#define TX_FIFO_TRIGGER_LEVEL_2_BYTES 0x1
579#define TX_FIFO_TRIGGER_LEVEL_4_BYTES 0x2
580#define TX_FIFO_TRIGGER_LEVEL_6_BYTES 0x3
581#define TX_FIFO_TRIGGER_LEVEL_8_BYTES 0x4
582#define TX_FIFO_TRIGGER_LEVEL_10_BYTES 0x5
583#define TX_FIFO_TRIGGER_LEVEL_12_BYTES 0x6
584#define TX_FIFO_TRIGGER_LEVEL_14_BYTES 0x7
585
586#define RX_FIFO_TRIGGER_LEVEL_2_BYTES 0x0
587#define RX_FIFO_TRIGGER_LEVEL_4_BYTES 0x1
588#define RX_FIFO_TRIGGER_LEVEL_6_BYTES 0x2
589#define RX_FIFO_TRIGGER_LEVEL_8_BYTES 0x3
590#define RX_FIFO_TRIGGER_LEVEL_10_BYTES 0x4
591#define RX_FIFO_TRIGGER_LEVEL_12_BYTES 0x5
592#define RX_FIFO_TRIGGER_LEVEL_14_BYTES 0x6
593#define RX_FIFO_TRIGGER_LEVEL_16_BYTES 0x7
594
595#define TX_FIFO_TRIGGER_LEVEL TX_FIFO_TRIGGER_LEVEL_2_BYTES
596#define RX_FIFO_TRIGGER_LEVEL RX_FIFO_TRIGGER_LEVEL_4_BYTES
597#define TX_FIFO_RESET DISABLE
598#define RX_FIFO_RESET DISABLE
599#define FIFO_ENABLE ENABLE
600#define UFCON_VAL ((TX_FIFO_TRIGGER_LEVEL << 8) \
601 | (RX_FIFO_TRIGGER_LEVEL << 4) \
602 | (TX_FIFO_RESET << 2) \
603 | (RX_FIFO_RESET << 1) \
604 | (FIFO_ENABLE << 0))
605/*
606 * Baud Rate Division Value
607 * 115200 BAUD:
608 * UBRDIV_VAL = SCLK_UART/((115200 * 16) - 1)
609 * UBRDIV_VAL = (800 MHz)/((115200 * 16) - 1)
610 */
611#define UBRDIV_VAL 0x35
612
613/*
614 * Fractional Part of Baud Rate Divisor:
615 * 115200 BAUD:
616 * UBRFRACVAL = ((((SCLK_UART*10/(115200*16) -10))%10)*16/10)
617 * UBRFRACVAL = ((((800MHz*10/(115200*16) -10))%10)*16/10)
618 */
619#define UFRACVAL_VAL 0x4
620
621/*
622 * TZPC Register Value :
623 * R0SIZE: 0x0 : Size of secured ram
624 */
625#define R0SIZE 0x0
626
627/*
628 * TZPC Decode Protection Register Value :
629 * DECPROTXSET: 0xFF : Set Decode region to non-secure
630 */
631#define DECPROTXSET 0xFF
632#endif