blob: d101756ef7dc1c73376f00922f3fe0e711895bef [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>
17
18#include <asm/mach/arch.h>
19#include <asm/mach-types.h>
20
21#include <plat/regs-serial.h>
22#include <plat/exynos4.h>
23#include <plat/cpu.h>
24#include <plat/devs.h>
25#include <plat/sdhci.h>
26#include <plat/iic.h>
Sachin Kamat24f9e1f2011-08-31 15:47:16 +090027#include <plat/ehci.h>
28#include <plat/clock.h>
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090029
30#include <mach/map.h>
31
32/* Following are default values for UCON, ULCON and UFCON UART registers */
33#define ORIGEN_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
34 S3C2410_UCON_RXILEVEL | \
35 S3C2410_UCON_TXIRQMODE | \
36 S3C2410_UCON_RXIRQMODE | \
37 S3C2410_UCON_RXFIFO_TOI | \
38 S3C2443_UCON_RXERR_IRQEN)
39
40#define ORIGEN_ULCON_DEFAULT S3C2410_LCON_CS8
41
42#define ORIGEN_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
43 S5PV210_UFCON_TXTRIG4 | \
44 S5PV210_UFCON_RXTRIG4)
45
46static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = {
47 [0] = {
48 .hwport = 0,
49 .flags = 0,
50 .ucon = ORIGEN_UCON_DEFAULT,
51 .ulcon = ORIGEN_ULCON_DEFAULT,
52 .ufcon = ORIGEN_UFCON_DEFAULT,
53 },
54 [1] = {
55 .hwport = 1,
56 .flags = 0,
57 .ucon = ORIGEN_UCON_DEFAULT,
58 .ulcon = ORIGEN_ULCON_DEFAULT,
59 .ufcon = ORIGEN_UFCON_DEFAULT,
60 },
61 [2] = {
62 .hwport = 2,
63 .flags = 0,
64 .ucon = ORIGEN_UCON_DEFAULT,
65 .ulcon = ORIGEN_ULCON_DEFAULT,
66 .ufcon = ORIGEN_UFCON_DEFAULT,
67 },
68 [3] = {
69 .hwport = 3,
70 .flags = 0,
71 .ucon = ORIGEN_UCON_DEFAULT,
72 .ulcon = ORIGEN_ULCON_DEFAULT,
73 .ufcon = ORIGEN_UFCON_DEFAULT,
74 },
75};
76
77static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = {
78 .cd_type = S3C_SDHCI_CD_GPIO,
79 .ext_cd_gpio = EXYNOS4_GPK2(2),
80 .ext_cd_gpio_invert = 1,
81 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
82};
83
Sachin Kamat24f9e1f2011-08-31 15:47:16 +090084/* USB EHCI */
85static struct s5p_ehci_platdata origen_ehci_pdata;
86
87static void __init origen_ehci_init(void)
88{
89 struct s5p_ehci_platdata *pdata = &origen_ehci_pdata;
90
91 s5p_ehci_set_platdata(pdata);
92}
93
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090094static struct platform_device *origen_devices[] __initdata = {
95 &s3c_device_hsmmc2,
96 &s3c_device_rtc,
97 &s3c_device_wdt,
Sachin Kamat24f9e1f2011-08-31 15:47:16 +090098 &s5p_device_ehci,
JeongHyeon Kim699efdd2011-07-21 16:19:19 +090099};
100
101static void __init origen_map_io(void)
102{
103 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
104 s3c24xx_init_clocks(24000000);
105 s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
106}
107
108static void __init origen_machine_init(void)
109{
110 s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata);
Sachin Kamat24f9e1f2011-08-31 15:47:16 +0900111
112 origen_ehci_init();
113 clk_xusbxti.rate = 24000000;
114
JeongHyeon Kim699efdd2011-07-21 16:19:19 +0900115 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
116}
117
118MACHINE_START(ORIGEN, "ORIGEN")
119 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
120 .boot_params = S5P_PA_SDRAM + 0x100,
121 .init_irq = exynos4_init_irq,
122 .map_io = origen_map_io,
123 .init_machine = origen_machine_init,
124 .timer = &exynos4_timer,
125MACHINE_END