1 /* linux/arch/arm/mach-s5pv210/mach-smdkv210.c
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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.
11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/i2c.h>
14 #include <linux/init.h>
15 #include <linux/serial_core.h>
17 #include <asm/mach/arch.h>
18 #include <asm/mach/map.h>
19 #include <asm/setup.h>
20 #include <asm/mach-types.h>
23 #include <mach/regs-clock.h>
25 #include <plat/regs-serial.h>
26 #include <plat/s5pv210.h>
27 #include <plat/devs.h>
33 #include <plat/keypad.h>
35 /* Following are default values for UCON, ULCON and UFCON UART registers */
36 #define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
37 S3C2410_UCON_RXILEVEL | \
38 S3C2410_UCON_TXIRQMODE | \
39 S3C2410_UCON_RXIRQMODE | \
40 S3C2410_UCON_RXFIFO_TOI | \
41 S3C2443_UCON_RXERR_IRQEN)
43 #define SMDKV210_ULCON_DEFAULT S3C2410_LCON_CS8
45 #define SMDKV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
46 S5PV210_UFCON_TXTRIG4 | \
47 S5PV210_UFCON_RXTRIG4)
49 static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
53 .ucon = SMDKV210_UCON_DEFAULT,
54 .ulcon = SMDKV210_ULCON_DEFAULT,
55 .ufcon = SMDKV210_UFCON_DEFAULT,
60 .ucon = SMDKV210_UCON_DEFAULT,
61 .ulcon = SMDKV210_ULCON_DEFAULT,
62 .ufcon = SMDKV210_UFCON_DEFAULT,
67 .ucon = SMDKV210_UCON_DEFAULT,
68 .ulcon = SMDKV210_ULCON_DEFAULT,
69 .ufcon = SMDKV210_UFCON_DEFAULT,
74 .ucon = SMDKV210_UCON_DEFAULT,
75 .ulcon = SMDKV210_ULCON_DEFAULT,
76 .ufcon = SMDKV210_UFCON_DEFAULT,
80 static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
81 .setup_gpio = s5pv210_ide_setup_gpio,
84 static 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)
92 static struct matrix_keymap_data smdkv210_keymap_data __initdata = {
93 .keymap = smdkv210_keymap,
94 .keymap_size = ARRAY_SIZE(smdkv210_keymap),
97 static struct samsung_keypad_platdata smdkv210_keypad_data __initdata = {
98 .keymap_data = &smdkv210_keymap_data,
103 static struct platform_device *smdkv210_devices[] __initdata = {
104 &s5pv210_device_iis0,
105 &s5pv210_device_ac97,
115 &samsung_device_keypad,
121 static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = {
122 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
125 static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = {
129 static struct i2c_board_info smdkv210_i2c_devs2[] __initdata = {
133 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
136 .oversampling_shift = 2,
139 static void __init smdkv210_map_io(void)
141 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
142 s3c24xx_init_clocks(24000000);
143 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
146 static void __init smdkv210_machine_init(void)
148 samsung_keypad_set_platdata(&smdkv210_keypad_data);
149 s3c24xx_ts_set_platdata(&s3c_ts_platform);
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));
161 s3c_ide_set_platdata(&smdkv210_ide_pdata);
163 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
166 MACHINE_START(SMDKV210, "SMDKV210")
167 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
168 .boot_params = S5P_PA_SDRAM + 0x100,
169 .init_irq = s5pv210_init_irq,
170 .map_io = smdkv210_map_io,
171 .init_machine = smdkv210_machine_init,
172 .timer = &s3c24xx_timer,