mach-aquila.c 17 KB

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