blob: 0ad7924fe62e8faa12c54f5aafc07c2aa81474dc [file] [log] [blame]
Kukjin Kimd515ec332010-02-24 16:40:53 +09001/* 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>
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053015#include <linux/i2c.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090016
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>
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090029#include <plat/ata.h>
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053030#include <plat/iic.h>
Jongpill Leeea31fd42010-10-02 19:13:42 +090031#include <plat/pm.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090032
33/* Following are default values for UCON, ULCON and UFCON UART registers */
Kukjin Kimc8def082010-07-21 09:19:51 +090034#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
Kukjin Kimd515ec332010-02-24 16:40:53 +090035 S3C2410_UCON_RXILEVEL | \
36 S3C2410_UCON_TXIRQMODE | \
37 S3C2410_UCON_RXIRQMODE | \
38 S3C2410_UCON_RXFIFO_TOI | \
39 S3C2443_UCON_RXERR_IRQEN)
40
Kukjin Kimc8def082010-07-21 09:19:51 +090041#define SMDKC110_ULCON_DEFAULT S3C2410_LCON_CS8
Kukjin Kimd515ec332010-02-24 16:40:53 +090042
Kukjin Kimc8def082010-07-21 09:19:51 +090043#define SMDKC110_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
Kukjin Kimd515ec332010-02-24 16:40:53 +090044 S5PV210_UFCON_TXTRIG4 | \
45 S5PV210_UFCON_RXTRIG4)
46
47static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
48 [0] = {
49 .hwport = 0,
50 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090051 .ucon = SMDKC110_UCON_DEFAULT,
52 .ulcon = SMDKC110_ULCON_DEFAULT,
53 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090054 },
55 [1] = {
56 .hwport = 1,
57 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090058 .ucon = SMDKC110_UCON_DEFAULT,
59 .ulcon = SMDKC110_ULCON_DEFAULT,
60 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090061 },
62 [2] = {
63 .hwport = 2,
64 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090065 .ucon = SMDKC110_UCON_DEFAULT,
66 .ulcon = SMDKC110_ULCON_DEFAULT,
67 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090068 },
69 [3] = {
70 .hwport = 3,
71 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090072 .ucon = SMDKC110_UCON_DEFAULT,
73 .ulcon = SMDKC110_ULCON_DEFAULT,
74 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090075 },
76};
77
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053078static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090079 .setup_gpio = s5pv210_ide_setup_gpio,
80};
81
Kukjin Kimd515ec332010-02-24 16:40:53 +090082static struct platform_device *smdkc110_devices[] __initdata = {
Jassi Brar95fa6e62010-05-18 16:02:35 +090083 &s5pv210_device_iis0,
84 &s5pv210_device_ac97,
Seungwhan Youn494edad2010-10-14 10:35:24 +090085 &s5pv210_device_spdif,
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090086 &s3c_device_cfcon,
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053087 &s3c_device_i2c0,
88 &s3c_device_i2c1,
89 &s3c_device_i2c2,
Atul Dahiyaf5807262010-07-21 17:36:02 +090090 &s3c_device_rtc,
Banajit Goswami5b7d7b22010-05-20 16:21:32 +090091 &s3c_device_wdt,
Kukjin Kimd515ec332010-02-24 16:40:53 +090092};
93
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053094static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
95 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
96};
97
98static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
99 /* To Be Updated */
100};
101
102static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
103 /* To Be Updated */
104};
105
Kukjin Kimd515ec332010-02-24 16:40:53 +0900106static void __init smdkc110_map_io(void)
107{
108 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
109 s3c24xx_init_clocks(24000000);
110 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
111}
112
113static void __init smdkc110_machine_init(void)
114{
Jongpill Leeea31fd42010-10-02 19:13:42 +0900115 s3c_pm_init();
116
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530117 s3c_i2c0_set_platdata(NULL);
118 s3c_i2c1_set_platdata(NULL);
119 s3c_i2c2_set_platdata(NULL);
120 i2c_register_board_info(0, smdkc110_i2c_devs0,
121 ARRAY_SIZE(smdkc110_i2c_devs0));
122 i2c_register_board_info(1, smdkc110_i2c_devs1,
123 ARRAY_SIZE(smdkc110_i2c_devs1));
124 i2c_register_board_info(2, smdkc110_i2c_devs2,
125 ARRAY_SIZE(smdkc110_i2c_devs2));
126
127 s3c_ide_set_platdata(&smdkc110_ide_pdata);
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +0900128
Kukjin Kimd515ec332010-02-24 16:40:53 +0900129 platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
130}
131
132MACHINE_START(SMDKC110, "SMDKC110")
133 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
Kukjin Kimd515ec332010-02-24 16:40:53 +0900134 .boot_params = S5P_PA_SDRAM + 0x100,
135 .init_irq = s5pv210_init_irq,
136 .map_io = smdkc110_map_io,
137 .init_machine = smdkc110_machine_init,
138 .timer = &s3c24xx_timer,
139MACHINE_END