Merge branch 'next-gpio-update' into for-next
[pandora-kernel.git] / arch / arm / mach-s5pv310 / mach-smdkv310.c
1 /* linux/arch/arm/mach-s5pv310/mach-smdkv310.c
2  *
3  * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4  *              http://www.samsung.com/
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9 */
10
11 #include <linux/serial_core.h>
12
13 #include <asm/mach/arch.h>
14 #include <asm/mach-types.h>
15 #include <asm/hardware/cache-l2x0.h>
16
17 #include <plat/regs-serial.h>
18 #include <plat/s5pv310.h>
19 #include <plat/cpu.h>
20 #include <plat/devs.h>
21
22 #include <mach/map.h>
23
24 /* Following are default values for UCON, ULCON and UFCON UART registers */
25 #define SMDKV310_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |        \
26                                  S3C2410_UCON_RXILEVEL |        \
27                                  S3C2410_UCON_TXIRQMODE |       \
28                                  S3C2410_UCON_RXIRQMODE |       \
29                                  S3C2410_UCON_RXFIFO_TOI |      \
30                                  S3C2443_UCON_RXERR_IRQEN)
31
32 #define SMDKV310_ULCON_DEFAULT  S3C2410_LCON_CS8
33
34 #define SMDKV310_UFCON_DEFAULT  (S3C2410_UFCON_FIFOMODE |       \
35                                  S5PV210_UFCON_TXTRIG4 |        \
36                                  S5PV210_UFCON_RXTRIG4)
37
38 static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = {
39         [0] = {
40                 .hwport         = 0,
41                 .flags          = 0,
42                 .ucon           = SMDKV310_UCON_DEFAULT,
43                 .ulcon          = SMDKV310_ULCON_DEFAULT,
44                 .ufcon          = SMDKV310_UFCON_DEFAULT,
45         },
46         [1] = {
47                 .hwport         = 1,
48                 .flags          = 0,
49                 .ucon           = SMDKV310_UCON_DEFAULT,
50                 .ulcon          = SMDKV310_ULCON_DEFAULT,
51                 .ufcon          = SMDKV310_UFCON_DEFAULT,
52         },
53         [2] = {
54                 .hwport         = 2,
55                 .flags          = 0,
56                 .ucon           = SMDKV310_UCON_DEFAULT,
57                 .ulcon          = SMDKV310_ULCON_DEFAULT,
58                 .ufcon          = SMDKV310_UFCON_DEFAULT,
59         },
60         [3] = {
61                 .hwport         = 3,
62                 .flags          = 0,
63                 .ucon           = SMDKV310_UCON_DEFAULT,
64                 .ulcon          = SMDKV310_ULCON_DEFAULT,
65                 .ufcon          = SMDKV310_UFCON_DEFAULT,
66         },
67 };
68
69 static struct platform_device *smdkv310_devices[] __initdata = {
70         &s3c_device_rtc,
71         &s3c_device_wdt,
72 };
73
74 static void __init smdkv310_map_io(void)
75 {
76         s5p_init_io(NULL, 0, S5P_VA_CHIPID);
77         s3c24xx_init_clocks(24000000);
78         s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
79 }
80
81 static void __init smdkv310_machine_init(void)
82 {
83 #ifdef CONFIG_CACHE_L2X0
84         l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
85 #endif
86
87         platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
88 }
89
90 MACHINE_START(SMDKV310, "SMDKV310")
91         /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
92         /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
93         .phys_io        = S3C_PA_UART & 0xfff00000,
94         .io_pg_offst    = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
95         .boot_params    = S5P_PA_SDRAM + 0x100,
96         .init_irq       = s5pv310_init_irq,
97         .map_io         = smdkv310_map_io,
98         .init_machine   = smdkv310_machine_init,
99         .timer          = &s5pv310_timer,
100 MACHINE_END