mach-origen.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  1. /* linux/arch/arm/mach-exynos4/mach-origen.c
  2. *
  3. * Copyright (c) 2011 Insignal Co., Ltd.
  4. * http://www.insignal.co.kr/
  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/serial_core.h>
  11. #include <linux/gpio.h>
  12. #include <linux/mmc/host.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/io.h>
  15. #include <linux/input.h>
  16. #include <linux/pwm_backlight.h>
  17. #include <linux/gpio_keys.h>
  18. #include <linux/i2c.h>
  19. #include <linux/regulator/machine.h>
  20. #include <linux/mfd/max8997.h>
  21. #include <linux/lcd.h>
  22. #include <linux/rfkill-gpio.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/hardware/gic.h>
  25. #include <asm/mach-types.h>
  26. #include <video/platform_lcd.h>
  27. #include <plat/regs-serial.h>
  28. #include <plat/regs-fb-v4.h>
  29. #include <plat/cpu.h>
  30. #include <plat/devs.h>
  31. #include <plat/sdhci.h>
  32. #include <plat/iic.h>
  33. #include <plat/ehci.h>
  34. #include <plat/clock.h>
  35. #include <plat/gpio-cfg.h>
  36. #include <plat/backlight.h>
  37. #include <plat/pd.h>
  38. #include <plat/fb.h>
  39. #include <plat/mfc.h>
  40. #include <mach/ohci.h>
  41. #include <mach/map.h>
  42. #include "common.h"
  43. /* Following are default values for UCON, ULCON and UFCON UART registers */
  44. #define ORIGEN_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  45. S3C2410_UCON_RXILEVEL | \
  46. S3C2410_UCON_TXIRQMODE | \
  47. S3C2410_UCON_RXIRQMODE | \
  48. S3C2410_UCON_RXFIFO_TOI | \
  49. S3C2443_UCON_RXERR_IRQEN)
  50. #define ORIGEN_ULCON_DEFAULT S3C2410_LCON_CS8
  51. #define ORIGEN_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  52. S5PV210_UFCON_TXTRIG4 | \
  53. S5PV210_UFCON_RXTRIG4)
  54. static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = {
  55. [0] = {
  56. .hwport = 0,
  57. .flags = 0,
  58. .ucon = ORIGEN_UCON_DEFAULT,
  59. .ulcon = ORIGEN_ULCON_DEFAULT,
  60. .ufcon = ORIGEN_UFCON_DEFAULT,
  61. },
  62. [1] = {
  63. .hwport = 1,
  64. .flags = 0,
  65. .ucon = ORIGEN_UCON_DEFAULT,
  66. .ulcon = ORIGEN_ULCON_DEFAULT,
  67. .ufcon = ORIGEN_UFCON_DEFAULT,
  68. },
  69. [2] = {
  70. .hwport = 2,
  71. .flags = 0,
  72. .ucon = ORIGEN_UCON_DEFAULT,
  73. .ulcon = ORIGEN_ULCON_DEFAULT,
  74. .ufcon = ORIGEN_UFCON_DEFAULT,
  75. },
  76. [3] = {
  77. .hwport = 3,
  78. .flags = 0,
  79. .ucon = ORIGEN_UCON_DEFAULT,
  80. .ulcon = ORIGEN_ULCON_DEFAULT,
  81. .ufcon = ORIGEN_UFCON_DEFAULT,
  82. },
  83. };
  84. static struct regulator_consumer_supply __initdata ldo3_consumer[] = {
  85. REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */
  86. REGULATOR_SUPPLY("vdd", "exynos4-hdmi"), /* HDMI */
  87. REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"), /* HDMI */
  88. };
  89. static struct regulator_consumer_supply __initdata ldo6_consumer[] = {
  90. REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */
  91. };
  92. static struct regulator_consumer_supply __initdata ldo7_consumer[] = {
  93. REGULATOR_SUPPLY("avdd", "alc5625"), /* Realtek ALC5625 */
  94. };
  95. static struct regulator_consumer_supply __initdata ldo8_consumer[] = {
  96. REGULATOR_SUPPLY("vdd", "s5p-adc"), /* ADC */
  97. REGULATOR_SUPPLY("vdd_osc", "exynos4-hdmi"), /* HDMI */
  98. };
  99. static struct regulator_consumer_supply __initdata ldo9_consumer[] = {
  100. REGULATOR_SUPPLY("dvdd", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */
  101. };
  102. static struct regulator_consumer_supply __initdata ldo11_consumer[] = {
  103. REGULATOR_SUPPLY("dvdd", "alc5625"), /* Realtek ALC5625 */
  104. };
  105. static struct regulator_consumer_supply __initdata ldo14_consumer[] = {
  106. REGULATOR_SUPPLY("avdd18", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */
  107. };
  108. static struct regulator_consumer_supply __initdata ldo17_consumer[] = {
  109. REGULATOR_SUPPLY("vdd33", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */
  110. };
  111. static struct regulator_consumer_supply __initdata buck1_consumer[] = {
  112. REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */
  113. };
  114. static struct regulator_consumer_supply __initdata buck2_consumer[] = {
  115. REGULATOR_SUPPLY("vdd_int", NULL), /* CPUFREQ */
  116. };
  117. static struct regulator_consumer_supply __initdata buck3_consumer[] = {
  118. REGULATOR_SUPPLY("vdd_g3d", "mali_drm"), /* G3D */
  119. };
  120. static struct regulator_consumer_supply __initdata buck7_consumer[] = {
  121. REGULATOR_SUPPLY("vcc", "platform-lcd"), /* LCD */
  122. };
  123. static struct regulator_init_data __initdata max8997_ldo1_data = {
  124. .constraints = {
  125. .name = "VDD_ABB_3.3V",
  126. .min_uV = 3300000,
  127. .max_uV = 3300000,
  128. .apply_uV = 1,
  129. .state_mem = {
  130. .disabled = 1,
  131. },
  132. },
  133. };
  134. static struct regulator_init_data __initdata max8997_ldo2_data = {
  135. .constraints = {
  136. .name = "VDD_ALIVE_1.1V",
  137. .min_uV = 1100000,
  138. .max_uV = 1100000,
  139. .apply_uV = 1,
  140. .always_on = 1,
  141. .state_mem = {
  142. .enabled = 1,
  143. },
  144. },
  145. };
  146. static struct regulator_init_data __initdata max8997_ldo3_data = {
  147. .constraints = {
  148. .name = "VMIPI_1.1V",
  149. .min_uV = 1100000,
  150. .max_uV = 1100000,
  151. .apply_uV = 1,
  152. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  153. .state_mem = {
  154. .disabled = 1,
  155. },
  156. },
  157. .num_consumer_supplies = ARRAY_SIZE(ldo3_consumer),
  158. .consumer_supplies = ldo3_consumer,
  159. };
  160. static struct regulator_init_data __initdata max8997_ldo4_data = {
  161. .constraints = {
  162. .name = "VDD_RTC_1.8V",
  163. .min_uV = 1800000,
  164. .max_uV = 1800000,
  165. .apply_uV = 1,
  166. .always_on = 1,
  167. .state_mem = {
  168. .disabled = 1,
  169. },
  170. },
  171. };
  172. static struct regulator_init_data __initdata max8997_ldo6_data = {
  173. .constraints = {
  174. .name = "VMIPI_1.8V",
  175. .min_uV = 1800000,
  176. .max_uV = 1800000,
  177. .apply_uV = 1,
  178. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  179. .state_mem = {
  180. .disabled = 1,
  181. },
  182. },
  183. .num_consumer_supplies = ARRAY_SIZE(ldo6_consumer),
  184. .consumer_supplies = ldo6_consumer,
  185. };
  186. static struct regulator_init_data __initdata max8997_ldo7_data = {
  187. .constraints = {
  188. .name = "VDD_AUD_1.8V",
  189. .min_uV = 1800000,
  190. .max_uV = 1800000,
  191. .apply_uV = 1,
  192. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  193. .state_mem = {
  194. .disabled = 1,
  195. },
  196. },
  197. .num_consumer_supplies = ARRAY_SIZE(ldo7_consumer),
  198. .consumer_supplies = ldo7_consumer,
  199. };
  200. static struct regulator_init_data __initdata max8997_ldo8_data = {
  201. .constraints = {
  202. .name = "VADC_3.3V",
  203. .min_uV = 3300000,
  204. .max_uV = 3300000,
  205. .apply_uV = 1,
  206. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  207. .state_mem = {
  208. .disabled = 1,
  209. },
  210. },
  211. .num_consumer_supplies = ARRAY_SIZE(ldo8_consumer),
  212. .consumer_supplies = ldo8_consumer,
  213. };
  214. static struct regulator_init_data __initdata max8997_ldo9_data = {
  215. .constraints = {
  216. .name = "DVDD_SWB_2.8V",
  217. .min_uV = 2800000,
  218. .max_uV = 2800000,
  219. .apply_uV = 1,
  220. .always_on = 1,
  221. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  222. .state_mem = {
  223. .disabled = 1,
  224. },
  225. },
  226. .num_consumer_supplies = ARRAY_SIZE(ldo9_consumer),
  227. .consumer_supplies = ldo9_consumer,
  228. };
  229. static struct regulator_init_data __initdata max8997_ldo10_data = {
  230. .constraints = {
  231. .name = "VDD_PLL_1.1V",
  232. .min_uV = 1100000,
  233. .max_uV = 1100000,
  234. .apply_uV = 1,
  235. .always_on = 1,
  236. .state_mem = {
  237. .disabled = 1,
  238. },
  239. },
  240. };
  241. static struct regulator_init_data __initdata max8997_ldo11_data = {
  242. .constraints = {
  243. .name = "VDD_AUD_3V",
  244. .min_uV = 3000000,
  245. .max_uV = 3000000,
  246. .apply_uV = 1,
  247. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  248. .state_mem = {
  249. .disabled = 1,
  250. },
  251. },
  252. .num_consumer_supplies = ARRAY_SIZE(ldo11_consumer),
  253. .consumer_supplies = ldo11_consumer,
  254. };
  255. static struct regulator_init_data __initdata max8997_ldo14_data = {
  256. .constraints = {
  257. .name = "AVDD18_SWB_1.8V",
  258. .min_uV = 1800000,
  259. .max_uV = 1800000,
  260. .apply_uV = 1,
  261. .always_on = 1,
  262. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  263. .state_mem = {
  264. .disabled = 1,
  265. },
  266. },
  267. .num_consumer_supplies = ARRAY_SIZE(ldo14_consumer),
  268. .consumer_supplies = ldo14_consumer,
  269. };
  270. static struct regulator_init_data __initdata max8997_ldo17_data = {
  271. .constraints = {
  272. .name = "VDD_SWB_3.3V",
  273. .min_uV = 3300000,
  274. .max_uV = 3300000,
  275. .apply_uV = 1,
  276. .always_on = 1,
  277. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  278. .state_mem = {
  279. .disabled = 1,
  280. },
  281. },
  282. .num_consumer_supplies = ARRAY_SIZE(ldo17_consumer),
  283. .consumer_supplies = ldo17_consumer,
  284. };
  285. static struct regulator_init_data __initdata max8997_ldo21_data = {
  286. .constraints = {
  287. .name = "VDD_MIF_1.2V",
  288. .min_uV = 1200000,
  289. .max_uV = 1200000,
  290. .apply_uV = 1,
  291. .always_on = 1,
  292. .state_mem = {
  293. .disabled = 1,
  294. },
  295. },
  296. };
  297. static struct regulator_init_data __initdata max8997_buck1_data = {
  298. .constraints = {
  299. .name = "VDD_ARM_1.2V",
  300. .min_uV = 950000,
  301. .max_uV = 1350000,
  302. .always_on = 1,
  303. .boot_on = 1,
  304. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  305. .state_mem = {
  306. .disabled = 1,
  307. },
  308. },
  309. .num_consumer_supplies = ARRAY_SIZE(buck1_consumer),
  310. .consumer_supplies = buck1_consumer,
  311. };
  312. static struct regulator_init_data __initdata max8997_buck2_data = {
  313. .constraints = {
  314. .name = "VDD_INT_1.1V",
  315. .min_uV = 900000,
  316. .max_uV = 1100000,
  317. .always_on = 1,
  318. .boot_on = 1,
  319. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  320. .state_mem = {
  321. .disabled = 1,
  322. },
  323. },
  324. .num_consumer_supplies = ARRAY_SIZE(buck2_consumer),
  325. .consumer_supplies = buck2_consumer,
  326. };
  327. static struct regulator_init_data __initdata max8997_buck3_data = {
  328. .constraints = {
  329. .name = "VDD_G3D_1.1V",
  330. .min_uV = 900000,
  331. .max_uV = 1100000,
  332. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
  333. REGULATOR_CHANGE_STATUS,
  334. .state_mem = {
  335. .disabled = 1,
  336. },
  337. },
  338. .num_consumer_supplies = ARRAY_SIZE(buck3_consumer),
  339. .consumer_supplies = buck3_consumer,
  340. };
  341. static struct regulator_init_data __initdata max8997_buck5_data = {
  342. .constraints = {
  343. .name = "VDDQ_M1M2_1.2V",
  344. .min_uV = 1200000,
  345. .max_uV = 1200000,
  346. .apply_uV = 1,
  347. .always_on = 1,
  348. .state_mem = {
  349. .disabled = 1,
  350. },
  351. },
  352. };
  353. static struct regulator_init_data __initdata max8997_buck7_data = {
  354. .constraints = {
  355. .name = "VDD_LCD_3.3V",
  356. .min_uV = 3300000,
  357. .max_uV = 3300000,
  358. .boot_on = 1,
  359. .apply_uV = 1,
  360. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  361. .state_mem = {
  362. .disabled = 1
  363. },
  364. },
  365. .num_consumer_supplies = ARRAY_SIZE(buck7_consumer),
  366. .consumer_supplies = buck7_consumer,
  367. };
  368. static struct max8997_regulator_data __initdata origen_max8997_regulators[] = {
  369. { MAX8997_LDO1, &max8997_ldo1_data },
  370. { MAX8997_LDO2, &max8997_ldo2_data },
  371. { MAX8997_LDO3, &max8997_ldo3_data },
  372. { MAX8997_LDO4, &max8997_ldo4_data },
  373. { MAX8997_LDO6, &max8997_ldo6_data },
  374. { MAX8997_LDO7, &max8997_ldo7_data },
  375. { MAX8997_LDO8, &max8997_ldo8_data },
  376. { MAX8997_LDO9, &max8997_ldo9_data },
  377. { MAX8997_LDO10, &max8997_ldo10_data },
  378. { MAX8997_LDO11, &max8997_ldo11_data },
  379. { MAX8997_LDO14, &max8997_ldo14_data },
  380. { MAX8997_LDO17, &max8997_ldo17_data },
  381. { MAX8997_LDO21, &max8997_ldo21_data },
  382. { MAX8997_BUCK1, &max8997_buck1_data },
  383. { MAX8997_BUCK2, &max8997_buck2_data },
  384. { MAX8997_BUCK3, &max8997_buck3_data },
  385. { MAX8997_BUCK5, &max8997_buck5_data },
  386. { MAX8997_BUCK7, &max8997_buck7_data },
  387. };
  388. static struct max8997_platform_data __initdata origen_max8997_pdata = {
  389. .num_regulators = ARRAY_SIZE(origen_max8997_regulators),
  390. .regulators = origen_max8997_regulators,
  391. .wakeup = true,
  392. .buck1_gpiodvs = false,
  393. .buck2_gpiodvs = false,
  394. .buck5_gpiodvs = false,
  395. .irq_base = IRQ_GPIO_END + 1,
  396. .ignore_gpiodvs_side_effect = true,
  397. .buck125_default_idx = 0x0,
  398. .buck125_gpios[0] = EXYNOS4_GPX0(0),
  399. .buck125_gpios[1] = EXYNOS4_GPX0(1),
  400. .buck125_gpios[2] = EXYNOS4_GPX0(2),
  401. .buck1_voltage[0] = 1350000,
  402. .buck1_voltage[1] = 1300000,
  403. .buck1_voltage[2] = 1250000,
  404. .buck1_voltage[3] = 1200000,
  405. .buck1_voltage[4] = 1150000,
  406. .buck1_voltage[5] = 1100000,
  407. .buck1_voltage[6] = 1000000,
  408. .buck1_voltage[7] = 950000,
  409. .buck2_voltage[0] = 1100000,
  410. .buck2_voltage[1] = 1100000,
  411. .buck2_voltage[2] = 1100000,
  412. .buck2_voltage[3] = 1100000,
  413. .buck2_voltage[4] = 1000000,
  414. .buck2_voltage[5] = 1000000,
  415. .buck2_voltage[6] = 1000000,
  416. .buck2_voltage[7] = 1000000,
  417. .buck5_voltage[0] = 1200000,
  418. .buck5_voltage[1] = 1200000,
  419. .buck5_voltage[2] = 1200000,
  420. .buck5_voltage[3] = 1200000,
  421. .buck5_voltage[4] = 1200000,
  422. .buck5_voltage[5] = 1200000,
  423. .buck5_voltage[6] = 1200000,
  424. .buck5_voltage[7] = 1200000,
  425. };
  426. /* I2C0 */
  427. static struct i2c_board_info i2c0_devs[] __initdata = {
  428. {
  429. I2C_BOARD_INFO("max8997", (0xCC >> 1)),
  430. .platform_data = &origen_max8997_pdata,
  431. .irq = IRQ_EINT(4),
  432. },
  433. };
  434. static struct s3c_sdhci_platdata origen_hsmmc0_pdata __initdata = {
  435. .cd_type = S3C_SDHCI_CD_INTERNAL,
  436. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  437. };
  438. static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = {
  439. .cd_type = S3C_SDHCI_CD_INTERNAL,
  440. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  441. };
  442. /* USB EHCI */
  443. static struct s5p_ehci_platdata origen_ehci_pdata;
  444. static void __init origen_ehci_init(void)
  445. {
  446. struct s5p_ehci_platdata *pdata = &origen_ehci_pdata;
  447. s5p_ehci_set_platdata(pdata);
  448. }
  449. /* USB OHCI */
  450. static struct exynos4_ohci_platdata origen_ohci_pdata;
  451. static void __init origen_ohci_init(void)
  452. {
  453. struct exynos4_ohci_platdata *pdata = &origen_ohci_pdata;
  454. exynos4_ohci_set_platdata(pdata);
  455. }
  456. static struct gpio_keys_button origen_gpio_keys_table[] = {
  457. {
  458. .code = KEY_MENU,
  459. .gpio = EXYNOS4_GPX1(5),
  460. .desc = "gpio-keys: KEY_MENU",
  461. .type = EV_KEY,
  462. .active_low = 1,
  463. .wakeup = 1,
  464. .debounce_interval = 1,
  465. }, {
  466. .code = KEY_HOME,
  467. .gpio = EXYNOS4_GPX1(6),
  468. .desc = "gpio-keys: KEY_HOME",
  469. .type = EV_KEY,
  470. .active_low = 1,
  471. .wakeup = 1,
  472. .debounce_interval = 1,
  473. }, {
  474. .code = KEY_BACK,
  475. .gpio = EXYNOS4_GPX1(7),
  476. .desc = "gpio-keys: KEY_BACK",
  477. .type = EV_KEY,
  478. .active_low = 1,
  479. .wakeup = 1,
  480. .debounce_interval = 1,
  481. }, {
  482. .code = KEY_UP,
  483. .gpio = EXYNOS4_GPX2(0),
  484. .desc = "gpio-keys: KEY_UP",
  485. .type = EV_KEY,
  486. .active_low = 1,
  487. .wakeup = 1,
  488. .debounce_interval = 1,
  489. }, {
  490. .code = KEY_DOWN,
  491. .gpio = EXYNOS4_GPX2(1),
  492. .desc = "gpio-keys: KEY_DOWN",
  493. .type = EV_KEY,
  494. .active_low = 1,
  495. .wakeup = 1,
  496. .debounce_interval = 1,
  497. },
  498. };
  499. static struct gpio_keys_platform_data origen_gpio_keys_data = {
  500. .buttons = origen_gpio_keys_table,
  501. .nbuttons = ARRAY_SIZE(origen_gpio_keys_table),
  502. };
  503. static struct platform_device origen_device_gpiokeys = {
  504. .name = "gpio-keys",
  505. .dev = {
  506. .platform_data = &origen_gpio_keys_data,
  507. },
  508. };
  509. static void lcd_hv070wsa_set_power(struct plat_lcd_data *pd, unsigned int power)
  510. {
  511. int ret;
  512. if (power)
  513. ret = gpio_request_one(EXYNOS4_GPE3(4),
  514. GPIOF_OUT_INIT_HIGH, "GPE3_4");
  515. else
  516. ret = gpio_request_one(EXYNOS4_GPE3(4),
  517. GPIOF_OUT_INIT_LOW, "GPE3_4");
  518. gpio_free(EXYNOS4_GPE3(4));
  519. if (ret)
  520. pr_err("failed to request gpio for LCD power: %d\n", ret);
  521. }
  522. static struct plat_lcd_data origen_lcd_hv070wsa_data = {
  523. .set_power = lcd_hv070wsa_set_power,
  524. };
  525. static struct platform_device origen_lcd_hv070wsa = {
  526. .name = "platform-lcd",
  527. .dev.parent = &s5p_device_fimd0.dev,
  528. .dev.platform_data = &origen_lcd_hv070wsa_data,
  529. };
  530. static struct s3c_fb_pd_win origen_fb_win0 = {
  531. .win_mode = {
  532. .left_margin = 64,
  533. .right_margin = 16,
  534. .upper_margin = 64,
  535. .lower_margin = 16,
  536. .hsync_len = 48,
  537. .vsync_len = 3,
  538. .xres = 1024,
  539. .yres = 600,
  540. },
  541. .max_bpp = 32,
  542. .default_bpp = 24,
  543. };
  544. static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
  545. .win[0] = &origen_fb_win0,
  546. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
  547. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
  548. VIDCON1_INV_VCLK,
  549. .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
  550. };
  551. /* Bluetooth rfkill gpio platform data */
  552. struct rfkill_gpio_platform_data origen_bt_pdata = {
  553. .reset_gpio = EXYNOS4_GPX2(2),
  554. .shutdown_gpio = -1,
  555. .type = RFKILL_TYPE_BLUETOOTH,
  556. .name = "origen-bt",
  557. };
  558. /* Bluetooth Platform device */
  559. static struct platform_device origen_device_bluetooth = {
  560. .name = "rfkill_gpio",
  561. .id = -1,
  562. .dev = {
  563. .platform_data = &origen_bt_pdata,
  564. },
  565. };
  566. static struct platform_device *origen_devices[] __initdata = {
  567. &s3c_device_hsmmc2,
  568. &s3c_device_hsmmc0,
  569. &s3c_device_i2c0,
  570. &s3c_device_rtc,
  571. &s3c_device_wdt,
  572. &s5p_device_ehci,
  573. &s5p_device_fimc0,
  574. &s5p_device_fimc1,
  575. &s5p_device_fimc2,
  576. &s5p_device_fimc3,
  577. &s5p_device_fimc_md,
  578. &s5p_device_fimd0,
  579. &s5p_device_g2d,
  580. &s5p_device_hdmi,
  581. &s5p_device_i2c_hdmiphy,
  582. &s5p_device_jpeg,
  583. &s5p_device_mfc,
  584. &s5p_device_mfc_l,
  585. &s5p_device_mfc_r,
  586. &s5p_device_mixer,
  587. &exynos4_device_ohci,
  588. &origen_device_gpiokeys,
  589. &origen_lcd_hv070wsa,
  590. &origen_device_bluetooth,
  591. };
  592. /* LCD Backlight data */
  593. static struct samsung_bl_gpio_info origen_bl_gpio_info = {
  594. .no = EXYNOS4_GPD0(0),
  595. .func = S3C_GPIO_SFN(2),
  596. };
  597. static struct platform_pwm_backlight_data origen_bl_data = {
  598. .pwm_id = 0,
  599. .pwm_period_ns = 1000,
  600. };
  601. static void __init origen_bt_setup(void)
  602. {
  603. gpio_request(EXYNOS4_GPA0(0), "GPIO BT_UART");
  604. /* 4 UART Pins configuration */
  605. s3c_gpio_cfgrange_nopull(EXYNOS4_GPA0(0), 4, S3C_GPIO_SFN(2));
  606. /* Setup BT Reset, this gpio will be requesed by rfkill-gpio */
  607. s3c_gpio_cfgpin(EXYNOS4_GPX2(2), S3C_GPIO_OUTPUT);
  608. s3c_gpio_setpull(EXYNOS4_GPX2(2), S3C_GPIO_PULL_NONE);
  609. }
  610. static void s5p_tv_setup(void)
  611. {
  612. /* Direct HPD to HDMI chip */
  613. gpio_request_one(EXYNOS4_GPX3(7), GPIOF_IN, "hpd-plug");
  614. s3c_gpio_cfgpin(EXYNOS4_GPX3(7), S3C_GPIO_SFN(0x3));
  615. s3c_gpio_setpull(EXYNOS4_GPX3(7), S3C_GPIO_PULL_NONE);
  616. }
  617. static void __init origen_map_io(void)
  618. {
  619. exynos_init_io(NULL, 0);
  620. s3c24xx_init_clocks(24000000);
  621. s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
  622. }
  623. static void __init origen_power_init(void)
  624. {
  625. gpio_request(EXYNOS4_GPX0(4), "PMIC_IRQ");
  626. s3c_gpio_cfgpin(EXYNOS4_GPX0(4), S3C_GPIO_SFN(0xf));
  627. s3c_gpio_setpull(EXYNOS4_GPX0(4), S3C_GPIO_PULL_NONE);
  628. }
  629. static void __init origen_reserve(void)
  630. {
  631. s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
  632. }
  633. static void __init origen_machine_init(void)
  634. {
  635. origen_power_init();
  636. s3c_i2c0_set_platdata(NULL);
  637. i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
  638. /*
  639. * Since sdhci instance 2 can contain a bootable media,
  640. * sdhci instance 0 is registered after instance 2.
  641. */
  642. s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata);
  643. s3c_sdhci0_set_platdata(&origen_hsmmc0_pdata);
  644. origen_ehci_init();
  645. origen_ohci_init();
  646. clk_xusbxti.rate = 24000000;
  647. s5p_tv_setup();
  648. s5p_i2c_hdmiphy_set_platdata(NULL);
  649. s5p_fimd0_set_platdata(&origen_lcd_pdata);
  650. platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
  651. samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
  652. origen_bt_setup();
  653. }
  654. MACHINE_START(ORIGEN, "ORIGEN")
  655. /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
  656. .atag_offset = 0x100,
  657. .init_irq = exynos4_init_irq,
  658. .map_io = origen_map_io,
  659. .handle_irq = gic_handle_irq,
  660. .init_machine = origen_machine_init,
  661. .timer = &exynos4_timer,
  662. .reserve = &origen_reserve,
  663. .restart = exynos4_restart,
  664. MACHINE_END