mach-aquila.c 16 KB

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