blob: d9c99fcc1aa7fa97e81b1d930e2523457128f836 [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>
Kay Sieversedbaa602011-12-21 16:26:03 -080016#include <linux/device.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090017
Jamie Ilesbb3a4eb2011-09-27 20:53:31 +010018#include <asm/hardware/vic.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090019#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
27#include <plat/regs-serial.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090028#include <plat/devs.h>
29#include <plat/cpu.h>
Arnd Bergmann436d42c2012-08-24 15:22:12 +020030#include <linux/platform_data/ata-samsung_cf.h>
31#include <linux/platform_data/i2c-s3c2410.h>
Jongpill Leeea31fd42010-10-02 19:13:42 +090032#include <plat/pm.h>
Sangbeom Kim20780fc2011-03-12 08:02:12 +090033#include <plat/s5p-time.h>
Sachin Kamat6ff5d252012-03-09 07:00:35 -080034#include <plat/mfc.h>
Kukjin Kimd515ec332010-02-24 16:40:53 +090035
Kukjin Kim3fa754c2011-12-22 23:32:07 +010036#include "common.h"
37
Kukjin Kimd515ec332010-02-24 16:40:53 +090038/* Following are default values for UCON, ULCON and UFCON UART registers */
Kukjin Kimc8def082010-07-21 09:19:51 +090039#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
Kukjin Kimd515ec332010-02-24 16:40:53 +090040 S3C2410_UCON_RXILEVEL | \
41 S3C2410_UCON_TXIRQMODE | \
42 S3C2410_UCON_RXIRQMODE | \
43 S3C2410_UCON_RXFIFO_TOI | \
44 S3C2443_UCON_RXERR_IRQEN)
45
Kukjin Kimc8def082010-07-21 09:19:51 +090046#define SMDKC110_ULCON_DEFAULT S3C2410_LCON_CS8
Kukjin Kimd515ec332010-02-24 16:40:53 +090047
Kukjin Kimc8def082010-07-21 09:19:51 +090048#define SMDKC110_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
Kukjin Kimd515ec332010-02-24 16:40:53 +090049 S5PV210_UFCON_TXTRIG4 | \
50 S5PV210_UFCON_RXTRIG4)
51
52static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
53 [0] = {
54 .hwport = 0,
55 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090056 .ucon = SMDKC110_UCON_DEFAULT,
57 .ulcon = SMDKC110_ULCON_DEFAULT,
58 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090059 },
60 [1] = {
61 .hwport = 1,
62 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090063 .ucon = SMDKC110_UCON_DEFAULT,
64 .ulcon = SMDKC110_ULCON_DEFAULT,
65 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090066 },
67 [2] = {
68 .hwport = 2,
69 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090070 .ucon = SMDKC110_UCON_DEFAULT,
71 .ulcon = SMDKC110_ULCON_DEFAULT,
72 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090073 },
74 [3] = {
75 .hwport = 3,
76 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090077 .ucon = SMDKC110_UCON_DEFAULT,
78 .ulcon = SMDKC110_ULCON_DEFAULT,
79 .ufcon = SMDKC110_UFCON_DEFAULT,
Kukjin Kimd515ec332010-02-24 16:40:53 +090080 },
81};
82
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053083static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090084 .setup_gpio = s5pv210_ide_setup_gpio,
85};
86
Kukjin Kimd515ec332010-02-24 16:40:53 +090087static struct platform_device *smdkc110_devices[] __initdata = {
Jassi Brarb9368f32010-12-30 09:13:23 +090088 &samsung_asoc_dma,
Jassi Brar95fa6e62010-05-18 16:02:35 +090089 &s5pv210_device_iis0,
90 &s5pv210_device_ac97,
Seungwhan Youn494edad2010-10-14 10:35:24 +090091 &s5pv210_device_spdif,
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +090092 &s3c_device_cfcon,
Naveen Krishna Ch170d7412010-07-21 09:21:56 +053093 &s3c_device_i2c0,
94 &s3c_device_i2c1,
95 &s3c_device_i2c2,
Atul Dahiyaf5807262010-07-21 17:36:02 +090096 &s3c_device_rtc,
Banajit Goswami5b7d7b22010-05-20 16:21:32 +090097 &s3c_device_wdt,
Sachin Kamat41065892012-03-09 07:00:44 -080098 &s5p_device_fimc0,
99 &s5p_device_fimc1,
100 &s5p_device_fimc2,
101 &s5p_device_fimc_md,
Sachin Kamat6ff5d252012-03-09 07:00:35 -0800102 &s5p_device_mfc,
103 &s5p_device_mfc_l,
104 &s5p_device_mfc_r,
Kukjin Kimd515ec332010-02-24 16:40:53 +0900105};
106
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530107static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = {
108 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */
Jassi Brar0031e9d2010-12-21 09:48:35 +0900109 { I2C_BOARD_INFO("wm8580", 0x1b), },
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530110};
111
112static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
113 /* To Be Updated */
114};
115
116static struct i2c_board_info smdkc110_i2c_devs2[] __initdata = {
117 /* To Be Updated */
118};
119
Kukjin Kimd515ec332010-02-24 16:40:53 +0900120static void __init smdkc110_map_io(void)
121{
Kukjin Kim3fa754c2011-12-22 23:32:07 +0100122 s5pv210_init_io(NULL, 0);
Kukjin Kimd515ec332010-02-24 16:40:53 +0900123 s3c24xx_init_clocks(24000000);
124 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
Sangbeom Kim20780fc2011-03-12 08:02:12 +0900125 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
Kukjin Kimd515ec332010-02-24 16:40:53 +0900126}
127
Sachin Kamat6ff5d252012-03-09 07:00:35 -0800128static void __init smdkc110_reserve(void)
129{
130 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
131}
132
Kukjin Kimd515ec332010-02-24 16:40:53 +0900133static void __init smdkc110_machine_init(void)
134{
Jongpill Leeea31fd42010-10-02 19:13:42 +0900135 s3c_pm_init();
136
Naveen Krishna Ch170d7412010-07-21 09:21:56 +0530137 s3c_i2c0_set_platdata(NULL);
138 s3c_i2c1_set_platdata(NULL);
139 s3c_i2c2_set_platdata(NULL);
140 i2c_register_board_info(0, smdkc110_i2c_devs0,
141 ARRAY_SIZE(smdkc110_i2c_devs0));
142 i2c_register_board_info(1, smdkc110_i2c_devs1,
143 ARRAY_SIZE(smdkc110_i2c_devs1));
144 i2c_register_board_info(2, smdkc110_i2c_devs2,
145 ARRAY_SIZE(smdkc110_i2c_devs2));
146
147 s3c_ide_set_platdata(&smdkc110_ide_pdata);
Abhilash Kesavan4b9a5ad2010-06-08 17:11:43 +0900148
Kukjin Kimd515ec332010-02-24 16:40:53 +0900149 platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
150}
151
152MACHINE_START(SMDKC110, "SMDKC110")
153 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
Nicolas Pitre02350a12011-07-05 22:38:17 -0400154 .atag_offset = 0x100,
Kukjin Kimd515ec332010-02-24 16:40:53 +0900155 .init_irq = s5pv210_init_irq,
Jamie Ilesbb3a4eb2011-09-27 20:53:31 +0100156 .handle_irq = vic_handle_irq,
Kukjin Kimd515ec332010-02-24 16:40:53 +0900157 .map_io = smdkc110_map_io,
158 .init_machine = smdkc110_machine_init,
Sangbeom Kim20780fc2011-03-12 08:02:12 +0900159 .timer = &s5p_timer,
Russell King1f34f0e2011-12-22 23:36:02 +0100160 .restart = s5pv210_restart,
Sachin Kamat6ff5d252012-03-09 07:00:35 -0800161 .reserve = &smdkc110_reserve,
Kukjin Kimd515ec332010-02-24 16:40:53 +0900162MACHINE_END