blob: fbbc0a3c3738aaf2f99bab6556a139b708ee4985 [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>
Kukjin Kim98174412010-02-24 16:40:49 +090034
35/* Following are default values for UCON, ULCON and UFCON UART registers */
Kukjin Kimc8def082010-07-21 09:19:51 +090036#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
Kukjin Kim98174412010-02-24 16:40:49 +090037 S3C2410_UCON_RXILEVEL | \
38 S3C2410_UCON_TXIRQMODE | \
39 S3C2410_UCON_RXIRQMODE | \
40 S3C2410_UCON_RXFIFO_TOI | \
41 S3C2443_UCON_RXERR_IRQEN)
42
Kukjin Kimc8def082010-07-21 09:19:51 +090043#define SMDKV210_ULCON_DEFAULT S3C2410_LCON_CS8
Kukjin Kim98174412010-02-24 16:40:49 +090044
Kukjin Kimc8def082010-07-21 09:19:51 +090045#define SMDKV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
Kukjin Kim98174412010-02-24 16:40:49 +090046 S5PV210_UFCON_TXTRIG4 | \
47 S5PV210_UFCON_RXTRIG4)
48
49static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
50 [0] = {
51 .hwport = 0,
52 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090053 .ucon = SMDKV210_UCON_DEFAULT,
54 .ulcon = SMDKV210_ULCON_DEFAULT,
55 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090056 },
57 [1] = {
58 .hwport = 1,
59 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090060 .ucon = SMDKV210_UCON_DEFAULT,
61 .ulcon = SMDKV210_ULCON_DEFAULT,
62 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090063 },
64 [2] = {
65 .hwport = 2,
66 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090067 .ucon = SMDKV210_UCON_DEFAULT,
68 .ulcon = SMDKV210_ULCON_DEFAULT,
69 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090070 },
71 [3] = {
72 .hwport = 3,
73 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090074 .ucon = SMDKV210_UCON_DEFAULT,
75 .ulcon = SMDKV210_ULCON_DEFAULT,
76 .ufcon = SMDKV210_UFCON_DEFAULT,
Kukjin Kim98174412010-02-24 16:40:49 +090077 },
78};
79
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090080static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
81 .setup_gpio = s5pv210_ide_setup_gpio,
82};
83
Naveen Krishna Ch88a1cc42010-06-21 16:47:16 +090084static uint32_t smdkv210_keymap[] __initdata = {
85 /* KEY(row, col, keycode) */
86 KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
87 KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
88 KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
89 KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
90};
91
92static struct matrix_keymap_data smdkv210_keymap_data __initdata = {
93 .keymap = smdkv210_keymap,
94 .keymap_size = ARRAY_SIZE(smdkv210_keymap),
95};
96
97static struct samsung_keypad_platdata smdkv210_keypad_data __initdata = {
98 .keymap_data = &smdkv210_keymap_data,
99 .rows = 8,
100 .cols = 8,
101};
102
Kukjin Kim98174412010-02-24 16:40:49 +0900103static struct platform_device *smdkv210_devices[] __initdata = {
Jassi Brar9b5f1e02010-05-18 16:02:30 +0900104 &s5pv210_device_iis0,
105 &s5pv210_device_ac97,
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900106 &s3c_device_adc,
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +0900107 &s3c_device_cfcon,
Hyuk Lee976a62f2010-06-14 10:18:56 +0900108 &s3c_device_hsmmc0,
109 &s3c_device_hsmmc1,
110 &s3c_device_hsmmc2,
111 &s3c_device_hsmmc3,
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530112 &s3c_device_i2c0,
113 &s3c_device_i2c1,
114 &s3c_device_i2c2,
Naveen Krishna Ch88a1cc42010-06-21 16:47:16 +0900115 &samsung_device_keypad,
Atul Dahiyaf5807262010-07-21 17:36:02 +0900116 &s3c_device_rtc,
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900117 &s3c_device_ts,
Banajit Goswami5b7d7b22010-05-20 16:21:32 +0900118 &s3c_device_wdt,
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900119};
120
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530121static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = {
122 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
123};
124
125static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = {
126 /* To Be Updated */
127};
128
129static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = {
130 /* To Be Updated */
131};
132
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900133static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
134 .delay = 10000,
135 .presc = 49,
136 .oversampling_shift = 2,
Kukjin Kim98174412010-02-24 16:40:49 +0900137};
138
139static void __init smdkv210_map_io(void)
140{
141 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
142 s3c24xx_init_clocks(24000000);
143 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
144}
145
146static void __init smdkv210_machine_init(void)
147{
Naveen Krishna Ch88a1cc42010-06-21 16:47:16 +0900148 samsung_keypad_set_platdata(&smdkv210_keypad_data);
Naveen Krishna Ch41d82892010-05-20 11:39:54 +0900149 s3c24xx_ts_set_platdata(&s3c_ts_platform);
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530150
151 s3c_i2c0_set_platdata(NULL);
152 s3c_i2c1_set_platdata(NULL);
153 s3c_i2c2_set_platdata(NULL);
154 i2c_register_board_info(0, smdkv210_i2c_devs0,
155 ARRAY_SIZE(smdkv210_i2c_devs0));
156 i2c_register_board_info(1, smdkv210_i2c_devs1,
157 ARRAY_SIZE(smdkv210_i2c_devs1));
158 i2c_register_board_info(2, smdkv210_i2c_devs2,
159 ARRAY_SIZE(smdkv210_i2c_devs2));
160
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +0900161 s3c_ide_set_platdata(&smdkv210_ide_pdata);
162
Kukjin Kim98174412010-02-24 16:40:49 +0900163 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
164}
165
166MACHINE_START(SMDKV210, "SMDKV210")
167 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
168 .phys_io = S3C_PA_UART & 0xfff00000,
169 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
170 .boot_params = S5P_PA_SDRAM + 0x100,
171 .init_irq = s5pv210_init_irq,
172 .map_io = smdkv210_map_io,
173 .init_machine = smdkv210_machine_init,
174 .timer = &s3c24xx_timer,
175MACHINE_END