s5pc110: aquila: Fix s5pc110 handling at setup OneDRAM memory
[kernel/u-boot.git] / board / samsung / universal / lowlevel_init.S
1 /*
2  * Memory Setup stuff - taken from blob memsetup.S
3  *
4  * Copyright (C) 2009 Samsung Electronics
5  * Kyungmin Park <kyungmin.park@samsung.com>
6  *
7  * See file CREDITS for list of people who contributed to this
8  * project.
9  *
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.
14  *
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.
19  *
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,
23  * MA 02111-1307 USA
24  */
25
26 #include <config.h>
27 #include <version.h>
28 #include <asm/arch/cpu.h>
29 #include <asm/arch/clock.h>
30 #include <asm/arch/power.h>
31
32 #define DEBUG_PM_C110
33 #undef DEBUG_PM_C110
34
35 /*
36  * Register usages:
37  *
38  * r5 has zero always
39  * r7 has S5PC100 GPIO base, 0xE0300000
40  * r8 has real GPIO base, 0xE0300000, 0xE0200000 at S5PC100, S5PC110 repectively
41  * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on
42  */
43
44 _TEXT_BASE:
45         .word   TEXT_BASE
46
47         .globl lowlevel_init
48 lowlevel_init:
49         mov     r11, lr
50
51         /* r5 has always zero */
52         mov     r5, #0
53
54         ldr     r7, =S5PC100_GPIO_BASE
55         ldr     r8, =S5PC100_GPIO_BASE
56         /* Read CPU ID */
57         ldr     r2, =S5PC1XX_PRO_ID
58         ldr     r0, [r2]
59         mov     r1, #0x00010000
60         and     r0, r0, r1
61         cmp     r0, r5
62         beq     100f
63         ldr     r8, =S5PC110_GPIO_BASE
64 100:
65         /* Turn on KEY_LED_ON [GPJ4(1)] XMSMWEN */
66         cmp     r7, r8
67 #ifndef DEBUG_PM_C110
68         addeq   r0, r8, #0x280                          @S5PC100_GPIO_J4_OFFSET
69         addne   r0, r8, #0x2C0                          @S5PC110_GPIO_J4_OFFSET
70         ldr     r1, [r0, #0x0]                          @S5PC1XX_GPIO_CON_OFFSET
71         bic     r1, r1, #(0xf << 4)                     @ 1 * 4-bit
72         orr     r1, r1, #(0x1 << 4)
73         str     r1, [r0, #0x0]                          @S5PC1XX_GPIO_CON_OFFSET
74
75         ldr     r1, [r0, #0x4]                          @S5PC1XX_GPIO_DAT_OFFSET
76 #ifdef CONFIG_ONENAND_IPL
77         orr     r1, r1, #(1 << 1)                       @ 1 * 1-bit
78 #else
79         bic     r1, r1, #(1 << 1)
80 #endif
81         str     r1, [r0, #0x4]                          @S5PC1XX_GPIO_DAT_OFFSET
82 #endif
83
84         /* Don't setup at s5pc100 */
85         beq     100f
86
87         /*
88          * Initialize Async Register Setting for EVT1
89          * Because we are setting EVT1 as the default value of EVT0,
90          * setting EVT0 as well does not make things worse.
91          * Thus, for the simplicity, we set for EVT0, too
92          *
93          * The "Async Registers" are:
94          *      0xE0F0_0000
95          *      0xE1F0_0000
96          *      0xF180_0000
97          *      0xF190_0000
98          *      0xF1A0_0000
99          *      0xF1B0_0000
100          *      0xF1C0_0000
101          *      0xF1D0_0000
102          *      0xF1E0_0000
103          *      0xF1F0_0000
104          *      0xFAF0_0000
105          */
106         ldr     r0, =0xe0f00000
107         ldr     r1, [r0]
108         bic     r1, r1, #0x1
109         str     r1, [r0]
110
111         ldr     r0, =0xe1f00000
112         ldr     r1, [r0]
113         bic     r1, r1, #0x1
114         str     r1, [r0]
115
116         ldr     r0, =0xf1800000
117         ldr     r1, [r0]
118         bic     r1, r1, #0x1
119         str     r1, [r0]
120
121         ldr     r0, =0xf1900000
122         ldr     r1, [r0]
123         bic     r1, r1, #0x1
124         str     r1, [r0]
125
126         ldr     r0, =0xf1a00000
127         ldr     r1, [r0]
128         bic     r1, r1, #0x1
129         str     r1, [r0]
130
131         ldr     r0, =0xf1b00000
132         ldr     r1, [r0]
133         bic     r1, r1, #0x1
134         str     r1, [r0]
135
136         ldr     r0, =0xf1c00000
137         ldr     r1, [r0]
138         bic     r1, r1, #0x1
139         str     r1, [r0]
140
141         ldr     r0, =0xf1d00000
142         ldr     r1, [r0]
143         bic     r1, r1, #0x1
144         str     r1, [r0]
145
146         ldr     r0, =0xf1e00000
147         ldr     r1, [r0]
148         bic     r1, r1, #0x1
149         str     r1, [r0]
150
151         ldr     r0, =0xf1f00000
152         ldr     r1, [r0]
153         bic     r1, r1, #0x1
154         str     r1, [r0]
155
156         ldr     r0, =0xfaf00000
157         ldr     r1, [r0]
158         bic     r1, r1, #0x1
159         str     r1, [r0]
160
161 100:
162         /* IO retension release */
163         ldreq   r0, =S5PC100_OTHERS                     @0xE0108200
164         ldrne   r0, =S5PC110_OTHERS                     @0xE010E000
165         ldr     r1, [r0]
166         ldreq   r2, =(1 << 31)                          @IO_RET_REL
167         ldrne   r2, =((1 << 31) | (1 << 30) | (1 << 29) | (1 << 28))    @ GPIO, UART_IO
168         orr     r1, r1, r2
169         str     r1, [r0]
170
171 #ifndef CONFIG_ONENAND_IPL
172         /* Disable Watchdog */
173         ldreq   r0, =S5PC100_WATCHDOG_BASE              @0xEA200000
174         ldrne   r0, =S5PC110_WATCHDOG_BASE              @0xE2700000
175         str     r5, [r0]
176
177         /* setting SRAM */
178         ldreq   r0, =S5PC100_SROMC_BASE
179         ldrne   r0, =S5PC110_SROMC_BASE
180         ldr     r1, =0x9
181         str     r1, [r0]
182 #endif
183
184         /* S5PC100 has 3 groups of interrupt sources */
185         ldreq   r0, =S5PC100_VIC0_BASE                  @0xE4000000
186         ldrne   r0, =S5PC110_VIC0_BASE                  @0xF2000000
187         add     r1, r0, #0x00100000
188         add     r2, r0, #0x00200000
189
190         /* Disable all interrupts (VIC0, VIC1 and VIC2) */
191         mvn     r3, #0x0
192         str     r3, [r0, #0x14]                         @INTENCLEAR
193         str     r3, [r1, #0x14]                         @INTENCLEAR
194         str     r3, [r2, #0x14]                         @INTENCLEAR
195
196 #ifndef CONFIG_ONENAND_IPL
197         /* Set all interrupts as IRQ */
198         str     r5, [r0, #0xc]                          @INTSELECT
199         str     r5, [r1, #0xc]                          @INTSELECT
200         str     r5, [r2, #0xc]                          @INTSELECT
201
202         /* Pending Interrupt Clear */
203         str     r5, [r0, #0xf00]                        @INTADDRESS
204         str     r5, [r1, #0xf00]                        @INTADDRESS
205         str     r5, [r2, #0xf00]                        @INTADDRESS
206 #endif
207
208 #ifndef CONFIG_ONENAND_IPL
209         /* for UART */
210         bl      uart_asm_init
211
212         bl      internal_ram_init
213 #endif
214
215 #ifdef CONFIG_ONENAND_IPL
216         /* init system clock */
217         bl      system_clock_init
218
219         /* Board detection to set proper memory configuration */
220         cmp     r7, r8
221         moveq   r9, #1          /* r9 has 1Gib default at s5pc100 */
222         movne   r9, #2          /* r9 has 2Gib default at s5pc110 */
223         /* FIXME 1Gib detection: Limo Universal */
224         /* Check Limo Real board
225          *      LR (suspend)    LU              J1B2
226          * 0x04 0x01 (0x01)     0x01 (0x01)     0x01 (0x01)
227          * 0x24 0x28 (0xA8)     0x28 (0x6A)     0x1C (0x1C)
228          * 0x44 0x00 (0xC7)     0x00 (0x47)     0x00 (0x47)
229          * 0x64 0x03 (0x1F)     0x07 (0x1F)     0x0f (0x0F)
230          *
231          * Check (0 << 3) at 0x64 at boot
232          * Check 0x47 at 0x44 at suspend
233          */
234         ldrne   r2, =0xE0200C00
235         ldrne   r1, [r2, #0x64]
236         and     r1, r1, #(1 << 2)
237         cmp     r1, #(1 << 2)
238         moveq   r9, #1
239         ldr     r1, [r2, #0x44]
240         cmp     r1, #0x47
241         moveq   r9, #1
242         /*
243          * Aquila Rev 0.5 : 4G3G1G x16 for Infineon ES3.1
244          * Aquila Rev 0.6 : 4G1G1G x32 for MSM6290
245          * Aquila Rev 0.7 : 4G2G1G x16 for Infineon ES3.1
246          * Aquila Rev 0.8 : 4G3G1G x16 for Infineon ES3.1
247          */
248         ldr     r2, =0xE0200200
249         ldr     r4, [r2, #0x48]
250         bic     r1, r4, #(0xFF << 2)    /* PULLUP_DISABLE: 4 * 2-bit */
251         str     r1, [r2, #0x48]
252         /* For write completion */
253         nop
254         nop
255
256         ldr     r3, [r2, #0x44]
257         and     r1, r3, #(0xf << 1)
258         cmp     r1, #(0x5 << 2)
259         moveq   r9, #3
260         cmp     r1, #(0x6 << 2)
261         moveq   r9, #1
262         cmp     r1, #(0x7 << 2)
263         moveq   r9, #2
264         cmp     r1, #(0x1 << 1)
265         moveq   r9, #3
266         str     r4, [r2, #0x48]         /* Restore PULLUP configuration */
267
268         bl      mem_ctrl_asm_init
269
270         /* OneNAND Sync Read Support at S5PC110 only
271          * RM[15]       : Sync Read
272          * BRWL[14:12]  : 7 CLK
273          * BL[11:9]     : Continuous
274          * VHF[3]       : Very High Frequency Enable (Over 83MHz)
275          * HF[2]        : High Frequency Enable (Over 66MHz)
276          */
277         cmp     r7, r8
278         ldrne   r1, =0xE00C
279
280         ldrne   r0, =0xB001E442
281         strneh  r1, [r0]
282
283         ldrne   r0, =0xB0600000
284         strne   r1, [r0, #0x100]                        @ ONENAND_IF_CTRL
285
286         /* Wakeup support. Don't know if it's going to be used, untested. */
287         ldreq   r0, =S5PC100_RST_STAT
288         ldrne   r0, =S5PC110_RST_STAT
289         ldr     r1, [r0]
290         biceq   r1, r1, #0xfffffff7
291         moveq   r2, #(1 << 3)
292         bicne   r1, r1, #0xfffeffff
293         movne   r2, #(1 << 16)
294         cmp     r1, r2
295         bne     1f
296 wakeup:
297 #ifdef DEBUG_PM_C110
298         mov     r0, r8
299         ldr     r1, =0x22222222
300         str     r1, [r0, #0x0]                  @S5PC100_GPIO_A0_OFFSET
301         ldr     r1, =0x00002222
302         str     r1, [r0, #0x20]                 @S5PC100_GPIO_A1_OFFSET
303
304         /* UART_SEL MP0_5[7] at S5PC110 */
305         add     r0, r8, #0x360                  @S5PC110_GPIO_MP0_5_OFFSET
306         ldr     r1, [r0, #0x0]                  @S5PC1XX_GPIO_CON_OFFSET
307         bic     r1, r1, #(0xf << 28)            @ 28 = 7 * 4-bit
308         orr     r1, r1, #(0x1 << 28)            @ Output
309         str     r1, [r0, #0x0]                  @S5PC1XX_GPIO_CON_OFFSET
310
311         ldr     r1, [r0, #0x8]                  @S5PC1XX_GPIO_PULL_OFFSET
312         bic     r1, r1, #(0x3 << 14)            @ 14 = 7 * 2-bit
313         orr     r1, r1, #(0x2 << 14)            @ Pull-up enabled
314         str     r1, [r0, #0x8]                  @S5PC1XX_GPIO_PULL_OFFSET
315
316         ldr     r1, [r0, #0x4]                  @S5PC1XX_GPIO_DAT_OFFSET
317         orr     r1, r1, #(1 << 7)               @ 7 = 7 * 1-bit
318         str     r1, [r0, #0x4]                  @S5PC1XX_GPIO_DAT_OFFSET
319
320         ldr     r0, =0xE2900000                 @ S5PC110_PA_UART
321         orr     r0, r0, #0x800
322         mov     r1, #0x3
323         str     r1, [r0, #0x000]                @ ULCON
324         ldr     r1, =0x245
325         str     r1, [r0, #0x004]                @ UCON
326         mov     r1, #0x23
327         str     r1, [r0, #0x028]                @ UBRDIV
328         mov     r1, #0x3
329         str     r1, [r0, #0x02C]                @ UDIVSLOT
330
331         mov     r2, #'W'
332         strb    r2, [r0, #0x020]                @ UTXH
333 1001:
334         ldrb    r3, [r0, #0x010]                @ UTRSTAT
335         tst     r3, #(1 << 2)
336         beq     1001b
337 #endif
338
339         /* turn off L2 cache */
340         bl      l2_cache_disable
341
342         cmp     r7, r8
343         ldreq   r0, =0xC100
344         ldrne   r0, =0xC110
345
346         /* invalidate L2 cache also */
347         bl      invalidate_dcache
348
349         /* turn on L2 cache */
350         bl      l2_cache_enable
351
352         cmp     r7, r8
353         /* Load return address and jump to kernel */
354         ldreq   r0, =S5PC100_INFORM0
355         ldrne   r0, =S5PC110_INFORM0
356
357         /* r1 = physical address of s5pc1xx_cpu_resume function */
358         ldr     r1, [r0]
359
360         /* Jump to kernel (sleep-s5pc1xx.S) */
361         mov     pc, r1
362         nop
363         nop
364 #else
365         cmp     r7, r8
366         /* Clear wakeup status register */
367         ldreq   r0, =S5PC100_WAKEUP_STAT
368         ldrne   r0, =S5PC110_WAKEUP_STAT
369         ldr     r1, [r0]
370         str     r1, [r0]
371 #endif
372 1:
373         mov     lr, r11
374         mov     pc, lr
375
376 /*
377  * system_clock_init: Initialize core clock and bus clock.
378  * void system_clock_init(void)
379  */
380 system_clock_init:
381         ldr     r0, =S5PC1XX_CLOCK_BASE         @ 0xE0100000
382
383         /* Check S5PC100 */
384         cmp     r7, r8
385         bne     110f
386 100:
387 #ifndef DEBUG_PM_C110
388         /* Set Lock Time */
389         ldr     r1, =0xe10                      @ Locktime : 0xe10 = 3600
390         str     r1, [r0, #0x000]                @ S5PC100_APLL_LOCK
391         str     r1, [r0, #0x004]                @ S5PC100_MPLL_LOCK
392         str     r1, [r0, #0x008]                @ S5PC100_EPLL_LOCK
393         str     r1, [r0, #0x00C]                @ S5PC100_HPLL_LOCK
394
395         /* S5P_APLL_CON */
396 #ifdef CONFIG_CLK_667_166_83
397         ldr     r1, =0x81bc0400         @ SDIV 0, PDIV 4, MDIV 444 (1333MHz)
398 #elif defined(CONFIG_CLK_666_166_66)
399         ldr     r1, =0x814d0301         @ SDIV 1, PDIV 3, MDIV 333 (1333MHz)
400 #elif defined(CONFIG_CLK_600_150_75)
401         ldr     r1, =0x812C0300         @ SDIV 0, PDIV 3, MDIV 300 (1200MHz)
402 #elif defined(CONFIG_CLK_533_133_66)
403         ldr     r1, =0x810b0300         @ SDIV 0, PDIV 3, MDIV 267 (1066MHz)
404 #elif defined(CONFIG_CLK_500_166_66)
405         ldr     r1, =0x81f40301         @ SDIV 1, PDIV 3, MDIV 500 (1000MHz)
406 #elif defined(CONFIG_CLK_467_117_59)
407         ldr     r1, =0x826E0401         @ SDIV 1, PDIV 4, MDIV 622 (933MHz)
408 #elif defined(CONFIG_CLK_400_100_50)
409         ldr     r1, =0x81900301         @ SDIV 1, PDIV 3, MDIV 400 (800MHz)
410 #else
411 #error you should set the correct clock configuration
412 #endif
413         str     r1, [r0, #0x100]
414         /* S5P_MPLL_CON */
415         ldr     r1, =0x80590201         @ SDIV 1, PDIV 2, MDIV 89 (267MHz)
416         str     r1, [r0, #0x104]
417         /* S5P_EPLL_CON */
418         ldr     r1, =0x80870303         @ SDIV 3, PDIV 3, MDIV 135 (67.5MHz)
419         str     r1, [r0, #0x108]
420         /* S5P_HPLL_CON */
421         ldr     r1, =0x80600603         @ SDIV 3, PDIV 6, MDIV 96
422         str     r1, [r0, #0x10C]
423
424         ldr     r1, [r0, #0x300]
425         ldr     r2, =0x00003fff
426         bic     r1, r1, r2
427 #ifdef CONFIG_CLK_800_166_66
428         ldr     r2, =0x00011401
429 #elif defined(CONFIG_CLK_500_166_66)
430         ldr     r2, =0x00011201
431 #elif defined(CONFIG_CLK_666_166_66)
432         ldr     r2, =0x00011300
433 #else
434         ldr     r2, =0x00011301
435 #endif
436         orr     r1, r1, r2
437         str     r1, [r0, #0x300]
438         ldr     r1, [r0, #0x304]
439         ldr     r2, =0x00011110
440         orr     r1, r1, r2
441         str     r1, [r0, #0x304]
442         ldr     r1, =0x00000001
443         str     r1, [r0, #0x308]
444
445         /* Set Source Clock */
446         ldr     r1, =0x00001111                 @ A, M, E, HPLL Muxing
447         str     r1, [r0, #0x200]                @ S5PC1XX_CLK_SRC0
448 #endif
449         b       200f
450 110:
451         /* Set Clock divider */
452         ldr     r1, =0x14131330                 @ 1:1:4:4, 1:4:5
453         str     r1, [r0, #0x300]
454         ldr     r1, =0x11110111                 @ UART[3210]: MMC[3210]
455         str     r1, [r0, #0x310]
456
457         /* Set Lock Time */
458         ldr     r1, =0xe10                      @ Locktime : 0xe10 = 3600
459         str     r1, [r0, #0x000]                @ S5PC110_APLL_LOCK
460         str     r1, [r0, #0x008]                @ S5PC110_MPLL_LOCK
461         str     r1, [r0, #0x010]                @ S5PC110_EPLL_LOCK
462         str     r1, [r0, #0x020]                @ S5PC110_VPLL_LOCK
463
464         /* S5PC110_APLL_CON */
465         ldr     r1, =0x80C80601                 @ 800MHz
466         str     r1, [r0, #0x100]
467         /* S5PC110_MPLL_CON */
468         ldr     r1, =0x829B0C01                 @ 667MHz
469         str     r1, [r0, #0x108]
470         /* S5PC110_EPLL_CON */
471         ldr     r1, =0x80600602                 @  96MHz VSEL 0 P 6 M 96 S 2
472         str     r1, [r0, #0x110]
473         /* S5PC110_VPLL_CON */
474         ldr     r1, =0x806C0603                 @  54MHz
475         str     r1, [r0, #0x120]
476
477         /* Set Source Clock */
478         ldr     r1, =0x10001111                 @ A, M, E, VPLL Muxing
479         str     r1, [r0, #0x200]                @ S5PC1XX_CLK_SRC0
480
481         /* OneDRAM(DMC0) clock setting */
482         ldr     r1, =0x01000000                 @ ONEDRAM_SEL[25:24] 1 SCLKMPLL
483         str     r1, [r0, #0x218]                @ S5PC110_CLK_SRC6
484         ldr     r1, =0x30000000                 @ ONEDRAM_RATIO[31:28] 3 + 1
485         str     r1, [r0, #0x318]                @ S5PC110_CLK_DIV6
486
487         /* XCLKOUT = XUSBXTI 24MHz */
488         add     r2, r0, #0xE000                 @ S5PC110_OTHERS
489         ldr     r1, [r2]
490         orr     r1, r1, #(0x3 << 8)             @ CLKOUT[9:8] 3 XUSBXTI
491         str     r1, [r2]
492
493         /* CLK_IP0 */
494         ldr     r1, =0x8fefeeb                  @ DMC[1:0] PDMA0[3] IMEM[5]
495         str     r1, [r0, #0x460]                @ S5PC110_CLK_IP0
496
497         /* CLK_IP1 */
498         ldr     r1, =0xe9fdf0f9                 @ FIMD[0] USBOTG[16]
499                                                 @ NANDXL[24]
500         str     r1, [r0, #0x464]                @ S5PC110_CLK_IP1
501
502         /* CLK_IP2 */
503         ldr     r1, =0xf75f7fc                  @ CORESIGHT[8] MODEM[9]
504                                                 @ HOSTIF[10] HSMMC0[16]
505                                                 @ HSMMC2[18] VIC[27:24]
506         str     r1, [r0, #0x468]                @ S5PC110_CLK_IP2
507
508         /* CLK_IP3 */
509         ldr     r1, =0x8eff038c                 @ I2C[8:6]
510                                                 @ SYSTIMER[16] UART0[17]
511                                                 @ UART1[18] UART2[19]
512                                                 @ UART3[20] WDT[22]
513                                                 @ PWM[23] GPIO[26] SYSCON[27]
514         str     r1, [r0, #0x46c]                @ S5PC110_CLK_IP3
515
516         /* CLK_IP4 */
517         ldr     r1, =0xfffffff1                 @ CHIP_ID[0] TZPC[8:5]
518         str     r1, [r0, #0x470]                @ S5PC110_CLK_IP3
519
520 200:
521         /* wait at least 200us to stablize all clock */
522         mov     r2, #0x10000
523 1:      subs    r2, r2, #1
524         bne     1b
525
526         mov     pc, lr
527
528 #ifndef CONFIG_ONENAND_IPL
529 internal_ram_init:
530         ldreq   r0, =0xE3800000
531         ldrne   r0, =0xF1500000
532         ldr     r1, =0x0
533         str     r1, [r0]
534
535         mov     pc, lr
536 #endif
537
538 #ifndef CONFIG_ONENAND_IPL
539 /*
540  * uart_asm_init: Initialize UART's pins
541  */
542 uart_asm_init:
543         /* set GPIO to enable UART0-UART4 */
544         mov     r0, r8
545         ldr     r1, =0x22222222
546         str     r1, [r0, #0x0]                  @S5PC100_GPIO_A0_OFFSET
547         ldr     r1, =0x00002222
548         str     r1, [r0, #0x20]                 @S5PC100_GPIO_A1_OFFSET
549
550         /* Check S5PC100 */
551         cmp     r7, r8
552         bne     110f
553
554 #ifndef DEBUG_PM_C110
555         /* UART_SEL GPK0[5] at S5PC100 */
556         add     r0, r8, #0x2A0                  @S5PC100_GPIO_K0_OFFSET
557         ldr     r1, [r0, #0x0]                  @S5PC1XX_GPIO_CON_OFFSET
558         bic     r1, r1, #(0xf << 20)            @ 20 = 5 * 4-bit
559         orr     r1, r1, #(0x1 << 20)            @ Output
560         str     r1, [r0, #0x0]                  @S5PC1XX_GPIO_CON_OFFSET
561
562         ldr     r1, [r0, #0x8]                  @S5PC1XX_GPIO_PULL_OFFSET
563         bic     r1, r1, #(0x3 << 10)            @ 10 = 5 * 2-bit
564         orr     r1, r1, #(0x2 << 10)            @ Pull-up enabled
565         str     r1, [r0, #0x8]                  @S5PC1XX_GPIO_PULL_OFFSET
566
567         ldr     r1, [r0, #0x4]                  @S5PC1XX_GPIO_DAT_OFFSET
568         orr     r1, r1, #(1 << 5)               @ 5 = 5 * 1-bit
569         str     r1, [r0, #0x4]                  @S5PC1XX_GPIO_DAT_OFFSET
570 #endif
571         b       200f
572 110:
573         /*
574          * Note that the following address
575          * 0xE020'0360 is reserved address at S5PC100
576          */
577         /* UART_SEL MP0_5[7] at S5PC110 */
578         add     r0, r8, #0x360                  @S5PC110_GPIO_MP0_5_OFFSET
579         ldr     r1, [r0, #0x0]                  @S5PC1XX_GPIO_CON_OFFSET
580         bic     r1, r1, #(0xf << 28)            @ 28 = 7 * 4-bit
581         orr     r1, r1, #(0x1 << 28)            @ Output
582         str     r1, [r0, #0x0]                  @S5PC1XX_GPIO_CON_OFFSET
583
584         ldr     r1, [r0, #0x8]                  @S5PC1XX_GPIO_PULL_OFFSET
585         bic     r1, r1, #(0x3 << 14)            @ 14 = 7 * 2-bit
586         orr     r1, r1, #(0x2 << 14)            @ Pull-up enabled
587         str     r1, [r0, #0x8]                  @S5PC1XX_GPIO_PULL_OFFSET
588
589         ldr     r1, [r0, #0x4]                  @S5PC1XX_GPIO_DAT_OFFSET
590         orr     r1, r1, #(1 << 7)               @ 7 = 7 * 1-bit
591         str     r1, [r0, #0x4]                  @S5PC1XX_GPIO_DAT_OFFSET
592 200:
593         mov     pc, lr
594 #endif