blob: bcd7a5d53401ae37d751cc59418f6aa74f2eab42 [file] [log] [blame]
Kukjin Kim98174412010-02-24 16:40:49 +09001/* linux/arch/arm/mach-s5pv210/mach-smdkv210.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>
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053013#include <linux/i2c.h>
Kukjin Kim98174412010-02-24 16:40:49 +090014#include <linux/init.h>
15#include <linux/serial_core.h>
16
17#include <asm/mach/arch.h>
18#include <asm/mach/map.h>
19#include <asm/setup.h>
20#include <asm/mach-types.h>
21
22#include <mach/map.h>
23#include <mach/regs-clock.h>
24
25#include <plat/regs-serial.h>
26#include <plat/s5pv210.h>
27#include <plat/devs.h>
28#include <plat/cpu.h>
Naveen Krishna Ch41d82892010-05-20 11:39:54 +090029#include <plat/adc.h>
30#include <plat/ts.h>
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090031#include <plat/ata.h>
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053032#include <plat/iic.h>
Naveen Krishna Ch88a1cc42010-06-21 16:47:16 +090033#include <plat/keypad.h>
Jongpill Leeea31fd42010-10-02 19:13:42 +090034#include <plat/pm.h>
Kukjin Kim98174412010-02-24 16:40:49 +090035
36/* Following are default values for UCON, ULCON and UFCON UART registers */
Kukjin Kimc8def082010-07-21 09:19:51 +090037#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
Kukjin Kim98174412010-02-24 16:40:49 +090038 S3C2410_UCON_RXILEVEL | \
39 S3C2410_UCON_TXIRQMODE | \
40 S3C2410_UCON_RXIRQMODE | \
41 S3C2410_UCON_RXFIFO_TOI | \
42 S3C2443_UCON_RXERR_IRQEN)
43
Kukjin Kimc8def082010-07-21 09:19:51 +090044#define SMDKV210_ULCON_DEFAULT S3C2410_LCON_CS8
Kukjin Kim98174412010-02-24 16:40:49 +090045
Kukjin Kimc8def082010-07-21 09:19:51 +090046#define SMDKV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
Kukjin Kim98174412010-02-24 16:40:49 +090047 S5PV210_UFCON_TXTRIG4 | \
48 S5PV210_UFCON_RXTRIG4)
49
50static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
51 [0] = {
52 .hwport = 0,
53 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090054 .ucon = SMDKV210_UCON_DEFAULT,
55 .ulcon = SMDKV210_ULCON_DEFAULT,
56 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090057 },
58 [1] = {
59 .hwport = 1,
60 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090061 .ucon = SMDKV210_UCON_DEFAULT,
62 .ulcon = SMDKV210_ULCON_DEFAULT,
63 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090064 },
65 [2] = {
66 .hwport = 2,
67 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090068 .ucon = SMDKV210_UCON_DEFAULT,
69 .ulcon = SMDKV210_ULCON_DEFAULT,
70 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090071 },
72 [3] = {
73 .hwport = 3,
74 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090075 .ucon = SMDKV210_UCON_DEFAULT,
76 .ulcon = SMDKV210_ULCON_DEFAULT,
77 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090078 },
79};
80
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090081static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
82 .setup_gpio = s5pv210_ide_setup_gpio,
83};
84
Naveen Krishna Ch88a1cc42010-06-21 16:47:16 +090085static uint32_t smdkv210_keymap[] __initdata = {
86 /* KEY(row, col, keycode) */
87 KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
88 KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
89 KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
90 KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
91};
92
93static struct matrix_keymap_data smdkv210_keymap_data __initdata = {
94 .keymap = smdkv210_keymap,
95 .keymap_size = ARRAY_SIZE(smdkv210_keymap),
96};
97
98static struct samsung_keypad_platdata smdkv210_keypad_data __initdata = {
99 .keymap_data = &smdkv210_keymap_data,
100 .rows = 8,
101 .cols = 8,
102};
103
Kukjin Kim98174412010-02-24 16:40:49 +0900104static struct platform_device *smdkv210_devices[] __initdata = {
Jassi Brar9b5f1e02010-05-18 16:02:30 +0900105 &s5pv210_device_iis0,
106 &s5pv210_device_ac97,
Seungwhan Youn494edad2010-10-14 10:35:24 +0900107 &s5pv210_device_spdif,
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900108 &s3c_device_adc,
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +0900109 &s3c_device_cfcon,
Hyuk Lee976a62f2010-06-14 10:18:56 +0900110 &s3c_device_hsmmc0,
111 &s3c_device_hsmmc1,
112 &s3c_device_hsmmc2,
113 &s3c_device_hsmmc3,
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530114 &s3c_device_i2c0,
115 &s3c_device_i2c1,
116 &s3c_device_i2c2,
Naveen Krishna Ch88a1cc42010-06-21 16:47:16 +0900117 &samsung_device_keypad,
Atul Dahiyaf5807262010-07-21 17:36:02 +0900118 &s3c_device_rtc,
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900119 &s3c_device_ts,
Banajit Goswami5b7d7b22010-05-20 16:21:32 +0900120 &s3c_device_wdt,
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900121};
122
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530123static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = {
124 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
125};
126
127static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = {
128 /* To Be Updated */
129};
130
131static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = {
132 /* To Be Updated */
133};
134
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900135static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
136 .delay = 10000,
137 .presc = 49,
138 .oversampling_shift = 2,
Kukjin Kim98174412010-02-24 16:40:49 +0900139};
140
141static void __init smdkv210_map_io(void)
142{
143 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
144 s3c24xx_init_clocks(24000000);
145 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
146}
147
148static void __init smdkv210_machine_init(void)
149{
Jongpill Leeea31fd42010-10-02 19:13:42 +0900150 s3c_pm_init();
151
Naveen Krishna Ch88a1cc42010-06-21 16:47:16 +0900152 samsung_keypad_set_platdata(&smdkv210_keypad_data);
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900153 s3c24xx_ts_set_platdata(&s3c_ts_platform);
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530154
155 s3c_i2c0_set_platdata(NULL);
156 s3c_i2c1_set_platdata(NULL);
157 s3c_i2c2_set_platdata(NULL);
158 i2c_register_board_info(0, smdkv210_i2c_devs0,
159 ARRAY_SIZE(smdkv210_i2c_devs0));
160 i2c_register_board_info(1, smdkv210_i2c_devs1,
161 ARRAY_SIZE(smdkv210_i2c_devs1));
162 i2c_register_board_info(2, smdkv210_i2c_devs2,
163 ARRAY_SIZE(smdkv210_i2c_devs2));
164
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +0900165 s3c_ide_set_platdata(&smdkv210_ide_pdata);
166
Kukjin Kim98174412010-02-24 16:40:49 +0900167 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
168}
169
170MACHINE_START(SMDKV210, "SMDKV210")
171 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
Kukjin Kim98174412010-02-24 16:40:49 +0900172 .boot_params = S5P_PA_SDRAM + 0x100,
173 .init_irq = s5pv210_init_irq,
174 .map_io = smdkv210_map_io,
175 .init_machine = smdkv210_machine_init,
176 .timer = &s3c24xx_timer,
177MACHINE_END