diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2011-02-28 06:39:43 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-03-04 01:18:52 -0500 |
commit | caf8b1f234f876981bf1be0fa2651a4e97203754 (patch) | |
tree | 9d5e7b26fe6243e683d00025bb796936b6cb338f /arch/arm/mach-exynos4/mach-nuri.c | |
parent | ad849a223f912bfd6c666e0414d0ff368a9dc1a7 (diff) |
ARM: EXYNOS4: Adds Samsung NURI board support
This patch adds Samsung NURI board support.
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos4/mach-nuri.c')
-rw-r--r-- | arch/arm/mach-exynos4/mach-nuri.c | 231 |
1 files changed, 231 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c new file mode 100644 index 000000000000..4767ed1e39fc --- /dev/null +++ b/arch/arm/mach-exynos4/mach-nuri.c | |||
@@ -0,0 +1,231 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-exynos4/mach-nuri.c | ||
3 | * | ||
4 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
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/platform_device.h> | ||
12 | #include <linux/serial_core.h> | ||
13 | #include <linux/input.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/gpio_keys.h> | ||
16 | #include <linux/gpio.h> | ||
17 | #include <linux/regulator/machine.h> | ||
18 | #include <linux/regulator/fixed.h> | ||
19 | #include <linux/mmc/host.h> | ||
20 | |||
21 | #include <asm/mach/arch.h> | ||
22 | #include <asm/mach-types.h> | ||
23 | |||
24 | #include <plat/regs-serial.h> | ||
25 | #include <plat/exynos4.h> | ||
26 | #include <plat/cpu.h> | ||
27 | #include <plat/devs.h> | ||
28 | #include <plat/sdhci.h> | ||
29 | |||
30 | #include <mach/map.h> | ||
31 | |||
32 | /* Following are default values for UCON, ULCON and UFCON UART registers */ | ||
33 | #define NURI_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 NURI_ULCON_DEFAULT S3C2410_LCON_CS8 | ||
41 | |||
42 | #define NURI_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ | ||
43 | S5PV210_UFCON_TXTRIG256 | \ | ||
44 | S5PV210_UFCON_RXTRIG256) | ||
45 | |||
46 | enum fixed_regulator_id { | ||
47 | FIXED_REG_ID_MMC = 0, | ||
48 | }; | ||
49 | |||
50 | static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = { | ||
51 | { | ||
52 | .hwport = 0, | ||
53 | .ucon = NURI_UCON_DEFAULT, | ||
54 | .ulcon = NURI_ULCON_DEFAULT, | ||
55 | .ufcon = NURI_UFCON_DEFAULT, | ||
56 | }, | ||
57 | { | ||
58 | .hwport = 1, | ||
59 | .ucon = NURI_UCON_DEFAULT, | ||
60 | .ulcon = NURI_ULCON_DEFAULT, | ||
61 | .ufcon = NURI_UFCON_DEFAULT, | ||
62 | }, | ||
63 | { | ||
64 | .hwport = 2, | ||
65 | .ucon = NURI_UCON_DEFAULT, | ||
66 | .ulcon = NURI_ULCON_DEFAULT, | ||
67 | .ufcon = NURI_UFCON_DEFAULT, | ||
68 | }, | ||
69 | { | ||
70 | .hwport = 3, | ||
71 | .ucon = NURI_UCON_DEFAULT, | ||
72 | .ulcon = NURI_ULCON_DEFAULT, | ||
73 | .ufcon = NURI_UFCON_DEFAULT, | ||
74 | }, | ||
75 | }; | ||
76 | |||
77 | /* eMMC */ | ||
78 | static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = { | ||
79 | .max_width = 8, | ||
80 | .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA | | ||
81 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | | ||
82 | MMC_CAP_DISABLE | MMC_CAP_ERASE), | ||
83 | .cd_type = S3C_SDHCI_CD_PERMANENT, | ||
84 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, | ||
85 | }; | ||
86 | |||
87 | static struct regulator_consumer_supply emmc_supplies[] = { | ||
88 | REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), | ||
89 | REGULATOR_SUPPLY("vmmc", "dw_mmc"), | ||
90 | }; | ||
91 | |||
92 | static struct regulator_init_data emmc_fixed_voltage_init_data = { | ||
93 | .constraints = { | ||
94 | .name = "VMEM_VDD_2.8V", | ||
95 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
96 | }, | ||
97 | .num_consumer_supplies = ARRAY_SIZE(emmc_supplies), | ||
98 | .consumer_supplies = emmc_supplies, | ||
99 | }; | ||
100 | |||
101 | static struct fixed_voltage_config emmc_fixed_voltage_config = { | ||
102 | .supply_name = "MASSMEMORY_EN (inverted)", | ||
103 | .microvolts = 2800000, | ||
104 | .gpio = EXYNOS4_GPL1(1), | ||
105 | .enable_high = false, | ||
106 | .init_data = &emmc_fixed_voltage_init_data, | ||
107 | }; | ||
108 | |||
109 | static struct platform_device emmc_fixed_voltage = { | ||
110 | .name = "reg-fixed-voltage", | ||
111 | .id = FIXED_REG_ID_MMC, | ||
112 | .dev = { | ||
113 | .platform_data = &emmc_fixed_voltage_config, | ||
114 | }, | ||
115 | }; | ||
116 | |||
117 | /* SD */ | ||
118 | static struct s3c_sdhci_platdata nuri_hsmmc2_data __initdata = { | ||
119 | .max_width = 4, | ||
120 | .host_caps = MMC_CAP_4_BIT_DATA | | ||
121 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | | ||
122 | MMC_CAP_DISABLE, | ||
123 | .ext_cd_gpio = EXYNOS4_GPX3(3), /* XEINT_27 */ | ||
124 | .ext_cd_gpio_invert = 1, | ||
125 | .cd_type = S3C_SDHCI_CD_GPIO, | ||
126 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, | ||
127 | }; | ||
128 | |||
129 | /* WLAN */ | ||
130 | static struct s3c_sdhci_platdata nuri_hsmmc3_data __initdata = { | ||
131 | .max_width = 4, | ||
132 | .host_caps = MMC_CAP_4_BIT_DATA | | ||
133 | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | ||
134 | .cd_type = S3C_SDHCI_CD_EXTERNAL, | ||
135 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, | ||
136 | }; | ||
137 | |||
138 | static void __init nuri_sdhci_init(void) | ||
139 | { | ||
140 | s3c_sdhci0_set_platdata(&nuri_hsmmc0_data); | ||
141 | s3c_sdhci2_set_platdata(&nuri_hsmmc2_data); | ||
142 | s3c_sdhci3_set_platdata(&nuri_hsmmc3_data); | ||
143 | } | ||
144 | |||
145 | /* GPIO KEYS */ | ||
146 | static struct gpio_keys_button nuri_gpio_keys_tables[] = { | ||
147 | { | ||
148 | .code = KEY_VOLUMEUP, | ||
149 | .gpio = EXYNOS4_GPX2(0), /* XEINT16 */ | ||
150 | .desc = "gpio-keys: KEY_VOLUMEUP", | ||
151 | .type = EV_KEY, | ||
152 | .active_low = 1, | ||
153 | .debounce_interval = 1, | ||
154 | }, { | ||
155 | .code = KEY_VOLUMEDOWN, | ||
156 | .gpio = EXYNOS4_GPX2(1), /* XEINT17 */ | ||
157 | .desc = "gpio-keys: KEY_VOLUMEDOWN", | ||
158 | .type = EV_KEY, | ||
159 | .active_low = 1, | ||
160 | .debounce_interval = 1, | ||
161 | }, { | ||
162 | .code = KEY_POWER, | ||
163 | .gpio = EXYNOS4_GPX2(7), /* XEINT23 */ | ||
164 | .desc = "gpio-keys: KEY_POWER", | ||
165 | .type = EV_KEY, | ||
166 | .active_low = 1, | ||
167 | .wakeup = 1, | ||
168 | .debounce_interval = 1, | ||
169 | }, | ||
170 | }; | ||
171 | |||
172 | static struct gpio_keys_platform_data nuri_gpio_keys_data = { | ||
173 | .buttons = nuri_gpio_keys_tables, | ||
174 | .nbuttons = ARRAY_SIZE(nuri_gpio_keys_tables), | ||
175 | }; | ||
176 | |||
177 | static struct platform_device nuri_gpio_keys = { | ||
178 | .name = "gpio-keys", | ||
179 | .dev = { | ||
180 | .platform_data = &nuri_gpio_keys_data, | ||
181 | }, | ||
182 | }; | ||
183 | |||
184 | /* I2C1 */ | ||
185 | static struct i2c_board_info i2c1_devs[] __initdata = { | ||
186 | /* Gyro, To be updated */ | ||
187 | }; | ||
188 | |||
189 | /* GPIO I2C 5 (PMIC) */ | ||
190 | static struct i2c_board_info i2c5_devs[] __initdata = { | ||
191 | /* max8997, To be updated */ | ||
192 | }; | ||
193 | |||
194 | static struct platform_device *nuri_devices[] __initdata = { | ||
195 | /* Samsung Platform Devices */ | ||
196 | &emmc_fixed_voltage, | ||
197 | &s3c_device_hsmmc0, | ||
198 | &s3c_device_hsmmc2, | ||
199 | &s3c_device_hsmmc3, | ||
200 | &s3c_device_wdt, | ||
201 | |||
202 | /* NURI Devices */ | ||
203 | &nuri_gpio_keys, | ||
204 | }; | ||
205 | |||
206 | static void __init nuri_map_io(void) | ||
207 | { | ||
208 | s5p_init_io(NULL, 0, S5P_VA_CHIPID); | ||
209 | s3c24xx_init_clocks(24000000); | ||
210 | s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs)); | ||
211 | } | ||
212 | |||
213 | static void __init nuri_machine_init(void) | ||
214 | { | ||
215 | nuri_sdhci_init(); | ||
216 | |||
217 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | ||
218 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | ||
219 | |||
220 | /* Last */ | ||
221 | platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); | ||
222 | } | ||
223 | |||
224 | MACHINE_START(NURI, "NURI") | ||
225 | /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ | ||
226 | .boot_params = S5P_PA_SDRAM + 0x100, | ||
227 | .init_irq = exynos4_init_irq, | ||
228 | .map_io = nuri_map_io, | ||
229 | .init_machine = nuri_machine_init, | ||
230 | .timer = &exynos4_timer, | ||
231 | MACHINE_END | ||