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