2 * Lowlevel setup for universal board based on EXYNOS4210
4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5 * Kyungmin Park <kyungmin.park@samsung.com>
7 * See file CREDITS for list of people who contributed to this
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.
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.
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,
28 #include <asm/arch/cpu.h>
29 #include <asm/arch/clock.h>
30 #include <asm/arch/power.h>
36 * r7 has GPIO part1 base 0x11400000
37 * r6 has GPIO part2 base 0x11000000
44 /* r5 has always zero */
47 ldr r7, =EXYNOS4_GPIO_PART1_BASE
48 ldr r6, =EXYNOS4_GPIO_PART2_BASE
51 ldr r0, =EXYNOS4_MCT_BASE
55 /* Workaround: PMIC manual reset */
56 /* nPOWER: XEINT_23: GPX2[7] */
57 add r0, r6, #0xC40 @ EXYNOS4_GPIO_X2_OFFSET
59 bic r1, r1, #(0xf << 28) @ 28 = 7 * 4-bit
60 orr r1, r1, #(0x1 << 28) @ Output
64 orr r1, r1, #(1 << 7) @ 7 = 7 * 1-bit
67 /* init system clock */
70 /* Disable Watchdog */
71 ldr r0, =EXYNOS4_WDT_BASE
83 /* Enable NEON. Don't change the register r0 */
85 mcr p15, 0, r0, c1, c0, 2
87 .word 0xeee80a10 /* VMSR_FPSCR_r0 */
88 .word 0xeef80a10 /* VMRS_r0_FPSCR */
98 * uart_asm_init: Initialize UART's pins
102 * setup UART0-UART4 GPIOs (part1)
103 * GPA1CON[3] = I2C_3_SCL (3)
104 * GPA1CON[2] = I2C_3_SDA (3)
108 str r1, [r0, #0x00] @ EXYNOS4_GPIO_A0_OFFSET
110 str r1, [r0, #0x20] @ EXYNOS4_GPIO_A1_OFFSET
112 /* UART_SEL GPY4[7] (part2) at EXYNOS4210 */
113 add r0, r6, #0x1A0 @ EXYNOS4_GPIO_Y4_OFFSET
115 bic r1, r1, #(0xf << 28) @ 28 = 7 * 4-bit
116 orr r1, r1, #(0x1 << 28)
120 bic r1, r1, #(0x3 << 14) @ 14 = 7 * 2-bit
121 orr r1, r1, #(0x3 << 14) @ Pull-up enabled
125 orr r1, r1, #(1 << 7) @ 7 = 7 * 1-bit
129 ldr r0, =0x13800000 @ EXYNOS4_PA_UART
130 orr r0, r0, #0x20000 @ UART2
132 str r1, [r0, #0x000] @ ULCON
134 str r1, [r0, #0x004] @ UCON
136 str r1, [r0, #0x028] @ UBRDIV
138 str r1, [r0, #0x02C] @ UFRACVAL
141 strb r2, [r0, #0x020] @ UTXH
143 ldrb r3, [r0, #0x010] @ UTRSTAT
154 ldr r0, =EXYNOS4_CLOCK_BASE
156 /* APLL(1), MPLL(1), CORE(0), HPM(0) */
158 ldr r2, =0x14200 @ CLK_SRC_CPU
168 * MUX_ONENAND_SEL[28] 0: DOUT133, 1: DOUT166
169 * MUX_VPLL_SEL[8] 0: FINPLL, 1: FOUTVPLL
170 * MUX_EPLL_SEL[4] 0: FINPLL, 1: FOUTEPLL
173 ldr r2, =0x0C210 @ CLK_SRC_TOP
176 /* SATA: SCLKMPLL(0), MMC[0:4]: SCLKMPLL(6) */
178 ldr r2, =0x0C240 @ CLK_SRC_FSYS
180 /* UART[0:5], PWM: SCLKMPLL(6) */
182 ldr r2, =0x0C250 @ CLK_SRC_PERIL0_OFFSET
185 /* CPU0: CORE, COREM0, COREM1, PERI, ATB, PCLK_DBG, APLL */
187 ldr r2, =0x14500 @ CLK_DIV_CPU0
189 /* CPU1: COPY, HPM */
191 ldr r2, =0x14504 @ CLK_DIV_CPU1
193 /* DMC0: ACP, ACP_PCLK, DPHY, DMC, DMCD, DMCP, COPY2 CORE_TIMER */
195 ldr r2, =0x10500 @ CLK_DIV_DMC0
197 /* DMC1: PWI, DVSEM, DPM */
199 ldr r2, =0x10504 @ CLK_DIV_DMC1
201 /* LEFTBUS: GDL, GPL */
203 ldr r2, =0x04500 @ CLK_DIV_LEFTBUS
205 /* RIGHHTBUS: GDR, GPR */
207 ldr r2, =0x08500 @ CLK_DIV_RIGHTBUS
211 * ONENAND_RATIOD[18:16]: 0 SCLK_ONENAND = MOUTONENAND / (n + 1)
212 * ACLK_200, ACLK_100, ACLK_160, ACLK_133,
215 ldr r2, =0x0C510 @ CLK_DIV_TOP
218 ldr r1, =0x000f000f /* 800(MPLL) / (15 + 1) */
219 ldr r2, =0x0C544 @ CLK_DIV_FSYS1
222 ldr r1, =0x000f000f /* 800(MPLL) / (15 + 1) */
223 ldr r2, =0x0C548 @ CLK_DIV_FSYS2
226 ldr r1, =0x0003 /* 800(MPLL) / (3 + 1) */
227 ldr r2, =0x0C54C @ CLK_DIV_FSYS3
231 ldr r2, =0x0C550 @ CLK_DIV_PERIL0
233 /* SLIMBUS: ???, PWM */
235 ldr r2, =0x0C55C @ CLK_DIV_PERIL3
240 ldr r2, =0x14000 @ APLL_LOCK
242 ldr r2, =0x14008 @ MPLL_LOCK
244 ldr r2, =0x0C010 @ EPLL_LOCK
246 ldr r2, =0x0C020 @ VPLL_LOCK
251 ldr r2, =0x14104 @ APLL_CON1
253 ldr r1, =0x80c80601 @ 800MHz
254 ldr r2, =0x14100 @ APLL_CON0
258 ldr r2, =0x1410C @ MPLL_CON1
260 ldr r1, =0x80c80601 @ 800MHz
261 ldr r2, =0x14108 @ MPLL_CON0
265 ldr r2, =0x0C114 @ EPLL_CON1
267 ldr r1, =0x80300302 @ 96MHz
268 ldr r2, =0x0C110 @ EPLL_CON0
272 ldr r2, =0x0C124 @ VPLL_CON1
274 ldr r1, =0x80350302 @ 108MHz
275 ldr r2, =0x0C120 @ VPLL_CON0
280 * SMMUJPEG[11], JPEG[6], CSIS1[5] : 0111 1001
284 ldr r2, =0x0C920 @ CLK_GATE_IP_CAM
289 ldr r2, =0x0C924 @ CLK_GATE_IP_VP
294 ldr r2, =0x0C928 @ CLK_GATE_IP_MFC
299 ldr r2, =0x0C92C @ CLK_GATE_IP_G3D
304 ldr r2, =0x0C930 @ CLK_GATE_IP_IMAGE
307 /* DSIM0[3], MDNIE0[2], MIE0[1] : 0001 */
309 ldr r2, =0x0C934 @ CLK_GATE_IP_LCD0
314 ldr r2, =0x0C938 @ CLK_GATE_IP_LCD1
318 * SMMUPCIE[18], NFCON[16] : 1111 1010
319 * ONENAND[15], PCIE[14], SATA[10], SDMMC43[9:8]: 0011 1000
320 * SDMMC1[6], TSI[4], SATAPHY[3], PCIEPHY[2] : 1010 0011
323 ldr r2, =0x0C940 @ CLK_GATE_IP_FSYS
328 ldr r2, =0x0C94C @ CLK_GATE_IP_GPS
332 * AC97[27], SPDIF[26], SLIMBUS[25] : 1111 0001
333 * I2C2[8] : 1111 1110
336 ldr r2, =0x0C950 @ CLK_GATE_IP_PERIL
340 * KEYIF[16] : 1111 1110
343 ldr r2, =0x0C960 @ CLK_GATE_IP_PERIR
346 /* GPS[7], LCD1[5], G3D[3], MFC[2], TV[1] : 0101 0001 */
348 ldr r2, =0x0C970 @ CLK_GATE_BLOCK
357 ldr r0, =EXYNOS4_POWER_BASE @ 0x10020000
359 ldr r2, =0x330C @ PS_HOLD_CONTROL
361 orr r1, r1, #(0x3 << 8) @ Data High, Output En
366 @str r5, [r2, #0xC00] @ CAM_CONFIGURATION
367 str r5, [r2, #0xC20] @ TV_CONFIGURATION
368 str r5, [r2, #0xC40] @ MFC_CONFIGURATION
369 str r5, [r2, #0xC60] @ G3D_CONFIGURATION
370 str r5, [r2, #0xCA0] @ LCD1_CONFIGURATION
371 /* FIXME Don't turn off MAUDIO why??? */
372 @str r5, [r2, #0xCC0] @ MAUDIO_CONFIGURATION
373 str r5, [r2, #0xCE0] @ GPS_CONFIGURATION
374 str r5, [r2, #0xD00] @ GPS_ALIVE_CONFIGURATION
386 str r1, [r0, #0x0804]
387 str r1, [r0, #0x0810]
388 str r1, [r0, #0x081C]
389 str r1, [r0, #0x0828]
392 str r1, [r0, #0x0804]
393 str r1, [r0, #0x0810]
394 str r1, [r0, #0x081C]
395 str r1, [r0, #0x0828]
398 str r1, [r0, #0x0804]
399 str r1, [r0, #0x0810]
400 str r1, [r0, #0x081C]
401 str r1, [r0, #0x0828]
404 str r1, [r0, #0x0804]
405 str r1, [r0, #0x0810]
406 str r1, [r0, #0x081C]
407 str r1, [r0, #0x0828]
410 str r1, [r0, #0x0804]
411 str r1, [r0, #0x0810]
412 str r1, [r0, #0x081C]
413 str r1, [r0, #0x0828]