mach-aquila.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. /* 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. #include <linux/kernel.h>
  11. #include <linux/types.h>
  12. #include <linux/init.h>
  13. #include <linux/serial_core.h>
  14. #include <linux/fb.h>
  15. #include <linux/i2c.h>
  16. #include <linux/i2c-gpio.h>
  17. #include <linux/mfd/max8998.h>
  18. #include <linux/mfd/wm8994/pdata.h>
  19. #include <linux/regulator/fixed.h>
  20. #include <linux/gpio_keys.h>
  21. #include <linux/input.h>
  22. #include <linux/gpio.h>
  23. #include <asm/hardware/vic.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/map.h>
  26. #include <asm/setup.h>
  27. #include <asm/mach-types.h>
  28. #include <video/samsung_fimd.h>
  29. #include <mach/map.h>
  30. #include <mach/regs-clock.h>
  31. #include <plat/gpio-cfg.h>
  32. #include <plat/regs-serial.h>
  33. #include <plat/devs.h>
  34. #include <plat/cpu.h>
  35. #include <plat/fb.h>
  36. #include <plat/fimc-core.h>
  37. #include <plat/sdhci.h>
  38. #include <plat/s5p-time.h>
  39. #include "common.h"
  40. /* Following are default values for UCON, ULCON and UFCON UART registers */
  41. #define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  42. S3C2410_UCON_RXILEVEL | \
  43. S3C2410_UCON_TXIRQMODE | \
  44. S3C2410_UCON_RXIRQMODE | \
  45. S3C2410_UCON_RXFIFO_TOI | \
  46. S3C2443_UCON_RXERR_IRQEN)
  47. #define AQUILA_ULCON_DEFAULT S3C2410_LCON_CS8
  48. #define AQUILA_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
  49. static struct s3c2410_uartcfg aquila_uartcfgs[] __initdata = {
  50. [0] = {
  51. .hwport = 0,
  52. .flags = 0,
  53. .ucon = AQUILA_UCON_DEFAULT,
  54. .ulcon = AQUILA_ULCON_DEFAULT,
  55. /*
  56. * Actually UART0 can support 256 bytes fifo, but aquila board
  57. * supports 128 bytes fifo because of initial chip bug
  58. */
  59. .ufcon = AQUILA_UFCON_DEFAULT |
  60. S5PV210_UFCON_TXTRIG128 | S5PV210_UFCON_RXTRIG128,
  61. },
  62. [1] = {
  63. .hwport = 1,
  64. .flags = 0,
  65. .ucon = AQUILA_UCON_DEFAULT,
  66. .ulcon = AQUILA_ULCON_DEFAULT,
  67. .ufcon = AQUILA_UFCON_DEFAULT |
  68. S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
  69. },
  70. [2] = {
  71. .hwport = 2,
  72. .flags = 0,
  73. .ucon = AQUILA_UCON_DEFAULT,
  74. .ulcon = AQUILA_ULCON_DEFAULT,
  75. .ufcon = AQUILA_UFCON_DEFAULT |
  76. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  77. },
  78. [3] = {
  79. .hwport = 3,
  80. .flags = 0,
  81. .ucon = AQUILA_UCON_DEFAULT,
  82. .ulcon = AQUILA_ULCON_DEFAULT,
  83. .ufcon = AQUILA_UFCON_DEFAULT |
  84. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  85. },
  86. };
  87. /* Frame Buffer */
  88. static struct s3c_fb_pd_win aquila_fb_win0 = {
  89. .max_bpp = 32,
  90. .default_bpp = 16,
  91. .xres = 480,
  92. .yres = 800,
  93. };
  94. static struct s3c_fb_pd_win aquila_fb_win1 = {
  95. .max_bpp = 32,
  96. .default_bpp = 16,
  97. .xres = 480,
  98. .yres = 800,
  99. };
  100. static struct fb_videomode aquila_lcd_timing = {
  101. .left_margin = 16,
  102. .right_margin = 16,
  103. .upper_margin = 3,
  104. .lower_margin = 28,
  105. .hsync_len = 2,
  106. .vsync_len = 2,
  107. .xres = 480,
  108. .yres = 800,
  109. };
  110. static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
  111. .win[0] = &aquila_fb_win0,
  112. .win[1] = &aquila_fb_win1,
  113. .vtiming = &aquila_lcd_timing,
  114. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
  115. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
  116. VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
  117. .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
  118. };
  119. /* MAX8998 regulators */
  120. #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
  121. static struct regulator_init_data aquila_ldo2_data = {
  122. .constraints = {
  123. .name = "VALIVE_1.1V",
  124. .min_uV = 1100000,
  125. .max_uV = 1100000,
  126. .apply_uV = 1,
  127. .always_on = 1,
  128. .state_mem = {
  129. .enabled = 1,
  130. },
  131. },
  132. };
  133. static struct regulator_init_data aquila_ldo3_data = {
  134. .constraints = {
  135. .name = "VUSB+MIPI_1.1V",
  136. .min_uV = 1100000,
  137. .max_uV = 1100000,
  138. .apply_uV = 1,
  139. .always_on = 1,
  140. },
  141. };
  142. static struct regulator_init_data aquila_ldo4_data = {
  143. .constraints = {
  144. .name = "VDAC_3.3V",
  145. .min_uV = 3300000,
  146. .max_uV = 3300000,
  147. .apply_uV = 1,
  148. },
  149. };
  150. static struct regulator_init_data aquila_ldo5_data = {
  151. .constraints = {
  152. .name = "VTF_2.8V",
  153. .min_uV = 2800000,
  154. .max_uV = 2800000,
  155. .apply_uV = 1,
  156. },
  157. };
  158. static struct regulator_init_data aquila_ldo6_data = {
  159. .constraints = {
  160. .name = "VCC_3.3V",
  161. .min_uV = 3300000,
  162. .max_uV = 3300000,
  163. .apply_uV = 1,
  164. },
  165. };
  166. static struct regulator_init_data aquila_ldo7_data = {
  167. .constraints = {
  168. .name = "VCC_3.0V",
  169. .min_uV = 3000000,
  170. .max_uV = 3000000,
  171. .apply_uV = 1,
  172. .boot_on = 1,
  173. .always_on = 1,
  174. },
  175. };
  176. static struct regulator_init_data aquila_ldo8_data = {
  177. .constraints = {
  178. .name = "VUSB+VADC_3.3V",
  179. .min_uV = 3300000,
  180. .max_uV = 3300000,
  181. .apply_uV = 1,
  182. .always_on = 1,
  183. },
  184. };
  185. static struct regulator_init_data aquila_ldo9_data = {
  186. .constraints = {
  187. .name = "VCC+VCAM_2.8V",
  188. .min_uV = 2800000,
  189. .max_uV = 2800000,
  190. .apply_uV = 1,
  191. .always_on = 1,
  192. },
  193. };
  194. static struct regulator_init_data aquila_ldo10_data = {
  195. .constraints = {
  196. .name = "VPLL_1.1V",
  197. .min_uV = 1100000,
  198. .max_uV = 1100000,
  199. .apply_uV = 1,
  200. .boot_on = 1,
  201. },
  202. };
  203. static struct regulator_init_data aquila_ldo11_data = {
  204. .constraints = {
  205. .name = "CAM_IO_2.8V",
  206. .min_uV = 2800000,
  207. .max_uV = 2800000,
  208. .apply_uV = 1,
  209. .always_on = 1,
  210. },
  211. };
  212. static struct regulator_init_data aquila_ldo12_data = {
  213. .constraints = {
  214. .name = "CAM_ISP_1.2V",
  215. .min_uV = 1200000,
  216. .max_uV = 1200000,
  217. .apply_uV = 1,
  218. .always_on = 1,
  219. },
  220. };
  221. static struct regulator_init_data aquila_ldo13_data = {
  222. .constraints = {
  223. .name = "CAM_A_2.8V",
  224. .min_uV = 2800000,
  225. .max_uV = 2800000,
  226. .apply_uV = 1,
  227. .always_on = 1,
  228. },
  229. };
  230. static struct regulator_init_data aquila_ldo14_data = {
  231. .constraints = {
  232. .name = "CAM_CIF_1.8V",
  233. .min_uV = 1800000,
  234. .max_uV = 1800000,
  235. .apply_uV = 1,
  236. .always_on = 1,
  237. },
  238. };
  239. static struct regulator_init_data aquila_ldo15_data = {
  240. .constraints = {
  241. .name = "CAM_AF_3.3V",
  242. .min_uV = 3300000,
  243. .max_uV = 3300000,
  244. .apply_uV = 1,
  245. .always_on = 1,
  246. },
  247. };
  248. static struct regulator_init_data aquila_ldo16_data = {
  249. .constraints = {
  250. .name = "VMIPI_1.8V",
  251. .min_uV = 1800000,
  252. .max_uV = 1800000,
  253. .apply_uV = 1,
  254. .always_on = 1,
  255. },
  256. };
  257. static struct regulator_init_data aquila_ldo17_data = {
  258. .constraints = {
  259. .name = "CAM_8M_1.8V",
  260. .min_uV = 1800000,
  261. .max_uV = 1800000,
  262. .apply_uV = 1,
  263. .always_on = 1,
  264. },
  265. };
  266. /* BUCK */
  267. static struct regulator_consumer_supply buck1_consumer =
  268. REGULATOR_SUPPLY("vddarm", NULL);
  269. static struct regulator_consumer_supply buck2_consumer =
  270. REGULATOR_SUPPLY("vddint", NULL);
  271. static struct regulator_init_data aquila_buck1_data = {
  272. .constraints = {
  273. .name = "VARM_1.2V",
  274. .min_uV = 1200000,
  275. .max_uV = 1200000,
  276. .apply_uV = 1,
  277. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
  278. REGULATOR_CHANGE_STATUS,
  279. },
  280. .num_consumer_supplies = 1,
  281. .consumer_supplies = &buck1_consumer,
  282. };
  283. static struct regulator_init_data aquila_buck2_data = {
  284. .constraints = {
  285. .name = "VINT_1.2V",
  286. .min_uV = 1200000,
  287. .max_uV = 1200000,
  288. .apply_uV = 1,
  289. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
  290. REGULATOR_CHANGE_STATUS,
  291. },
  292. .num_consumer_supplies = 1,
  293. .consumer_supplies = &buck2_consumer,
  294. };
  295. static struct regulator_init_data aquila_buck3_data = {
  296. .constraints = {
  297. .name = "VCC_1.8V",
  298. .min_uV = 1800000,
  299. .max_uV = 1800000,
  300. .apply_uV = 1,
  301. .state_mem = {
  302. .enabled = 1,
  303. },
  304. },
  305. };
  306. static struct regulator_init_data aquila_buck4_data = {
  307. .constraints = {
  308. .name = "CAM_CORE_1.2V",
  309. .min_uV = 1200000,
  310. .max_uV = 1200000,
  311. .apply_uV = 1,
  312. .always_on = 1,
  313. },
  314. };
  315. static struct max8998_regulator_data aquila_regulators[] = {
  316. { MAX8998_LDO2, &aquila_ldo2_data },
  317. { MAX8998_LDO3, &aquila_ldo3_data },
  318. { MAX8998_LDO4, &aquila_ldo4_data },
  319. { MAX8998_LDO5, &aquila_ldo5_data },
  320. { MAX8998_LDO6, &aquila_ldo6_data },
  321. { MAX8998_LDO7, &aquila_ldo7_data },
  322. { MAX8998_LDO8, &aquila_ldo8_data },
  323. { MAX8998_LDO9, &aquila_ldo9_data },
  324. { MAX8998_LDO10, &aquila_ldo10_data },
  325. { MAX8998_LDO11, &aquila_ldo11_data },
  326. { MAX8998_LDO12, &aquila_ldo12_data },
  327. { MAX8998_LDO13, &aquila_ldo13_data },
  328. { MAX8998_LDO14, &aquila_ldo14_data },
  329. { MAX8998_LDO15, &aquila_ldo15_data },
  330. { MAX8998_LDO16, &aquila_ldo16_data },
  331. { MAX8998_LDO17, &aquila_ldo17_data },
  332. { MAX8998_BUCK1, &aquila_buck1_data },
  333. { MAX8998_BUCK2, &aquila_buck2_data },
  334. { MAX8998_BUCK3, &aquila_buck3_data },
  335. { MAX8998_BUCK4, &aquila_buck4_data },
  336. };
  337. static struct max8998_platform_data aquila_max8998_pdata = {
  338. .num_regulators = ARRAY_SIZE(aquila_regulators),
  339. .regulators = aquila_regulators,
  340. .buck1_set1 = S5PV210_GPH0(3),
  341. .buck1_set2 = S5PV210_GPH0(4),
  342. .buck2_set3 = S5PV210_GPH0(5),
  343. .buck1_voltage1 = 1200000,
  344. .buck1_voltage2 = 1200000,
  345. .buck1_voltage3 = 1200000,
  346. .buck1_voltage4 = 1200000,
  347. .buck2_voltage1 = 1200000,
  348. .buck2_voltage2 = 1200000,
  349. };
  350. #endif
  351. static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
  352. REGULATOR_SUPPLY("DBVDD", "5-001a"),
  353. REGULATOR_SUPPLY("AVDD2", "5-001a"),
  354. REGULATOR_SUPPLY("CPVDD", "5-001a"),
  355. };
  356. static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
  357. REGULATOR_SUPPLY("SPKVDD1", "5-001a"),
  358. REGULATOR_SUPPLY("SPKVDD2", "5-001a"),
  359. };
  360. static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
  361. .constraints = {
  362. .always_on = 1,
  363. },
  364. .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage0_supplies),
  365. .consumer_supplies = wm8994_fixed_voltage0_supplies,
  366. };
  367. static struct regulator_init_data wm8994_fixed_voltage1_init_data = {
  368. .constraints = {
  369. .always_on = 1,
  370. },
  371. .num_consumer_supplies = ARRAY_SIZE(wm8994_fixed_voltage1_supplies),
  372. .consumer_supplies = wm8994_fixed_voltage1_supplies,
  373. };
  374. static struct fixed_voltage_config wm8994_fixed_voltage0_config = {
  375. .supply_name = "VCC_1.8V_PDA",
  376. .microvolts = 1800000,
  377. .gpio = -EINVAL,
  378. .init_data = &wm8994_fixed_voltage0_init_data,
  379. };
  380. static struct fixed_voltage_config wm8994_fixed_voltage1_config = {
  381. .supply_name = "V_BAT",
  382. .microvolts = 3700000,
  383. .gpio = -EINVAL,
  384. .init_data = &wm8994_fixed_voltage1_init_data,
  385. };
  386. static struct platform_device wm8994_fixed_voltage0 = {
  387. .name = "reg-fixed-voltage",
  388. .id = 0,
  389. .dev = {
  390. .platform_data = &wm8994_fixed_voltage0_config,
  391. },
  392. };
  393. static struct platform_device wm8994_fixed_voltage1 = {
  394. .name = "reg-fixed-voltage",
  395. .id = 1,
  396. .dev = {
  397. .platform_data = &wm8994_fixed_voltage1_config,
  398. },
  399. };
  400. static struct regulator_consumer_supply wm8994_avdd1_supply =
  401. REGULATOR_SUPPLY("AVDD1", "5-001a");
  402. static struct regulator_consumer_supply wm8994_dcvdd_supply =
  403. REGULATOR_SUPPLY("DCVDD", "5-001a");
  404. static struct regulator_init_data wm8994_ldo1_data = {
  405. .constraints = {
  406. .name = "AVDD1_3.0V",
  407. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  408. },
  409. .num_consumer_supplies = 1,
  410. .consumer_supplies = &wm8994_avdd1_supply,
  411. };
  412. static struct regulator_init_data wm8994_ldo2_data = {
  413. .constraints = {
  414. .name = "DCVDD_1.0V",
  415. },
  416. .num_consumer_supplies = 1,
  417. .consumer_supplies = &wm8994_dcvdd_supply,
  418. };
  419. static struct wm8994_pdata wm8994_platform_data = {
  420. /* configure gpio1 function: 0x0001(Logic level input/output) */
  421. .gpio_defaults[0] = 0x0001,
  422. /* configure gpio3/4/5/7 function for AIF2 voice */
  423. .gpio_defaults[2] = 0x8100,
  424. .gpio_defaults[3] = 0x8100,
  425. .gpio_defaults[4] = 0x8100,
  426. .gpio_defaults[6] = 0x0100,
  427. /* configure gpio8/9/10/11 function for AIF3 BT */
  428. .gpio_defaults[7] = 0x8100,
  429. .gpio_defaults[8] = 0x0100,
  430. .gpio_defaults[9] = 0x0100,
  431. .gpio_defaults[10] = 0x0100,
  432. .ldo[0] = { S5PV210_MP03(6), &wm8994_ldo1_data }, /* XM0FRNB_2 */
  433. .ldo[1] = { 0, &wm8994_ldo2_data },
  434. };
  435. /* GPIO I2C PMIC */
  436. #define AP_I2C_GPIO_PMIC_BUS_4 4
  437. static struct i2c_gpio_platform_data aquila_i2c_gpio_pmic_data = {
  438. .sda_pin = S5PV210_GPJ4(0), /* XMSMCSN */
  439. .scl_pin = S5PV210_GPJ4(3), /* XMSMIRQN */
  440. };
  441. static struct platform_device aquila_i2c_gpio_pmic = {
  442. .name = "i2c-gpio",
  443. .id = AP_I2C_GPIO_PMIC_BUS_4,
  444. .dev = {
  445. .platform_data = &aquila_i2c_gpio_pmic_data,
  446. },
  447. };
  448. static struct i2c_board_info i2c_gpio_pmic_devs[] __initdata = {
  449. #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
  450. {
  451. /* 0xCC when SRAD = 0 */
  452. I2C_BOARD_INFO("max8998", 0xCC >> 1),
  453. .platform_data = &aquila_max8998_pdata,
  454. },
  455. #endif
  456. };
  457. /* GPIO I2C AP 1.8V */
  458. #define AP_I2C_GPIO_BUS_5 5
  459. static struct i2c_gpio_platform_data aquila_i2c_gpio5_data = {
  460. .sda_pin = S5PV210_MP05(3), /* XM0ADDR_11 */
  461. .scl_pin = S5PV210_MP05(2), /* XM0ADDR_10 */
  462. };
  463. static struct platform_device aquila_i2c_gpio5 = {
  464. .name = "i2c-gpio",
  465. .id = AP_I2C_GPIO_BUS_5,
  466. .dev = {
  467. .platform_data = &aquila_i2c_gpio5_data,
  468. },
  469. };
  470. static struct i2c_board_info i2c_gpio5_devs[] __initdata = {
  471. {
  472. /* CS/ADDR = low 0x34 (FYI: high = 0x36) */
  473. I2C_BOARD_INFO("wm8994", 0x1a),
  474. .platform_data = &wm8994_platform_data,
  475. },
  476. };
  477. /* PMIC Power button */
  478. static struct gpio_keys_button aquila_gpio_keys_table[] = {
  479. {
  480. .code = KEY_POWER,
  481. .gpio = S5PV210_GPH2(6),
  482. .desc = "gpio-keys: KEY_POWER",
  483. .type = EV_KEY,
  484. .active_low = 1,
  485. .wakeup = 1,
  486. .debounce_interval = 1,
  487. },
  488. };
  489. static struct gpio_keys_platform_data aquila_gpio_keys_data = {
  490. .buttons = aquila_gpio_keys_table,
  491. .nbuttons = ARRAY_SIZE(aquila_gpio_keys_table),
  492. };
  493. static struct platform_device aquila_device_gpiokeys = {
  494. .name = "gpio-keys",
  495. .dev = {
  496. .platform_data = &aquila_gpio_keys_data,
  497. },
  498. };
  499. static void __init aquila_pmic_init(void)
  500. {
  501. /* AP_PMIC_IRQ: EINT7 */
  502. s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_SFN(0xf));
  503. s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_UP);
  504. /* nPower: EINT22 */
  505. s3c_gpio_cfgpin(S5PV210_GPH2(6), S3C_GPIO_SFN(0xf));
  506. s3c_gpio_setpull(S5PV210_GPH2(6), S3C_GPIO_PULL_UP);
  507. }
  508. /* MoviNAND */
  509. static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
  510. .max_width = 4,
  511. .cd_type = S3C_SDHCI_CD_PERMANENT,
  512. };
  513. /* Wireless LAN */
  514. static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
  515. .max_width = 4,
  516. .cd_type = S3C_SDHCI_CD_EXTERNAL,
  517. /* ext_cd_{init,cleanup} callbacks will be added later */
  518. };
  519. /* External Flash */
  520. #define AQUILA_EXT_FLASH_EN S5PV210_MP05(4)
  521. #define AQUILA_EXT_FLASH_CD S5PV210_GPH3(4)
  522. static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
  523. .max_width = 4,
  524. .cd_type = S3C_SDHCI_CD_GPIO,
  525. .ext_cd_gpio = AQUILA_EXT_FLASH_CD,
  526. .ext_cd_gpio_invert = 1,
  527. };
  528. static void aquila_setup_sdhci(void)
  529. {
  530. gpio_request_one(AQUILA_EXT_FLASH_EN, GPIOF_OUT_INIT_HIGH, "FLASH_EN");
  531. s3c_sdhci0_set_platdata(&aquila_hsmmc0_data);
  532. s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
  533. s3c_sdhci2_set_platdata(&aquila_hsmmc2_data);
  534. };
  535. /* Audio device */
  536. static struct platform_device aquila_device_audio = {
  537. .name = "smdk-audio",
  538. .id = -1,
  539. };
  540. static struct platform_device *aquila_devices[] __initdata = {
  541. &aquila_i2c_gpio_pmic,
  542. &aquila_i2c_gpio5,
  543. &aquila_device_gpiokeys,
  544. &aquila_device_audio,
  545. &s3c_device_fb,
  546. &s5p_device_onenand,
  547. &s3c_device_hsmmc0,
  548. &s3c_device_hsmmc1,
  549. &s3c_device_hsmmc2,
  550. &s5p_device_fimc0,
  551. &s5p_device_fimc1,
  552. &s5p_device_fimc2,
  553. &s5p_device_fimc_md,
  554. &s5pv210_device_iis0,
  555. &wm8994_fixed_voltage0,
  556. &wm8994_fixed_voltage1,
  557. };
  558. static void __init aquila_sound_init(void)
  559. {
  560. unsigned int gpio;
  561. /* CODEC_XTAL_EN
  562. *
  563. * The Aquila board have a oscillator which provide main clock
  564. * to WM8994 codec. The oscillator provide 24MHz clock to WM8994
  565. * clock. Set gpio setting of "CODEC_XTAL_EN" to enable a oscillator.
  566. * */
  567. gpio = S5PV210_GPH3(2); /* XEINT_26 */
  568. gpio_request(gpio, "CODEC_XTAL_EN");
  569. s3c_gpio_cfgpin(gpio, S3C_GPIO_OUTPUT);
  570. s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
  571. /* Ths main clock of WM8994 codec uses the output of CLKOUT pin.
  572. * The CLKOUT[9:8] set to 0x3(XUSBXTI) of 0xE010E000(OTHERS)
  573. * because it needs 24MHz clock to operate WM8994 codec.
  574. */
  575. __raw_writel(__raw_readl(S5P_OTHERS) | (0x3 << 8), S5P_OTHERS);
  576. }
  577. static void __init aquila_map_io(void)
  578. {
  579. s5pv210_init_io(NULL, 0);
  580. s3c24xx_init_clocks(24000000);
  581. s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
  582. s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
  583. }
  584. static void __init aquila_machine_init(void)
  585. {
  586. /* PMIC */
  587. aquila_pmic_init();
  588. i2c_register_board_info(AP_I2C_GPIO_PMIC_BUS_4, i2c_gpio_pmic_devs,
  589. ARRAY_SIZE(i2c_gpio_pmic_devs));
  590. /* SDHCI */
  591. aquila_setup_sdhci();
  592. s3c_fimc_setname(0, "s5p-fimc");
  593. s3c_fimc_setname(1, "s5p-fimc");
  594. s3c_fimc_setname(2, "s5p-fimc");
  595. /* SOUND */
  596. aquila_sound_init();
  597. i2c_register_board_info(AP_I2C_GPIO_BUS_5, i2c_gpio5_devs,
  598. ARRAY_SIZE(i2c_gpio5_devs));
  599. /* FB */
  600. s3c_fb_set_platdata(&aquila_lcd_pdata);
  601. platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
  602. }
  603. MACHINE_START(AQUILA, "Aquila")
  604. /* Maintainers:
  605. Marek Szyprowski <m.szyprowski@samsung.com>
  606. Kyungmin Park <kyungmin.park@samsung.com> */
  607. .atag_offset = 0x100,
  608. .init_irq = s5pv210_init_irq,
  609. .handle_irq = vic_handle_irq,
  610. .map_io = aquila_map_io,
  611. .init_machine = aquila_machine_init,
  612. .timer = &s5p_timer,
  613. .restart = s5pv210_restart,
  614. MACHINE_END