mach-aquila.c 17 KB

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