blob: 0e3b81634c24cc33b77f44a735537bcde0afc501 [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
80static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = {
Tushar Behera92e41ef2011-08-31 16:01:15 +090081 .cd_type = S3C_SDHCI_CD_INTERNAL,
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090082 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
83};
84
Sachin Kamat24f9e1f2011-08-31 15:47:16 +090085/* USB EHCI */
86static struct s5p_ehci_platdata origen_ehci_pdata;
87
88static void __init origen_ehci_init(void)
89{
90 struct s5p_ehci_platdata *pdata = &origen_ehci_pdata;
91
92 s5p_ehci_set_platdata(pdata);
93}
94
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090095static struct platform_device *origen_devices[] __initdata = {
96 &s3c_device_hsmmc2,
97 &s3c_device_rtc,
98 &s3c_device_wdt,
Sachin Kamat24f9e1f2011-08-31 15:47:16 +090099 &s5p_device_ehci,
Sachin Kamat6f8eb322011-08-31 15:52:27 +0900100 &s5p_device_fimc0,
101 &s5p_device_fimc1,
102 &s5p_device_fimc2,
103 &s5p_device_fimc3,
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900104};
105
Giridhar Maruthy9edff0f2011-08-31 15:58:52 +0900106/* LCD Backlight data */
107static struct samsung_bl_gpio_info origen_bl_gpio_info = {
108 .no = EXYNOS4_GPD0(0),
109 .func = S3C_GPIO_SFN(2),
110};
111
112static struct platform_pwm_backlight_data origen_bl_data = {
113 .pwm_id = 0,
114 .pwm_period_ns = 1000,
115};
116
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900117static void __init origen_map_io(void)
118{
119 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
120 s3c24xx_init_clocks(24000000);
121 s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
122}
123
124static void __init origen_machine_init(void)
125{
126 s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata);
Sachin Kamat24f9e1f2011-08-31 15:47:16 +0900127
128 origen_ehci_init();
129 clk_xusbxti.rate = 24000000;
130
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900131 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
Giridhar Maruthy9edff0f2011-08-31 15:58:52 +0900132
133 samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900134}
135
136MACHINE_START(ORIGEN, "ORIGEN")
137 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
138 .boot_params = S5P_PA_SDRAM + 0x100,
139 .init_irq = exynos4_init_irq,
140 .map_io = origen_map_io,
141 .init_machine = origen_machine_init,
142 .timer = &exynos4_timer,
143MACHINE_END