2 * Copyright (C) 2009 Samsung Electronics
3 * Kyungmin Park <kyungmin.park@samsung.com>
4 * Minkyu Kang <mk7.kang@samsung.com>
6 * See file CREDITS for list of people who contributed to this
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.
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.
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,
27 #include <asm/arch/cpu.h>
28 #include <asm/arch/power.h>
43 /* r5 has always zero */
46 ldr r8, =S5P6442_GPIO_BASE @0xE0200000
48 /* IO retension release */
49 ldr r0, =S5P6442_OTHERS @0xE010E000
51 ldr r2, =(1 << 31) @IO_RET_REL
55 #ifndef CONFIG_PRELOADER
56 /* Disable Watchdog */
57 ldr r0, =S5P6442_WATCHDOG_BASE @0xEA200000
62 ldr r0, =S5P6442_SROMC_BASE @0xE7000000
67 /* S5P6442 has 3 groups of interrupt sources */
68 ldr r0, =S5P6442_VIC0_BASE @0xE4000000
69 add r1, r0, #0x00100000
70 add r2, r0, #0x00200000
72 /* Disable all interrupts (VIC0, VIC1 and VIC2) */
74 str r3, [r0, #0x14] @INTENCLEAR
75 str r3, [r1, #0x14] @INTENCLEAR
76 str r3, [r2, #0x14] @INTENCLEAR
78 #ifndef CONFIG_PRELOADER
79 /* Set all interrupts as IRQ */
80 str r5, [r0, #0xc] @INTSELECT
81 str r5, [r1, #0xc] @INTSELECT
82 str r5, [r2, #0xc] @INTSELECT
84 /* Pending Interrupt Clear */
85 str r5, [r0, #0xf00] @INTADDRESS
86 str r5, [r1, #0xf00] @INTADDRESS
87 str r5, [r2, #0xf00] @INTADDRESS
90 #ifndef CONFIG_PRELOADER
95 #ifdef CONFIG_PRELOADER
96 /* init system clock */
101 /* OneNAND Sync Read Support at S5PC110 only
103 * BRWL[14:12] : 7 CLK
104 * BL[11:9] : Continuous
105 * VHF[3] : Very High Frequency Enable (Over 83MHz)
106 * HF[2] : High Frequency Enable (Over 66MHz)
114 str r1, [r0, #0x100] @ ONENAND_IF_CTRL
116 /* Wakeup support. Don't know if it's going to be used, untested. */
117 ldr r0, =S5P6442_RST_STAT
119 bic r1, r1, #0xfffffff7
128 #ifdef CONFIG_PRELOADER
131 /* Clear wakeup status register */
132 ldr r0, =S5P6442_WAKEUP_STAT
136 /* Load return address and jump to kernel */
137 ldr r0, =S5P6442_INFORM0
139 /* r1 = physical address of s5p6442_cpu_resume function */
142 /* Jump to kernel (sleep.S) */
149 * system_clock_init: Initialize core clock and bus clock.
150 * void system_clock_init(void)
153 ldr r8, =S5P64XX_CLOCK_BASE @ 0xE0100000
156 ldr r1, =0xe10 @ Locktime : 0xe10 = 3600
157 str r1, [r8, #0x000] @ APLL_LOCK
158 str r1, [r8, #0x008] @ MPLL_LOCK
159 str r1, [r8, #0x010] @ EPLL_LOCK
160 str r1, [r8, #0x020] @ VPLL_LOCK
163 ldr r1, =0x829b0c01 @ SDIV 1, PDIV 0xc, MDIV 0x29b
166 ldr r1, =0x810a0303 @ SDIV 3, PDIV 3, MDIV 0x10a
169 ldr r1, =0x80600303 @ SDIV 3, PDIV 3, MDIV 0x60
172 ldr r1, =0x806c0303 @ SDIV 3, PDIV 3, MDIV 0x6c
175 /* Set Source Clock */
176 ldr r1, =0x1111 @ A, M, E, VPLL Muxing
177 str r1, [r8, #0x200] @ CLK_SRC0
179 /* Set Clock divider */
183 /* wait at least 200us to stablize all clock */
190 #ifndef CONFIG_PRELOADER
192 * uart_asm_init: Initialize UART's pins
197 str r1, [r0, #0x0] @ GPA0_CON
199 str r1, [r0, #0x20] @ GPA1_CON