blob: 448e1d2eeed6b2ab40b802f57bcaa74230c46f10 [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>
Tushar Behera334a1c72014-02-14 10:32:45 +090015#include <linux/serial_s3c.h>
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053016#include <linux/i2c.h>
Kay Sieversedbaa602011-12-21 16:26:03 -080017#include <linux/device.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090018
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21#include <asm/setup.h>
22#include <asm/mach-types.h>
23
24#include <mach/map.h>
25#include <mach/regs-clock.h>
26
Kukjin Kimd515ec332010-02-24 16:40:53 +090027#include <plat/devs.h>
28#include <plat/cpu.h>
Arnd Bergmann436d42c2012-08-24 15:22:12 +020029#include <linux/platform_data/ata-samsung_cf.h>
30#include <linux/platform_data/i2c-s3c2410.h>
Jongpill Leeea31fd42010-10-02 19:13:42 +090031#include <plat/pm.h>
Romain Naourc1fcd402013-01-09 18:47:03 -080032#include <plat/samsung-time.h>
Sachin Kamat6ff5d252012-03-09 07:00:35 -080033#include <plat/mfc.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090034
Kukjin Kim3fa754c2011-12-22 23:32:07 +010035#include "common.h"
36
Kukjin Kimd515ec332010-02-24 16:40:53 +090037/* Following are default values for UCON, ULCON and UFCON UART registers */
Kukjin Kimc8def082010-07-21 09:19:51 +090038#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
Kukjin Kimd515ec332010-02-24 16:40:53 +090039 S3C2410_UCON_RXILEVEL | \
40 S3C2410_UCON_TXIRQMODE | \
41 S3C2410_UCON_RXIRQMODE | \
42 S3C2410_UCON_RXFIFO_TOI | \
43 S3C2443_UCON_RXERR_IRQEN)
44
Kukjin Kimc8def082010-07-21 09:19:51 +090045#define SMDKC110_ULCON_DEFAULT S3C2410_LCON_CS8
Kukjin Kimd515ec332010-02-24 16:40:53 +090046
Kukjin Kimc8def082010-07-21 09:19:51 +090047#define SMDKC110_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
Kukjin Kimd515ec332010-02-24 16:40:53 +090048 S5PV210_UFCON_TXTRIG4 | \
49 S5PV210_UFCON_RXTRIG4)
50
51static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
52 [0] = {
53 .hwport = 0,
54 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090055 .ucon = SMDKC110_UCON_DEFAULT,
56 .ulcon = SMDKC110_ULCON_DEFAULT,
57 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090058 },
59 [1] = {
60 .hwport = 1,
61 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090062 .ucon = SMDKC110_UCON_DEFAULT,
63 .ulcon = SMDKC110_ULCON_DEFAULT,
64 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090065 },
66 [2] = {
67 .hwport = 2,
68 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090069 .ucon = SMDKC110_UCON_DEFAULT,
70 .ulcon = SMDKC110_ULCON_DEFAULT,
71 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090072 },
73 [3] = {
74 .hwport = 3,
75 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090076 .ucon = SMDKC110_UCON_DEFAULT,
77 .ulcon = SMDKC110_ULCON_DEFAULT,
78 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090079 },
80};
81
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053082static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090083 .setup_gpio = s5pv210_ide_setup_gpio,
84};
85
Kukjin Kimd515ec332010-02-24 16:40:53 +090086static struct platform_device *smdkc110_devices[] __initdata = {
Jassi Brar95fa6e62010-05-18 16:02:35 +090087 &s5pv210_device_iis0,
88 &s5pv210_device_ac97,
Seungwhan Youn494edad2010-10-14 10:35:24 +090089 &s5pv210_device_spdif,
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090090 &s3c_device_cfcon,
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053091 &s3c_device_i2c0,
92 &s3c_device_i2c1,
93 &s3c_device_i2c2,
Atul Dahiyaf5807262010-07-21 17:36:02 +090094 &s3c_device_rtc,
Banajit Goswami5b7d7b22010-05-20 16:21:32 +090095 &s3c_device_wdt,
Sachin Kamat41065892012-03-09 07:00:44 -080096 &s5p_device_fimc0,
97 &s5p_device_fimc1,
98 &s5p_device_fimc2,
99 &s5p_device_fimc_md,
Sachin Kamat6ff5d252012-03-09 07:00:35 -0800100 &s5p_device_mfc,
101 &s5p_device_mfc_l,
102 &s5p_device_mfc_r,
Kukjin Kimd515ec332010-02-24 16:40:53 +0900103};
104
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530105static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
106 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
Jassi Brar0031e9d2010-12-21 09:48:35 +0900107 { I2C_BOARD_INFO("wm8580", 0x1b), },
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530108};
109
110static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
111 /* To Be Updated */
112};
113
114static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
115 /* To Be Updated */
116};
117
Kukjin Kimd515ec332010-02-24 16:40:53 +0900118static void __init smdkc110_map_io(void)
119{
Kukjin Kim3fa754c2011-12-22 23:32:07 +0100120 s5pv210_init_io(NULL, 0);
Kukjin Kimd515ec332010-02-24 16:40:53 +0900121 s3c24xx_init_clocks(24000000);
122 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
Romain Naourc1fcd402013-01-09 18:47:03 -0800123 samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
Kukjin Kimd515ec332010-02-24 16:40:53 +0900124}
125
Sachin Kamat6ff5d252012-03-09 07:00:35 -0800126static void __init smdkc110_reserve(void)
127{
128 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
129}
130
Kukjin Kimd515ec332010-02-24 16:40:53 +0900131static void __init smdkc110_machine_init(void)
132{
Jongpill Leeea31fd42010-10-02 19:13:42 +0900133 s3c_pm_init();
134
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530135 s3c_i2c0_set_platdata(NULL);
136 s3c_i2c1_set_platdata(NULL);
137 s3c_i2c2_set_platdata(NULL);
138 i2c_register_board_info(0, smdkc110_i2c_devs0,
139 ARRAY_SIZE(smdkc110_i2c_devs0));
140 i2c_register_board_info(1, smdkc110_i2c_devs1,
141 ARRAY_SIZE(smdkc110_i2c_devs1));
142 i2c_register_board_info(2, smdkc110_i2c_devs2,
143 ARRAY_SIZE(smdkc110_i2c_devs2));
144
145 s3c_ide_set_platdata(&smdkc110_ide_pdata);
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +0900146
Kukjin Kimd515ec332010-02-24 16:40:53 +0900147 platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
148}
149
150MACHINE_START(SMDKC110, "SMDKC110")
151 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
Nicolas Pitre02350a12011-07-05 22:38:17 -0400152 .atag_offset = 0x100,
Kukjin Kimd515ec332010-02-24 16:40:53 +0900153 .init_irq = s5pv210_init_irq,
154 .map_io = smdkc110_map_io,
155 .init_machine = smdkc110_machine_init,
Romain Naourc1fcd402013-01-09 18:47:03 -0800156 .init_time = samsung_timer_init,
Russell King1f34f0e2011-12-22 23:36:02 +0100157 .restart = s5pv210_restart,
Sachin Kamat6ff5d252012-03-09 07:00:35 -0800158 .reserve = &smdkc110_reserve,
Kukjin Kimd515ec332010-02-24 16:40:53 +0900159MACHINE_END