aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210/mach-aquila.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-08-10 18:17:52 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-08-10 18:17:52 -0400
commit0b019a41553a919965bb02d07d54e3e6c57a796d (patch)
tree6e329b4159b440d2aac5200a5c07103fe261c096 /arch/arm/mach-s5pv210/mach-aquila.c
parent5f6878b0d22f9b93f9698f88c335007e2a3c3bbc (diff)
parent054d5c9238f3c577ad51195c3ee7803613f322cc (diff)
Merge branches 'master' and 'devel' into for-linus
Conflicts: arch/arm/Kconfig arch/arm/mm/Kconfig
Diffstat (limited to 'arch/arm/mach-s5pv210/mach-aquila.c')
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c417
1 files changed, 398 insertions, 19 deletions
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 10bc76ec402..e41266419a3 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -13,6 +13,12 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/fb.h> 15#include <linux/fb.h>
16#include <linux/i2c.h>
17#include <linux/i2c-gpio.h>
18#include <linux/mfd/max8998.h>
19#include <linux/gpio_keys.h>
20#include <linux/input.h>
21#include <linux/gpio.h>
16 22
17#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 24#include <asm/mach/map.h>
@@ -23,54 +29,63 @@
23#include <mach/regs-clock.h> 29#include <mach/regs-clock.h>
24#include <mach/regs-fb.h> 30#include <mach/regs-fb.h>
25 31
32#include <plat/gpio-cfg.h>
26#include <plat/regs-serial.h> 33#include <plat/regs-serial.h>
27#include <plat/s5pv210.h> 34#include <plat/s5pv210.h>
28#include <plat/devs.h> 35#include <plat/devs.h>
29#include <plat/cpu.h> 36#include <plat/cpu.h>
30#include <plat/fb.h> 37#include <plat/fb.h>
38#include <plat/fimc-core.h>
39#include <plat/sdhci.h>
31 40
32/* Following are default values for UCON, ULCON and UFCON UART registers */ 41/* Following are default values for UCON, ULCON and UFCON UART registers */
33#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 42#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
34 S3C2410_UCON_RXILEVEL | \ 43 S3C2410_UCON_RXILEVEL | \
35 S3C2410_UCON_TXIRQMODE | \ 44 S3C2410_UCON_TXIRQMODE | \
36 S3C2410_UCON_RXIRQMODE | \ 45 S3C2410_UCON_RXIRQMODE | \
37 S3C2410_UCON_RXFIFO_TOI | \ 46 S3C2410_UCON_RXFIFO_TOI | \
38 S3C2443_UCON_RXERR_IRQEN) 47 S3C2443_UCON_RXERR_IRQEN)
39 48
40#define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8 49#define AQUILA_ULCON_DEFAULT S3C2410_LCON_CS8
41 50
42#define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ 51#define AQUILA_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
43 S5PV210_UFCON_TXTRIG4 | \
44 S5PV210_UFCON_RXTRIG4)
45 52
46static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = { 53static struct s3c2410_uartcfg aquila_uartcfgs[] __initdata = {
47 [0] = { 54 [0] = {
48 .hwport = 0, 55 .hwport = 0,
49 .flags = 0, 56 .flags = 0,
50 .ucon = S5PV210_UCON_DEFAULT, 57 .ucon = AQUILA_UCON_DEFAULT,
51 .ulcon = S5PV210_ULCON_DEFAULT, 58 .ulcon = AQUILA_ULCON_DEFAULT,
52 .ufcon = S5PV210_UFCON_DEFAULT, 59 /*
60 * Actually UART0 can support 256 bytes fifo, but aquila board
61 * supports 128 bytes fifo because of initial chip bug
62 */
63 .ufcon = AQUILA_UFCON_DEFAULT |
64 S5PV210_UFCON_TXTRIG128 | S5PV210_UFCON_RXTRIG128,
53 }, 65 },
54 [1] = { 66 [1] = {
55 .hwport = 1, 67 .hwport = 1,
56 .flags = 0, 68 .flags = 0,
57 .ucon = S5PV210_UCON_DEFAULT, 69 .ucon = AQUILA_UCON_DEFAULT,
58 .ulcon = S5PV210_ULCON_DEFAULT, 70 .ulcon = AQUILA_ULCON_DEFAULT,
59 .ufcon = S5PV210_UFCON_DEFAULT, 71 .ufcon = AQUILA_UFCON_DEFAULT |
72 S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
60 }, 73 },
61 [2] = { 74 [2] = {
62 .hwport = 2, 75 .hwport = 2,
63 .flags = 0, 76 .flags = 0,
64 .ucon = S5PV210_UCON_DEFAULT, 77 .ucon = AQUILA_UCON_DEFAULT,
65 .ulcon = S5PV210_ULCON_DEFAULT, 78 .ulcon = AQUILA_ULCON_DEFAULT,
66 .ufcon = S5PV210_UFCON_DEFAULT, 79 .ufcon = AQUILA_UFCON_DEFAULT |
80 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
67 }, 81 },
68 [3] = { 82 [3] = {
69 .hwport = 3, 83 .hwport = 3,
70 .flags = 0, 84 .flags = 0,
71 .ucon = S5PV210_UCON_DEFAULT, 85 .ucon = AQUILA_UCON_DEFAULT,
72 .ulcon = S5PV210_ULCON_DEFAULT, 86 .ulcon = AQUILA_ULCON_DEFAULT,
73 .ufcon = S5PV210_UFCON_DEFAULT, 87 .ufcon = AQUILA_UFCON_DEFAULT |
88 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
74 }, 89 },
75}; 90};
76 91
@@ -116,19 +131,383 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
116 .setup_gpio = s5pv210_fb_gpio_setup_24bpp, 131 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
117}; 132};
118 133
134/* MAX8998 regulators */
135#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
136
137static struct regulator_init_data aquila_ldo2_data = {
138 .constraints = {
139 .name = "VALIVE_1.1V",
140 .min_uV = 1100000,
141 .max_uV = 1100000,
142 .apply_uV = 1,
143 .always_on = 1,
144 .state_mem = {
145 .enabled = 1,
146 },
147 },
148};
149
150static struct regulator_init_data aquila_ldo3_data = {
151 .constraints = {
152 .name = "VUSB/MIPI_1.1V",
153 .min_uV = 1100000,
154 .max_uV = 1100000,
155 .apply_uV = 1,
156 .always_on = 1,
157 },
158};
159
160static struct regulator_init_data aquila_ldo4_data = {
161 .constraints = {
162 .name = "VDAC_3.3V",
163 .min_uV = 3300000,
164 .max_uV = 3300000,
165 .apply_uV = 1,
166 },
167};
168
169static struct regulator_init_data aquila_ldo5_data = {
170 .constraints = {
171 .name = "VTF_2.8V",
172 .min_uV = 2800000,
173 .max_uV = 2800000,
174 .apply_uV = 1,
175 },
176};
177
178static struct regulator_init_data aquila_ldo6_data = {
179 .constraints = {
180 .name = "VCC_3.3V",
181 .min_uV = 3300000,
182 .max_uV = 3300000,
183 .apply_uV = 1,
184 },
185};
186
187static struct regulator_init_data aquila_ldo7_data = {
188 .constraints = {
189 .name = "VCC_3.0V",
190 .min_uV = 3000000,
191 .max_uV = 3000000,
192 .apply_uV = 1,
193 .boot_on = 1,
194 .always_on = 1,
195 },
196};
197
198static struct regulator_init_data aquila_ldo8_data = {
199 .constraints = {
200 .name = "VUSB/VADC_3.3V",
201 .min_uV = 3300000,
202 .max_uV = 3300000,
203 .apply_uV = 1,
204 .always_on = 1,
205 },
206};
207
208static struct regulator_init_data aquila_ldo9_data = {
209 .constraints = {
210 .name = "VCC/VCAM_2.8V",
211 .min_uV = 2800000,
212 .max_uV = 2800000,
213 .apply_uV = 1,
214 .always_on = 1,
215 },
216};
217
218static struct regulator_init_data aquila_ldo10_data = {
219 .constraints = {
220 .name = "VPLL_1.1V",
221 .min_uV = 1100000,
222 .max_uV = 1100000,
223 .apply_uV = 1,
224 .boot_on = 1,
225 },
226};
227
228static struct regulator_init_data aquila_ldo11_data = {
229 .constraints = {
230 .name = "CAM_IO_2.8V",
231 .min_uV = 2800000,
232 .max_uV = 2800000,
233 .apply_uV = 1,
234 .always_on = 1,
235 },
236};
237
238static struct regulator_init_data aquila_ldo12_data = {
239 .constraints = {
240 .name = "CAM_ISP_1.2V",
241 .min_uV = 1200000,
242 .max_uV = 1200000,
243 .apply_uV = 1,
244 .always_on = 1,
245 },
246};
247
248static struct regulator_init_data aquila_ldo13_data = {
249 .constraints = {
250 .name = "CAM_A_2.8V",
251 .min_uV = 2800000,
252 .max_uV = 2800000,
253 .apply_uV = 1,
254 .always_on = 1,
255 },
256};
257
258static struct regulator_init_data aquila_ldo14_data = {
259 .constraints = {
260 .name = "CAM_CIF_1.8V",
261 .min_uV = 1800000,
262 .max_uV = 1800000,
263 .apply_uV = 1,
264 .always_on = 1,
265 },
266};
267
268static struct regulator_init_data aquila_ldo15_data = {
269 .constraints = {
270 .name = "CAM_AF_3.3V",
271 .min_uV = 3300000,
272 .max_uV = 3300000,
273 .apply_uV = 1,
274 .always_on = 1,
275 },
276};
277
278static struct regulator_init_data aquila_ldo16_data = {
279 .constraints = {
280 .name = "VMIPI_1.8V",
281 .min_uV = 1800000,
282 .max_uV = 1800000,
283 .apply_uV = 1,
284 .always_on = 1,
285 },
286};
287
288static struct regulator_init_data aquila_ldo17_data = {
289 .constraints = {
290 .name = "CAM_8M_1.8V",
291 .min_uV = 1800000,
292 .max_uV = 1800000,
293 .apply_uV = 1,
294 .always_on = 1,
295 },
296};
297
298/* BUCK */
299static struct regulator_consumer_supply buck1_consumer[] = {
300 { .supply = "vddarm", },
301};
302
303static struct regulator_consumer_supply buck2_consumer[] = {
304 { .supply = "vddint", },
305};
306
307static struct regulator_init_data aquila_buck1_data = {
308 .constraints = {
309 .name = "VARM_1.2V",
310 .min_uV = 1200000,
311 .max_uV = 1200000,
312 .apply_uV = 1,
313 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
314 REGULATOR_CHANGE_STATUS,
315 },
316 .num_consumer_supplies = ARRAY_SIZE(buck1_consumer),
317 .consumer_supplies = buck1_consumer,
318};
319
320static struct regulator_init_data aquila_buck2_data = {
321 .constraints = {
322 .name = "VINT_1.2V",
323 .min_uV = 1200000,
324 .max_uV = 1200000,
325 .apply_uV = 1,
326 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
327 REGULATOR_CHANGE_STATUS,
328 },
329 .num_consumer_supplies = ARRAY_SIZE(buck2_consumer),
330 .consumer_supplies = buck2_consumer,
331};
332
333static struct regulator_init_data aquila_buck3_data = {
334 .constraints = {
335 .name = "VCC_1.8V",
336 .min_uV = 1800000,
337 .max_uV = 1800000,
338 .apply_uV = 1,
339 .state_mem = {
340 .enabled = 1,
341 },
342 },
343};
344
345static struct regulator_init_data aquila_buck4_data = {
346 .constraints = {
347 .name = "CAM_CORE_1.2V",
348 .min_uV = 1200000,
349 .max_uV = 1200000,
350 .apply_uV = 1,
351 .always_on = 1,
352 },
353};
354
355static struct max8998_regulator_data aquila_regulators[] = {
356 { MAX8998_LDO2, &aquila_ldo2_data },
357 { MAX8998_LDO3, &aquila_ldo3_data },
358 { MAX8998_LDO4, &aquila_ldo4_data },
359 { MAX8998_LDO5, &aquila_ldo5_data },
360 { MAX8998_LDO6, &aquila_ldo6_data },
361 { MAX8998_LDO7, &aquila_ldo7_data },
362 { MAX8998_LDO8, &aquila_ldo8_data },
363 { MAX8998_LDO9, &aquila_ldo9_data },
364 { MAX8998_LDO10, &aquila_ldo10_data },
365 { MAX8998_LDO11, &aquila_ldo11_data },
366 { MAX8998_LDO12, &aquila_ldo12_data },
367 { MAX8998_LDO13, &aquila_ldo13_data },
368 { MAX8998_LDO14, &aquila_ldo14_data },
369 { MAX8998_LDO15, &aquila_ldo15_data },
370 { MAX8998_LDO16, &aquila_ldo16_data },
371 { MAX8998_LDO17, &aquila_ldo17_data },
372 { MAX8998_BUCK1, &aquila_buck1_data },
373 { MAX8998_BUCK2, &aquila_buck2_data },
374 { MAX8998_BUCK3, &aquila_buck3_data },
375 { MAX8998_BUCK4, &aquila_buck4_data },
376};
377
378static struct max8998_platform_data aquila_max8998_pdata = {
379 .num_regulators = ARRAY_SIZE(aquila_regulators),
380 .regulators = aquila_regulators,
381};
382#endif
383
384/* GPIO I2C PMIC */
385#define AP_I2C_GPIO_PMIC_BUS_4 4
386static struct i2c_gpio_platform_data aquila_i2c_gpio_pmic_data = {
387 .sda_pin = S5PV210_GPJ4(0), /* XMSMCSN */
388 .scl_pin = S5PV210_GPJ4(3), /* XMSMIRQN */
389};
390
391static struct platform_device aquila_i2c_gpio_pmic = {
392 .name = "i2c-gpio",
393 .id = AP_I2C_GPIO_PMIC_BUS_4,
394 .dev = {
395 .platform_data = &aquila_i2c_gpio_pmic_data,
396 },
397};
398
399static struct i2c_board_info i2c_gpio_pmic_devs[] __initdata = {
400#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
401 {
402 /* 0xCC when SRAD = 0 */
403 I2C_BOARD_INFO("max8998", 0xCC >> 1),
404 .platform_data = &aquila_max8998_pdata,
405 },
406#endif
407};
408
409/* PMIC Power button */
410static struct gpio_keys_button aquila_gpio_keys_table[] = {
411 {
412 .code = KEY_POWER,
413 .gpio = S5PV210_GPH2(6),
414 .desc = "gpio-keys: KEY_POWER",
415 .type = EV_KEY,
416 .active_low = 1,
417 .wakeup = 1,
418 .debounce_interval = 1,
419 },
420};
421
422static struct gpio_keys_platform_data aquila_gpio_keys_data = {
423 .buttons = aquila_gpio_keys_table,
424 .nbuttons = ARRAY_SIZE(aquila_gpio_keys_table),
425};
426
427static struct platform_device aquila_device_gpiokeys = {
428 .name = "gpio-keys",
429 .dev = {
430 .platform_data = &aquila_gpio_keys_data,
431 },
432};
433
434static void __init aquila_pmic_init(void)
435{
436 /* AP_PMIC_IRQ: EINT7 */
437 s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_SFN(0xf));
438 s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_UP);
439
440 /* nPower: EINT22 */
441 s3c_gpio_cfgpin(S5PV210_GPH2(6), S3C_GPIO_SFN(0xf));
442 s3c_gpio_setpull(S5PV210_GPH2(6), S3C_GPIO_PULL_UP);
443}
444
445/* MoviNAND */
446static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
447 .max_width = 4,
448 .cd_type = S3C_SDHCI_CD_PERMANENT,
449};
450
451/* Wireless LAN */
452static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
453 .max_width = 4,
454 .cd_type = S3C_SDHCI_CD_EXTERNAL,
455 /* ext_cd_{init,cleanup} callbacks will be added later */
456};
457
458/* External Flash */
459#define AQUILA_EXT_FLASH_EN S5PV210_MP05(4)
460#define AQUILA_EXT_FLASH_CD S5PV210_GPH3(4)
461static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
462 .max_width = 4,
463 .cd_type = S3C_SDHCI_CD_GPIO,
464 .ext_cd_gpio = AQUILA_EXT_FLASH_CD,
465 .ext_cd_gpio_invert = 1,
466};
467
468static void aquila_setup_sdhci(void)
469{
470 gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN");
471 gpio_direction_output(AQUILA_EXT_FLASH_EN, 1);
472
473 s3c_sdhci0_set_platdata(&aquila_hsmmc0_data);
474 s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
475 s3c_sdhci2_set_platdata(&aquila_hsmmc2_data);
476};
477
119static struct platform_device *aquila_devices[] __initdata = { 478static struct platform_device *aquila_devices[] __initdata = {
479 &aquila_i2c_gpio_pmic,
480 &aquila_device_gpiokeys,
120 &s3c_device_fb, 481 &s3c_device_fb,
482 &s5pc110_device_onenand,
483 &s3c_device_hsmmc0,
484 &s3c_device_hsmmc1,
485 &s3c_device_hsmmc2,
486 &s5p_device_fimc0,
487 &s5p_device_fimc1,
488 &s5p_device_fimc2,
121}; 489};
122 490
123static void __init aquila_map_io(void) 491static void __init aquila_map_io(void)
124{ 492{
125 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 493 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
126 s3c24xx_init_clocks(24000000); 494 s3c24xx_init_clocks(24000000);
127 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); 495 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
128} 496}
129 497
130static void __init aquila_machine_init(void) 498static void __init aquila_machine_init(void)
131{ 499{
500 /* PMIC */
501 aquila_pmic_init();
502 i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
503 ARRAY_SIZE(i2c_gpio_pmic_devs));
504 /* SDHCI */
505 aquila_setup_sdhci();
506
507 s3c_fimc_setname(0, "s5p-fimc");
508 s3c_fimc_setname(1, "s5p-fimc");
509 s3c_fimc_setname(2, "s5p-fimc");
510
132 /* FB */ 511 /* FB */
133 s3c_fb_set_platdata(&aquila_lcd_pdata); 512 s3c_fb_set_platdata(&aquila_lcd_pdata);
134 513