blob: cd5195f935480a299982d4cf33d27545d2d5b7de [file] [log] [blame]
JeongHyeon Kim699efdd2011-07-21 16:19:19 +09001/* linux/arch/arm/mach-exynos4/mach-origen.c
2 *
3 * Copyright (c) 2011 Insignal Co., Ltd.
4 * http://www.insignal.co.kr/
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/serial_core.h>
12#include <linux/gpio.h>
13#include <linux/mmc/host.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/input.h>
Giridhar Maruthy9edff0f2011-08-31 15:58:52 +090017#include <linux/pwm_backlight.h>
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090018
19#include <asm/mach/arch.h>
20#include <asm/mach-types.h>
21
22#include <plat/regs-serial.h>
23#include <plat/exynos4.h>
24#include <plat/cpu.h>
25#include <plat/devs.h>
26#include <plat/sdhci.h>
27#include <plat/iic.h>
Sachin Kamat24f9e1f2011-08-31 15:47:16 +090028#include <plat/ehci.h>
29#include <plat/clock.h>
Giridhar Maruthy9edff0f2011-08-31 15:58:52 +090030#include <plat/gpio-cfg.h>
31#include <plat/backlight.h>
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090032
33#include <mach/map.h>
34
35/* Following are default values for UCON, ULCON and UFCON UART registers */
36#define ORIGEN_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)
42
43#define ORIGEN_ULCON_DEFAULT S3C2410_LCON_CS8
44
45#define ORIGEN_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
46 S5PV210_UFCON_TXTRIG4 | \
47 S5PV210_UFCON_RXTRIG4)
48
49static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = {
50 [0] = {
51 .hwport = 0,
52 .flags = 0,
53 .ucon = ORIGEN_UCON_DEFAULT,
54 .ulcon = ORIGEN_ULCON_DEFAULT,
55 .ufcon = ORIGEN_UFCON_DEFAULT,
56 },
57 [1] = {
58 .hwport = 1,
59 .flags = 0,
60 .ucon = ORIGEN_UCON_DEFAULT,
61 .ulcon = ORIGEN_ULCON_DEFAULT,
62 .ufcon = ORIGEN_UFCON_DEFAULT,
63 },
64 [2] = {
65 .hwport = 2,
66 .flags = 0,
67 .ucon = ORIGEN_UCON_DEFAULT,
68 .ulcon = ORIGEN_ULCON_DEFAULT,
69 .ufcon = ORIGEN_UFCON_DEFAULT,
70 },
71 [3] = {
72 .hwport = 3,
73 .flags = 0,
74 .ucon = ORIGEN_UCON_DEFAULT,
75 .ulcon = ORIGEN_ULCON_DEFAULT,
76 .ufcon = ORIGEN_UFCON_DEFAULT,
77 },
78};
79
Tushar Beheracf1dad92011-08-31 16:57:37 +090080static struct s3c_sdhci_platdata origen_hsmmc0_pdata __initdata = {
81 .cd_type = S3C_SDHCI_CD_INTERNAL,
82 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
83};
84
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090085static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = {
Tushar Behera92e41ef2011-08-31 16:01:15 +090086 .cd_type = S3C_SDHCI_CD_INTERNAL,
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090087 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
88};
89
Sachin Kamat24f9e1f2011-08-31 15:47:16 +090090/* USB EHCI */
91static struct s5p_ehci_platdata origen_ehci_pdata;
92
93static void __init origen_ehci_init(void)
94{
95 struct s5p_ehci_platdata *pdata = &origen_ehci_pdata;
96
97 s5p_ehci_set_platdata(pdata);
98}
99
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900100static struct platform_device *origen_devices[] __initdata = {
101 &s3c_device_hsmmc2,
Tushar Beheracf1dad92011-08-31 16:57:37 +0900102 &s3c_device_hsmmc0,
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900103 &s3c_device_rtc,
104 &s3c_device_wdt,
Sachin Kamat24f9e1f2011-08-31 15:47:16 +0900105 &s5p_device_ehci,
Sachin Kamat6f8eb322011-08-31 15:52:27 +0900106 &s5p_device_fimc0,
107 &s5p_device_fimc1,
108 &s5p_device_fimc2,
109 &s5p_device_fimc3,
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900110};
111
Giridhar Maruthy9edff0f2011-08-31 15:58:52 +0900112/* LCD Backlight data */
113static struct samsung_bl_gpio_info origen_bl_gpio_info = {
114 .no = EXYNOS4_GPD0(0),
115 .func = S3C_GPIO_SFN(2),
116};
117
118static struct platform_pwm_backlight_data origen_bl_data = {
119 .pwm_id = 0,
120 .pwm_period_ns = 1000,
121};
122
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900123static void __init origen_map_io(void)
124{
125 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
126 s3c24xx_init_clocks(24000000);
127 s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
128}
129
130static void __init origen_machine_init(void)
131{
Tushar Beheracf1dad92011-08-31 16:57:37 +0900132 /*
133 * Since sdhci instance 2 can contain a bootable media,
134 * sdhci instance 0 is registered after instance 2.
135 */
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900136 s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata);
Tushar Beheracf1dad92011-08-31 16:57:37 +0900137 s3c_sdhci0_set_platdata(&origen_hsmmc0_pdata);
Sachin Kamat24f9e1f2011-08-31 15:47:16 +0900138
139 origen_ehci_init();
140 clk_xusbxti.rate = 24000000;
141
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900142 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
Giridhar Maruthy9edff0f2011-08-31 15:58:52 +0900143
144 samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900145}
146
147MACHINE_START(ORIGEN, "ORIGEN")
148 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
149 .boot_params = S5P_PA_SDRAM + 0x100,
150 .init_irq = exynos4_init_irq,
151 .map_io = origen_map_io,
152 .init_machine = origen_machine_init,
153 .timer = &exynos4_timer,
154MACHINE_END