1 /* linux/arch/arm/mach-s5pv310/mach-universal_c210.c
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
10 #include <linux/platform_device.h>
11 #include <linux/serial_core.h>
12 #include <linux/input.h>
13 #include <linux/i2c.h>
14 #include <linux/gpio_keys.h>
15 #include <linux/gpio.h>
17 #include <asm/mach/arch.h>
18 #include <asm/mach-types.h>
20 #include <plat/regs-serial.h>
21 #include <plat/s5pv310.h>
23 #include <plat/devs.h>
27 /* Following are default values for UCON, ULCON and UFCON UART registers */
28 #define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
29 S3C2410_UCON_RXILEVEL | \
30 S3C2410_UCON_TXIRQMODE | \
31 S3C2410_UCON_RXIRQMODE | \
32 S3C2410_UCON_RXFIFO_TOI | \
33 S3C2443_UCON_RXERR_IRQEN)
35 #define UNIVERSAL_ULCON_DEFAULT S3C2410_LCON_CS8
37 #define UNIVERSAL_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
38 S5PV210_UFCON_TXTRIG256 | \
39 S5PV210_UFCON_RXTRIG256)
41 static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
44 .ucon = UNIVERSAL_UCON_DEFAULT,
45 .ulcon = UNIVERSAL_ULCON_DEFAULT,
46 .ufcon = UNIVERSAL_UFCON_DEFAULT,
50 .ucon = UNIVERSAL_UCON_DEFAULT,
51 .ulcon = UNIVERSAL_ULCON_DEFAULT,
52 .ufcon = UNIVERSAL_UFCON_DEFAULT,
56 .ucon = UNIVERSAL_UCON_DEFAULT,
57 .ulcon = UNIVERSAL_ULCON_DEFAULT,
58 .ufcon = UNIVERSAL_UFCON_DEFAULT,
62 .ucon = UNIVERSAL_UCON_DEFAULT,
63 .ulcon = UNIVERSAL_ULCON_DEFAULT,
64 .ufcon = UNIVERSAL_UFCON_DEFAULT,
68 static struct gpio_keys_button universal_gpio_keys_tables[] = {
71 .gpio = S5PV310_GPX2(0), /* XEINT16 */
72 .desc = "gpio-keys: KEY_VOLUMEUP",
75 .debounce_interval = 1,
77 .code = KEY_VOLUMEDOWN,
78 .gpio = S5PV310_GPX2(1), /* XEINT17 */
79 .desc = "gpio-keys: KEY_VOLUMEDOWN",
82 .debounce_interval = 1,
85 .gpio = S5PV310_GPX2(2), /* XEINT18 */
86 .desc = "gpio-keys: KEY_CONFIG",
89 .debounce_interval = 1,
92 .gpio = S5PV310_GPX2(3), /* XEINT19 */
93 .desc = "gpio-keys: KEY_CAMERA",
96 .debounce_interval = 1,
99 .gpio = S5PV310_GPX3(5), /* XEINT29 */
100 .desc = "gpio-keys: KEY_OK",
103 .debounce_interval = 1,
107 static struct gpio_keys_platform_data universal_gpio_keys_data = {
108 .buttons = universal_gpio_keys_tables,
109 .nbuttons = ARRAY_SIZE(universal_gpio_keys_tables),
112 static struct platform_device universal_gpio_keys = {
115 .platform_data = &universal_gpio_keys_data,
120 static struct i2c_board_info i2c0_devs[] __initdata = {
121 /* Camera, To be updated */
125 static struct i2c_board_info i2c1_devs[] __initdata = {
126 /* Gyro, To be updated */
129 static struct platform_device *universal_devices[] __initdata = {
130 &universal_gpio_keys,
134 static void __init universal_map_io(void)
136 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
137 s3c24xx_init_clocks(24000000);
138 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
141 static void __init universal_machine_init(void)
143 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
144 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
147 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
150 MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
151 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
152 .boot_params = S5P_PA_SDRAM + 0x100,
153 .init_irq = s5pv310_init_irq,
154 .map_io = universal_map_io,
155 .init_machine = universal_machine_init,
156 .timer = &s5pv310_timer,