blob: 557add4fc56cdad3d8d953733c25c73844e6d9c8 [file] [log] [blame]
Marek Szyprowskid947e792010-05-17 08:53:10 +02001/* linux/arch/arm/mach-s5pv210/mach-aquila.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
Marek Szyprowskib3150322010-05-17 08:53:13 +020015#include <linux/fb.h>
Marek Szyprowskia1660c12010-07-14 18:33:44 +090016#include <linux/i2c.h>
17#include <linux/i2c-gpio.h>
18#include <linux/mfd/max8998.h>
Chanwoo Choi80849792010-10-14 17:25:57 +090019#include <linux/mfd/wm8994/pdata.h>
20#include <linux/regulator/fixed.h>
Marek Szyprowskia1660c12010-07-14 18:33:44 +090021#include <linux/gpio_keys.h>
22#include <linux/input.h>
23#include <linux/gpio.h>
Marek Szyprowskid947e792010-05-17 08:53:10 +020024
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h>
27#include <asm/setup.h>
28#include <asm/mach-types.h>
29
30#include <mach/map.h>
31#include <mach/regs-clock.h>
Marek Szyprowskib3150322010-05-17 08:53:13 +020032#include <mach/regs-fb.h>
Marek Szyprowskid947e792010-05-17 08:53:10 +020033
Marek Szyprowskia1660c12010-07-14 18:33:44 +090034#include <plat/gpio-cfg.h>
Marek Szyprowskid947e792010-05-17 08:53:10 +020035#include <plat/regs-serial.h>
36#include <plat/s5pv210.h>
37#include <plat/devs.h>
38#include <plat/cpu.h>
Marek Szyprowskib3150322010-05-17 08:53:13 +020039#include <plat/fb.h>
Sylwester Nawrocki187749b2010-08-09 16:55:35 +090040#include <plat/fimc-core.h>
Marek Szyprowskiba3fbef92010-08-05 18:00:12 +090041#include <plat/sdhci.h>
Marek Szyprowskid947e792010-05-17 08:53:10 +020042
43/* Following are default values for UCON, ULCON and UFCON UART registers */
Kukjin Kimc8def082010-07-21 09:19:51 +090044#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
Marek Szyprowskid947e792010-05-17 08:53:10 +020045 S3C2410_UCON_RXILEVEL | \
46 S3C2410_UCON_TXIRQMODE | \
47 S3C2410_UCON_RXIRQMODE | \
48 S3C2410_UCON_RXFIFO_TOI | \
49 S3C2443_UCON_RXERR_IRQEN)
50
Kukjin Kimc8def082010-07-21 09:19:51 +090051#define AQUILA_ULCON_DEFAULT S3C2410_LCON_CS8
Marek Szyprowskid947e792010-05-17 08:53:10 +020052
Kukjin Kimf2b7e3c2010-08-06 21:34:55 +090053#define AQUILA_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
Marek Szyprowskid947e792010-05-17 08:53:10 +020054
Joonyoung Shimdf017142010-06-24 19:28:55 +090055static struct s3c2410_uartcfg aquila_uartcfgs[] __initdata = {
Marek Szyprowskid947e792010-05-17 08:53:10 +020056 [0] = {
57 .hwport = 0,
58 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090059 .ucon = AQUILA_UCON_DEFAULT,
60 .ulcon = AQUILA_ULCON_DEFAULT,
Joonyoung Shimdf017142010-06-24 19:28:55 +090061 /*
62 * Actually UART0 can support 256 bytes fifo, but aquila board
63 * supports 128 bytes fifo because of initial chip bug
64 */
Kukjin Kimf2b7e3c2010-08-06 21:34:55 +090065 .ufcon = AQUILA_UFCON_DEFAULT |
Joonyoung Shimdf017142010-06-24 19:28:55 +090066 S5PV210_UFCON_TXTRIG128 | S5PV210_UFCON_RXTRIG128,
Marek Szyprowskid947e792010-05-17 08:53:10 +020067 },
68 [1] = {
69 .hwport = 1,
70 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090071 .ucon = AQUILA_UCON_DEFAULT,
72 .ulcon = AQUILA_ULCON_DEFAULT,
Kukjin Kimf2b7e3c2010-08-06 21:34:55 +090073 .ufcon = AQUILA_UFCON_DEFAULT |
Joonyoung Shimdf017142010-06-24 19:28:55 +090074 S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
Marek Szyprowskid947e792010-05-17 08:53:10 +020075 },
76 [2] = {
77 .hwport = 2,
78 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090079 .ucon = AQUILA_UCON_DEFAULT,
80 .ulcon = AQUILA_ULCON_DEFAULT,
Kukjin Kimf2b7e3c2010-08-06 21:34:55 +090081 .ufcon = AQUILA_UFCON_DEFAULT |
Joonyoung Shimdf017142010-06-24 19:28:55 +090082 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
Marek Szyprowskid947e792010-05-17 08:53:10 +020083 },
84 [3] = {
85 .hwport = 3,
86 .flags = 0,
Kukjin Kimc8def082010-07-21 09:19:51 +090087 .ucon = AQUILA_UCON_DEFAULT,
88 .ulcon = AQUILA_ULCON_DEFAULT,
Kukjin Kimf2b7e3c2010-08-06 21:34:55 +090089 .ufcon = AQUILA_UFCON_DEFAULT |
Joonyoung Shimdf017142010-06-24 19:28:55 +090090 S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
Marek Szyprowskid947e792010-05-17 08:53:10 +020091 },
92};
93
Marek Szyprowskib3150322010-05-17 08:53:13 +020094/* Frame Buffer */
95static struct s3c_fb_pd_win aquila_fb_win0 = {
96 .win_mode = {
Marek Szyprowskib3150322010-05-17 08:53:13 +020097 .left_margin = 16,
98 .right_margin = 16,
99 .upper_margin = 3,
100 .lower_margin = 28,
101 .hsync_len = 2,
102 .vsync_len = 2,
103 .xres = 480,
104 .yres = 800,
105 },
106 .max_bpp = 32,
107 .default_bpp = 16,
108};
109
110static struct s3c_fb_pd_win aquila_fb_win1 = {
111 .win_mode = {
Marek Szyprowskib3150322010-05-17 08:53:13 +0200112 .left_margin = 16,
113 .right_margin = 16,
114 .upper_margin = 3,
115 .lower_margin = 28,
116 .hsync_len = 2,
117 .vsync_len = 2,
118 .xres = 480,
119 .yres = 800,
120 },
121 .max_bpp = 32,
122 .default_bpp = 16,
123};
124
125static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
126 .win[0] = &aquila_fb_win0,
127 .win[1] = &aquila_fb_win1,
128 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
129 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
130 VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
131 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
132};
133
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900134/* 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 = {
Marek Szyprowskid1061332011-02-18 17:51:43 +0900152 .name = "VUSB+MIPI_1.1V",
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900153 .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 = {
Marek Szyprowskid1061332011-02-18 17:51:43 +0900200 .name = "VUSB+VADC_3.3V",
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900201 .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 = {
Marek Szyprowskid1061332011-02-18 17:51:43 +0900210 .name = "VCC+VCAM_2.8V",
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900211 .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,
Marek Szyprowskicb186882010-12-17 14:47:42 +0900381 .buck1_set1 = S5PV210_GPH0(3),
382 .buck1_set2 = S5PV210_GPH0(4),
383 .buck2_set3 = S5PV210_GPH0(5),
Marek Szyprowski979f3952011-02-18 17:47:34 +0900384 .buck1_voltage1 = 1200000,
385 .buck1_voltage2 = 1200000,
386 .buck1_voltage3 = 1200000,
387 .buck1_voltage4 = 1200000,
388 .buck2_voltage1 = 1200000,
389 .buck2_voltage2 = 1200000,
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900390};
391#endif
392
Chanwoo Choi80849792010-10-14 17:25:57 +0900393static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
394 {
395 .dev_name = "5-001a",
396 .supply = "DBVDD",
397 }, {
398 .dev_name = "5-001a",
399 .supply = "AVDD2",
400 }, {
401 .dev_name = "5-001a",
402 .supply = "CPVDD",
403 },
404};
405
406static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
407 {
408 .dev_name = "5-001a",
409 .supply = "SPKVDD1",
410 }, {
411 .dev_name = "5-001a",
412 .supply = "SPKVDD2",
413 },
414};
415
416static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
417 .constraints = {
418 .always_on = 1,
419 },
420 .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies),
421 .consumer_supplies = wm8994_fixed_voltage0_supplies,
422};
423
424static struct regulator_init_data wm8994_fixed_voltage1_init_data = {
425 .constraints = {
426 .always_on = 1,
427 },
428 .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies),
429 .consumer_supplies = wm8994_fixed_voltage1_supplies,
430};
431
432static struct fixed_voltage_config wm8994_fixed_voltage0_config = {
433 .supply_name = "VCC_1.8V_PDA",
434 .microvolts = 1800000,
435 .gpio = -EINVAL,
436 .init_data = &wm8994_fixed_voltage0_init_data,
437};
438
439static struct fixed_voltage_config wm8994_fixed_voltage1_config = {
440 .supply_name = "V_BAT",
441 .microvolts = 3700000,
442 .gpio = -EINVAL,
443 .init_data = &wm8994_fixed_voltage1_init_data,
444};
445
446static struct platform_device wm8994_fixed_voltage0 = {
447 .name = "reg-fixed-voltage",
448 .id = 0,
449 .dev = {
450 .platform_data = &wm8994_fixed_voltage0_config,
451 },
452};
453
454static struct platform_device wm8994_fixed_voltage1 = {
455 .name = "reg-fixed-voltage",
456 .id = 1,
457 .dev = {
458 .platform_data = &wm8994_fixed_voltage1_config,
459 },
460};
461
462static struct regulator_consumer_supply wm8994_avdd1_supply = {
463 .dev_name = "5-001a",
464 .supply = "AVDD1",
465};
466
467static struct regulator_consumer_supply wm8994_dcvdd_supply = {
468 .dev_name = "5-001a",
469 .supply = "DCVDD",
470};
471
472static struct regulator_init_data wm8994_ldo1_data = {
473 .constraints = {
474 .name = "AVDD1_3.0V",
475 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
476 },
477 .num_consumer_supplies = 1,
478 .consumer_supplies = &wm8994_avdd1_supply,
479};
480
481static struct regulator_init_data wm8994_ldo2_data = {
482 .constraints = {
483 .name = "DCVDD_1.0V",
484 },
485 .num_consumer_supplies = 1,
486 .consumer_supplies = &wm8994_dcvdd_supply,
487};
488
489static struct wm8994_pdata wm8994_platform_data = {
490 /* configure gpio1 function: 0x0001(Logic level input/output) */
491 .gpio_defaults[0] = 0x0001,
492 /* configure gpio3/4/5/7 function for AIF2 voice */
493 .gpio_defaults[2] = 0x8100,
494 .gpio_defaults[3] = 0x8100,
495 .gpio_defaults[4] = 0x8100,
496 .gpio_defaults[6] = 0x0100,
497 /* configure gpio8/9/10/11 function for AIF3 BT */
498 .gpio_defaults[7] = 0x8100,
499 .gpio_defaults[8] = 0x0100,
500 .gpio_defaults[9] = 0x0100,
501 .gpio_defaults[10] = 0x0100,
502 .ldo[0] = { S5PV210_MP03(6), NULL, &wm8994_ldo1_data }, /* XM0FRNB_2 */
503 .ldo[1] = { 0, NULL, &wm8994_ldo2_data },
504};
505
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900506/* GPIO I2C PMIC */
507#define AP_I2C_GPIO_PMIC_BUS_4 4
508static struct i2c_gpio_platform_data aquila_i2c_gpio_pmic_data = {
509 .sda_pin = S5PV210_GPJ4(0), /* XMSMCSN */
510 .scl_pin = S5PV210_GPJ4(3), /* XMSMIRQN */
511};
512
513static struct platform_device aquila_i2c_gpio_pmic = {
514 .name = "i2c-gpio",
515 .id = AP_I2C_GPIO_PMIC_BUS_4,
516 .dev = {
517 .platform_data = &aquila_i2c_gpio_pmic_data,
518 },
519};
520
521static struct i2c_board_info i2c_gpio_pmic_devs[] __initdata = {
522#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
523 {
524 /* 0xCC when SRAD = 0 */
525 I2C_BOARD_INFO("max8998", 0xCC >> 1),
526 .platform_data = &aquila_max8998_pdata,
527 },
528#endif
529};
530
Chanwoo Choi51122672010-10-14 15:02:44 +0900531/* GPIO I2C AP 1.8V */
532#define AP_I2C_GPIO_BUS_5 5
533static struct i2c_gpio_platform_data aquila_i2c_gpio5_data = {
534 .sda_pin = S5PV210_MP05(3), /* XM0ADDR_11 */
535 .scl_pin = S5PV210_MP05(2), /* XM0ADDR_10 */
536};
537
538static struct platform_device aquila_i2c_gpio5 = {
539 .name = "i2c-gpio",
540 .id = AP_I2C_GPIO_BUS_5,
541 .dev = {
542 .platform_data = &aquila_i2c_gpio5_data,
543 },
544};
545
546static struct i2c_board_info i2c_gpio5_devs[] __initdata = {
547 {
548 /* CS/ADDR = low 0x34 (FYI: high = 0x36) */
549 I2C_BOARD_INFO("wm8994", 0x1a),
Chanwoo Choi80849792010-10-14 17:25:57 +0900550 .platform_data = &wm8994_platform_data,
Chanwoo Choi51122672010-10-14 15:02:44 +0900551 },
552};
553
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900554/* PMIC Power button */
555static struct gpio_keys_button aquila_gpio_keys_table[] = {
556 {
557 .code = KEY_POWER,
558 .gpio = S5PV210_GPH2(6),
559 .desc = "gpio-keys: KEY_POWER",
560 .type = EV_KEY,
561 .active_low = 1,
562 .wakeup = 1,
563 .debounce_interval = 1,
564 },
565};
566
567static struct gpio_keys_platform_data aquila_gpio_keys_data = {
568 .buttons = aquila_gpio_keys_table,
569 .nbuttons = ARRAY_SIZE(aquila_gpio_keys_table),
570};
571
572static struct platform_device aquila_device_gpiokeys = {
573 .name = "gpio-keys",
574 .dev = {
575 .platform_data = &aquila_gpio_keys_data,
576 },
577};
578
579static void __init aquila_pmic_init(void)
580{
581 /* AP_PMIC_IRQ: EINT7 */
582 s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_SFN(0xf));
583 s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_UP);
584
585 /* nPower: EINT22 */
586 s3c_gpio_cfgpin(S5PV210_GPH2(6), S3C_GPIO_SFN(0xf));
587 s3c_gpio_setpull(S5PV210_GPH2(6), S3C_GPIO_PULL_UP);
588}
589
Marek Szyprowskiba3fbef92010-08-05 18:00:12 +0900590/* MoviNAND */
591static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
592 .max_width = 4,
593 .cd_type = S3C_SDHCI_CD_PERMANENT,
594};
595
596/* Wireless LAN */
597static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
598 .max_width = 4,
599 .cd_type = S3C_SDHCI_CD_EXTERNAL,
600 /* ext_cd_{init,cleanup} callbacks will be added later */
601};
602
603/* External Flash */
604#define AQUILA_EXT_FLASH_EN S5PV210_MP05(4)
605#define AQUILA_EXT_FLASH_CD S5PV210_GPH3(4)
606static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
607 .max_width = 4,
608 .cd_type = S3C_SDHCI_CD_GPIO,
609 .ext_cd_gpio = AQUILA_EXT_FLASH_CD,
610 .ext_cd_gpio_invert = 1,
611};
612
613static void aquila_setup_sdhci(void)
614{
615 gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN");
616 gpio_direction_output(AQUILA_EXT_FLASH_EN, 1);
617
618 s3c_sdhci0_set_platdata(&aquila_hsmmc0_data);
619 s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
620 s3c_sdhci2_set_platdata(&aquila_hsmmc2_data);
621};
622
Marek Szyprowskid947e792010-05-17 08:53:10 +0200623static struct platform_device *aquila_devices[] __initdata = {
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900624 &aquila_i2c_gpio_pmic,
Chanwoo Choi51122672010-10-14 15:02:44 +0900625 &aquila_i2c_gpio5,
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900626 &aquila_device_gpiokeys,
Marek Szyprowskib3150322010-05-17 08:53:13 +0200627 &s3c_device_fb,
Kukjin Kim13904fb2010-08-27 13:56:54 +0900628 &s5p_device_onenand,
Marek Szyprowskiba3fbef92010-08-05 18:00:12 +0900629 &s3c_device_hsmmc0,
630 &s3c_device_hsmmc1,
631 &s3c_device_hsmmc2,
Sylwester Nawrocki7200c112010-08-09 16:55:24 +0900632 &s5p_device_fimc0,
633 &s5p_device_fimc1,
634 &s5p_device_fimc2,
Chanwoo Choi6c29e712010-10-14 16:00:42 +0900635 &s5pv210_device_iis0,
Chanwoo Choi80849792010-10-14 17:25:57 +0900636 &wm8994_fixed_voltage0,
637 &wm8994_fixed_voltage1,
Marek Szyprowskid947e792010-05-17 08:53:10 +0200638};
639
Chanwoo Choi6c29e712010-10-14 16:00:42 +0900640static void __init aquila_sound_init(void)
641{
642 unsigned int gpio;
643
644 /* CODEC_XTAL_EN
645 *
646 * The Aquila board have a oscillator which provide main clock
647 * to WM8994 codec. The oscillator provide 24MHz clock to WM8994
648 * clock. Set gpio setting of "CODEC_XTAL_EN" to enable a oscillator.
649 * */
650 gpio = S5PV210_GPH3(2); /* XEINT_26 */
651 gpio_request(gpio, "CODEC_XTAL_EN");
652 s3c_gpio_cfgpin(gpio, S3C_GPIO_OUTPUT);
653 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
654
655 /* Ths main clock of WM8994 codec uses the output of CLKOUT pin.
656 * The CLKOUT[9:8] set to 0x3(XUSBXTI) of 0xE010E000(OTHERS)
657 * because it needs 24MHz clock to operate WM8994 codec.
658 */
659 __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS);
660}
661
Marek Szyprowskid947e792010-05-17 08:53:10 +0200662static void __init aquila_map_io(void)
663{
664 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
665 s3c24xx_init_clocks(24000000);
Joonyoung Shimdf017142010-06-24 19:28:55 +0900666 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
Marek Szyprowskid947e792010-05-17 08:53:10 +0200667}
668
669static void __init aquila_machine_init(void)
670{
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900671 /* PMIC */
672 aquila_pmic_init();
673 i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
674 ARRAY_SIZE(i2c_gpio_pmic_devs));
Marek Szyprowskiba3fbef92010-08-05 18:00:12 +0900675 /* SDHCI */
676 aquila_setup_sdhci();
Marek Szyprowskia1660c12010-07-14 18:33:44 +0900677
Sylwester Nawrocki187749b2010-08-09 16:55:35 +0900678 s3c_fimc_setname(0, "s5p-fimc");
679 s3c_fimc_setname(1, "s5p-fimc");
680 s3c_fimc_setname(2, "s5p-fimc");
681
Chanwoo Choi51122672010-10-14 15:02:44 +0900682 /* SOUND */
Chanwoo Choi6c29e712010-10-14 16:00:42 +0900683 aquila_sound_init();
Chanwoo Choi51122672010-10-14 15:02:44 +0900684 i2c_register_board_info(AP_I2C_GPIO_BUS_5, i2c_gpio5_devs,
685 ARRAY_SIZE(i2c_gpio5_devs));
686
Marek Szyprowskib3150322010-05-17 08:53:13 +0200687 /* FB */
688 s3c_fb_set_platdata(&aquila_lcd_pdata);
689
Marek Szyprowskid947e792010-05-17 08:53:10 +0200690 platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
691}
692
693MACHINE_START(AQUILA, "Aquila")
694 /* Maintainers:
695 Marek Szyprowski <m.szyprowski@samsung.com>
696 Kyungmin Park <kyungmin.park@samsung.com> */
Marek Szyprowskid947e792010-05-17 08:53:10 +0200697 .boot_params = S5P_PA_SDRAM + 0x100,
698 .init_irq = s5pv210_init_irq,
699 .map_io = aquila_map_io,
700 .init_machine = aquila_machine_init,
701 .timer = &s3c24xx_timer,
702MACHINE_END