ARM: delete struct sys_timer
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-s5pv210 / mach-smdkc110.c
1 /* linux/arch/arm/mach-s5pv210/mach-smdkc110.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/kernel.h>
12 #include <linux/types.h>
13 #include <linux/init.h>
14 #include <linux/serial_core.h>
15 #include <linux/i2c.h>
16 #include <linux/device.h>
17
18 #include <asm/hardware/vic.h>
19 #include <asm/mach/arch.h>
20 #include <asm/mach/map.h>
21 #include <asm/setup.h>
22 #include <asm/mach-types.h>
23
24 #include <mach/map.h>
25 #include <mach/regs-clock.h>
26
27 #include <plat/regs-serial.h>
28 #include <plat/devs.h>
29 #include <plat/cpu.h>
30 #include <linux/platform_data/ata-samsung_cf.h>
31 #include <linux/platform_data/i2c-s3c2410.h>
32 #include <plat/pm.h>
33 #include <plat/s5p-time.h>
34 #include <plat/mfc.h>
35
36 #include "common.h"
37
38 /* Following are default values for UCON, ULCON and UFCON UART registers */
39 #define SMDKC110_UCON_DEFAULT   (S3C2410_UCON_TXILEVEL |        \
40                                  S3C2410_UCON_RXILEVEL |        \
41                                  S3C2410_UCON_TXIRQMODE |       \
42                                  S3C2410_UCON_RXIRQMODE |       \
43                                  S3C2410_UCON_RXFIFO_TOI |      \
44                                  S3C2443_UCON_RXERR_IRQEN)
45
46 #define SMDKC110_ULCON_DEFAULT  S3C2410_LCON_CS8
47
48 #define SMDKC110_UFCON_DEFAULT  (S3C2410_UFCON_FIFOMODE |       \
49                                  S5PV210_UFCON_TXTRIG4 |        \
50                                  S5PV210_UFCON_RXTRIG4)
51
52 static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
53         [0] = {
54                 .hwport         = 0,
55                 .flags          = 0,
56                 .ucon           = SMDKC110_UCON_DEFAULT,
57                 .ulcon          = SMDKC110_ULCON_DEFAULT,
58                 .ufcon          = SMDKC110_UFCON_DEFAULT,
59         },
60         [1] = {
61                 .hwport         = 1,
62                 .flags          = 0,
63                 .ucon           = SMDKC110_UCON_DEFAULT,
64                 .ulcon          = SMDKC110_ULCON_DEFAULT,
65                 .ufcon          = SMDKC110_UFCON_DEFAULT,
66         },
67         [2] = {
68                 .hwport         = 2,
69                 .flags          = 0,
70                 .ucon           = SMDKC110_UCON_DEFAULT,
71                 .ulcon          = SMDKC110_ULCON_DEFAULT,
72                 .ufcon          = SMDKC110_UFCON_DEFAULT,
73         },
74         [3] = {
75                 .hwport         = 3,
76                 .flags          = 0,
77                 .ucon           = SMDKC110_UCON_DEFAULT,
78                 .ulcon          = SMDKC110_ULCON_DEFAULT,
79                 .ufcon          = SMDKC110_UFCON_DEFAULT,
80         },
81 };
82
83 static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
84         .setup_gpio     = s5pv210_ide_setup_gpio,
85 };
86
87 static struct platform_device *smdkc110_devices[] __initdata = {
88         &s5pv210_device_iis0,
89         &s5pv210_device_ac97,
90         &s5pv210_device_spdif,
91         &s3c_device_cfcon,
92         &s3c_device_i2c0,
93         &s3c_device_i2c1,
94         &s3c_device_i2c2,
95         &s3c_device_rtc,
96         &s3c_device_wdt,
97         &s5p_device_fimc0,
98         &s5p_device_fimc1,
99         &s5p_device_fimc2,
100         &s5p_device_fimc_md,
101         &s5p_device_mfc,
102         &s5p_device_mfc_l,
103         &s5p_device_mfc_r,
104 };
105
106 static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
107         { I2C_BOARD_INFO("24c08", 0x50), },     /* Samsung S524AD0XD1 */
108         { I2C_BOARD_INFO("wm8580", 0x1b), },
109 };
110
111 static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
112         /* To Be Updated */
113 };
114
115 static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
116         /* To Be Updated */
117 };
118
119 static void __init smdkc110_map_io(void)
120 {
121         s5pv210_init_io(NULL, 0);
122         s3c24xx_init_clocks(24000000);
123         s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
124         s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
125 }
126
127 static void __init smdkc110_reserve(void)
128 {
129         s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
130 }
131
132 static void __init smdkc110_machine_init(void)
133 {
134         s3c_pm_init();
135
136         s3c_i2c0_set_platdata(NULL);
137         s3c_i2c1_set_platdata(NULL);
138         s3c_i2c2_set_platdata(NULL);
139         i2c_register_board_info(0, smdkc110_i2c_devs0,
140                         ARRAY_SIZE(smdkc110_i2c_devs0));
141         i2c_register_board_info(1, smdkc110_i2c_devs1,
142                         ARRAY_SIZE(smdkc110_i2c_devs1));
143         i2c_register_board_info(2, smdkc110_i2c_devs2,
144                         ARRAY_SIZE(smdkc110_i2c_devs2));
145
146         s3c_ide_set_platdata(&smdkc110_ide_pdata);
147
148         platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
149 }
150
151 MACHINE_START(SMDKC110, "SMDKC110")
152         /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
153         .atag_offset    = 0x100,
154         .init_irq       = s5pv210_init_irq,
155         .handle_irq     = vic_handle_irq,
156         .map_io         = smdkc110_map_io,
157         .init_machine   = smdkc110_machine_init,
158         .init_time      = s5p_timer_init,
159         .restart        = s5pv210_restart,
160         .reserve        = &smdkc110_reserve,
161 MACHINE_END