mach-smdk6410.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. /* linux/arch/arm/mach-s3c64xx/mach-smdk6410.c
  2. *
  3. * Copyright 2008 Openmoko, Inc.
  4. * Copyright 2008 Simtec Electronics
  5. * Ben Dooks <ben@simtec.co.uk>
  6. * http://armlinux.simtec.co.uk/
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/types.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/list.h>
  17. #include <linux/timer.h>
  18. #include <linux/init.h>
  19. #include <linux/input.h>
  20. #include <linux/serial_core.h>
  21. #include <linux/serial_s3c.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/io.h>
  24. #include <linux/i2c.h>
  25. #include <linux/leds.h>
  26. #include <linux/fb.h>
  27. #include <linux/gpio.h>
  28. #include <linux/delay.h>
  29. #include <linux/smsc911x.h>
  30. #include <linux/regulator/fixed.h>
  31. #include <linux/regulator/machine.h>
  32. #include <linux/pwm.h>
  33. #include <linux/pwm_backlight.h>
  34. #include <linux/platform_data/s3c-hsotg.h>
  35. #ifdef CONFIG_SMDK6410_WM1190_EV1
  36. #include <linux/mfd/wm8350/core.h>
  37. #include <linux/mfd/wm8350/pmic.h>
  38. #endif
  39. #ifdef CONFIG_SMDK6410_WM1192_EV1
  40. #include <linux/mfd/wm831x/core.h>
  41. #include <linux/mfd/wm831x/pdata.h>
  42. #endif
  43. #include <video/platform_lcd.h>
  44. #include <video/samsung_fimd.h>
  45. #include <asm/mach/arch.h>
  46. #include <asm/mach/map.h>
  47. #include <asm/mach/irq.h>
  48. #include <mach/hardware.h>
  49. #include <mach/irqs.h>
  50. #include <mach/map.h>
  51. #include <asm/irq.h>
  52. #include <asm/mach-types.h>
  53. #include <mach/regs-gpio.h>
  54. #include <mach/gpio-samsung.h>
  55. #include <linux/platform_data/ata-samsung_cf.h>
  56. #include <linux/platform_data/i2c-s3c2410.h>
  57. #include <plat/fb.h>
  58. #include <plat/gpio-cfg.h>
  59. #include <plat/devs.h>
  60. #include <plat/cpu.h>
  61. #include <plat/adc.h>
  62. #include <linux/platform_data/touchscreen-s3c2410.h>
  63. #include <plat/keypad.h>
  64. #include <plat/samsung-time.h>
  65. #include "backlight.h"
  66. #include "common.h"
  67. #include "regs-modem.h"
  68. #include "regs-srom.h"
  69. #include "regs-sys.h"
  70. #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
  71. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  72. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  73. static struct s3c2410_uartcfg smdk6410_uartcfgs[] __initdata = {
  74. [0] = {
  75. .hwport = 0,
  76. .flags = 0,
  77. .ucon = UCON,
  78. .ulcon = ULCON,
  79. .ufcon = UFCON,
  80. },
  81. [1] = {
  82. .hwport = 1,
  83. .flags = 0,
  84. .ucon = UCON,
  85. .ulcon = ULCON,
  86. .ufcon = UFCON,
  87. },
  88. [2] = {
  89. .hwport = 2,
  90. .flags = 0,
  91. .ucon = UCON,
  92. .ulcon = ULCON,
  93. .ufcon = UFCON,
  94. },
  95. [3] = {
  96. .hwport = 3,
  97. .flags = 0,
  98. .ucon = UCON,
  99. .ulcon = ULCON,
  100. .ufcon = UFCON,
  101. },
  102. };
  103. /* framebuffer and LCD setup. */
  104. /* GPF15 = LCD backlight control
  105. * GPF13 => Panel power
  106. * GPN5 = LCD nRESET signal
  107. * PWM_TOUT1 => backlight brightness
  108. */
  109. static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
  110. unsigned int power)
  111. {
  112. if (power) {
  113. gpio_direction_output(S3C64XX_GPF(13), 1);
  114. /* fire nRESET on power up */
  115. gpio_direction_output(S3C64XX_GPN(5), 0);
  116. msleep(10);
  117. gpio_direction_output(S3C64XX_GPN(5), 1);
  118. msleep(1);
  119. } else {
  120. gpio_direction_output(S3C64XX_GPF(13), 0);
  121. }
  122. }
  123. static struct plat_lcd_data smdk6410_lcd_power_data = {
  124. .set_power = smdk6410_lcd_power_set,
  125. };
  126. static struct platform_device smdk6410_lcd_powerdev = {
  127. .name = "platform-lcd",
  128. .dev.parent = &s3c_device_fb.dev,
  129. .dev.platform_data = &smdk6410_lcd_power_data,
  130. };
  131. static struct s3c_fb_pd_win smdk6410_fb_win0 = {
  132. .max_bpp = 32,
  133. .default_bpp = 16,
  134. .xres = 800,
  135. .yres = 480,
  136. .virtual_y = 480 * 2,
  137. .virtual_x = 800,
  138. };
  139. static struct fb_videomode smdk6410_lcd_timing = {
  140. .left_margin = 8,
  141. .right_margin = 13,
  142. .upper_margin = 7,
  143. .lower_margin = 5,
  144. .hsync_len = 3,
  145. .vsync_len = 1,
  146. .xres = 800,
  147. .yres = 480,
  148. };
  149. /* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */
  150. static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
  151. .setup_gpio = s3c64xx_fb_gpio_setup_24bpp,
  152. .vtiming = &smdk6410_lcd_timing,
  153. .win[0] = &smdk6410_fb_win0,
  154. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
  155. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
  156. };
  157. /*
  158. * Configuring Ethernet on SMDK6410
  159. *
  160. * Both CS8900A and LAN9115 chips share one chip select mediated by CFG6.
  161. * The constant address below corresponds to nCS1
  162. *
  163. * 1) Set CFGB2 p3 ON others off, no other CFGB selects "ethernet"
  164. * 2) CFG6 needs to be switched to "LAN9115" side
  165. */
  166. static struct resource smdk6410_smsc911x_resources[] = {
  167. [0] = DEFINE_RES_MEM(S3C64XX_PA_XM0CSN1, SZ_64K),
  168. [1] = DEFINE_RES_NAMED(S3C_EINT(10), 1, NULL, IORESOURCE_IRQ \
  169. | IRQ_TYPE_LEVEL_LOW),
  170. };
  171. static struct smsc911x_platform_config smdk6410_smsc911x_pdata = {
  172. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  173. .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
  174. .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY,
  175. .phy_interface = PHY_INTERFACE_MODE_MII,
  176. };
  177. static struct platform_device smdk6410_smsc911x = {
  178. .name = "smsc911x",
  179. .id = -1,
  180. .num_resources = ARRAY_SIZE(smdk6410_smsc911x_resources),
  181. .resource = &smdk6410_smsc911x_resources[0],
  182. .dev = {
  183. .platform_data = &smdk6410_smsc911x_pdata,
  184. },
  185. };
  186. #ifdef CONFIG_REGULATOR
  187. static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] = {
  188. REGULATOR_SUPPLY("PVDD", "0-001b"),
  189. REGULATOR_SUPPLY("AVDD", "0-001b"),
  190. };
  191. static struct regulator_init_data __maybe_unused smdk6410_b_pwr_5v_data = {
  192. .constraints = {
  193. .always_on = 1,
  194. },
  195. .num_consumer_supplies = ARRAY_SIZE(smdk6410_b_pwr_5v_consumers),
  196. .consumer_supplies = smdk6410_b_pwr_5v_consumers,
  197. };
  198. static struct fixed_voltage_config smdk6410_b_pwr_5v_pdata = {
  199. .supply_name = "B_PWR_5V",
  200. .microvolts = 5000000,
  201. .init_data = &smdk6410_b_pwr_5v_data,
  202. .gpio = -EINVAL,
  203. };
  204. static struct platform_device smdk6410_b_pwr_5v = {
  205. .name = "reg-fixed-voltage",
  206. .id = -1,
  207. .dev = {
  208. .platform_data = &smdk6410_b_pwr_5v_pdata,
  209. },
  210. };
  211. #endif
  212. static struct s3c_ide_platdata smdk6410_ide_pdata __initdata = {
  213. .setup_gpio = s3c64xx_ide_setup_gpio,
  214. };
  215. static uint32_t smdk6410_keymap[] __initdata = {
  216. /* KEY(row, col, keycode) */
  217. KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
  218. KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
  219. KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
  220. KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
  221. };
  222. static struct matrix_keymap_data smdk6410_keymap_data __initdata = {
  223. .keymap = smdk6410_keymap,
  224. .keymap_size = ARRAY_SIZE(smdk6410_keymap),
  225. };
  226. static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = {
  227. .keymap_data = &smdk6410_keymap_data,
  228. .rows = 2,
  229. .cols = 8,
  230. };
  231. static struct map_desc smdk6410_iodesc[] = {};
  232. static struct platform_device *smdk6410_devices[] __initdata = {
  233. #ifdef CONFIG_SMDK6410_SD_CH0
  234. &s3c_device_hsmmc0,
  235. #endif
  236. #ifdef CONFIG_SMDK6410_SD_CH1
  237. &s3c_device_hsmmc1,
  238. #endif
  239. &s3c_device_i2c0,
  240. &s3c_device_i2c1,
  241. &s3c_device_fb,
  242. &s3c_device_ohci,
  243. &samsung_device_pwm,
  244. &s3c_device_usb_hsotg,
  245. &s3c64xx_device_iisv4,
  246. &samsung_device_keypad,
  247. #ifdef CONFIG_REGULATOR
  248. &smdk6410_b_pwr_5v,
  249. #endif
  250. &smdk6410_lcd_powerdev,
  251. &smdk6410_smsc911x,
  252. &s3c_device_adc,
  253. &s3c_device_cfcon,
  254. &s3c_device_rtc,
  255. &s3c_device_wdt,
  256. };
  257. #ifdef CONFIG_REGULATOR
  258. /* ARM core */
  259. static struct regulator_consumer_supply smdk6410_vddarm_consumers[] = {
  260. REGULATOR_SUPPLY("vddarm", NULL),
  261. };
  262. /* VDDARM, BUCK1 on J5 */
  263. static struct regulator_init_data __maybe_unused smdk6410_vddarm = {
  264. .constraints = {
  265. .name = "PVDD_ARM",
  266. .min_uV = 1000000,
  267. .max_uV = 1300000,
  268. .always_on = 1,
  269. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  270. },
  271. .num_consumer_supplies = ARRAY_SIZE(smdk6410_vddarm_consumers),
  272. .consumer_supplies = smdk6410_vddarm_consumers,
  273. };
  274. /* VDD_INT, BUCK2 on J5 */
  275. static struct regulator_init_data __maybe_unused smdk6410_vddint = {
  276. .constraints = {
  277. .name = "PVDD_INT",
  278. .min_uV = 1000000,
  279. .max_uV = 1200000,
  280. .always_on = 1,
  281. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  282. },
  283. };
  284. /* VDD_HI, LDO3 on J5 */
  285. static struct regulator_init_data __maybe_unused smdk6410_vddhi = {
  286. .constraints = {
  287. .name = "PVDD_HI",
  288. .always_on = 1,
  289. },
  290. };
  291. /* VDD_PLL, LDO2 on J5 */
  292. static struct regulator_init_data __maybe_unused smdk6410_vddpll = {
  293. .constraints = {
  294. .name = "PVDD_PLL",
  295. .always_on = 1,
  296. },
  297. };
  298. /* VDD_UH_MMC, LDO5 on J5 */
  299. static struct regulator_init_data __maybe_unused smdk6410_vdduh_mmc = {
  300. .constraints = {
  301. .name = "PVDD_UH+PVDD_MMC",
  302. .always_on = 1,
  303. },
  304. };
  305. /* VCCM3BT, LDO8 on J5 */
  306. static struct regulator_init_data __maybe_unused smdk6410_vccmc3bt = {
  307. .constraints = {
  308. .name = "PVCCM3BT",
  309. .always_on = 1,
  310. },
  311. };
  312. /* VCCM2MTV, LDO11 on J5 */
  313. static struct regulator_init_data __maybe_unused smdk6410_vccm2mtv = {
  314. .constraints = {
  315. .name = "PVCCM2MTV",
  316. .always_on = 1,
  317. },
  318. };
  319. /* VDD_LCD, LDO12 on J5 */
  320. static struct regulator_init_data __maybe_unused smdk6410_vddlcd = {
  321. .constraints = {
  322. .name = "PVDD_LCD",
  323. .always_on = 1,
  324. },
  325. };
  326. /* VDD_OTGI, LDO9 on J5 */
  327. static struct regulator_init_data __maybe_unused smdk6410_vddotgi = {
  328. .constraints = {
  329. .name = "PVDD_OTGI",
  330. .always_on = 1,
  331. },
  332. };
  333. /* VDD_OTG, LDO14 on J5 */
  334. static struct regulator_init_data __maybe_unused smdk6410_vddotg = {
  335. .constraints = {
  336. .name = "PVDD_OTG",
  337. .always_on = 1,
  338. },
  339. };
  340. /* VDD_ALIVE, LDO15 on J5 */
  341. static struct regulator_init_data __maybe_unused smdk6410_vddalive = {
  342. .constraints = {
  343. .name = "PVDD_ALIVE",
  344. .always_on = 1,
  345. },
  346. };
  347. /* VDD_AUDIO, VLDO_AUDIO on J5 */
  348. static struct regulator_init_data __maybe_unused smdk6410_vddaudio = {
  349. .constraints = {
  350. .name = "PVDD_AUDIO",
  351. .always_on = 1,
  352. },
  353. };
  354. #endif
  355. #ifdef CONFIG_SMDK6410_WM1190_EV1
  356. /* S3C64xx internal logic & PLL */
  357. static struct regulator_init_data __maybe_unused wm8350_dcdc1_data = {
  358. .constraints = {
  359. .name = "PVDD_INT+PVDD_PLL",
  360. .min_uV = 1200000,
  361. .max_uV = 1200000,
  362. .always_on = 1,
  363. .apply_uV = 1,
  364. },
  365. };
  366. /* Memory */
  367. static struct regulator_init_data __maybe_unused wm8350_dcdc3_data = {
  368. .constraints = {
  369. .name = "PVDD_MEM",
  370. .min_uV = 1800000,
  371. .max_uV = 1800000,
  372. .always_on = 1,
  373. .state_mem = {
  374. .uV = 1800000,
  375. .mode = REGULATOR_MODE_NORMAL,
  376. .enabled = 1,
  377. },
  378. .initial_state = PM_SUSPEND_MEM,
  379. },
  380. };
  381. /* USB, EXT, PCM, ADC/DAC, USB, MMC */
  382. static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = {
  383. REGULATOR_SUPPLY("DVDD", "0-001b"),
  384. };
  385. static struct regulator_init_data __maybe_unused wm8350_dcdc4_data = {
  386. .constraints = {
  387. .name = "PVDD_HI+PVDD_EXT+PVDD_SYS+PVCCM2MTV",
  388. .min_uV = 3000000,
  389. .max_uV = 3000000,
  390. .always_on = 1,
  391. },
  392. .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers),
  393. .consumer_supplies = wm8350_dcdc4_consumers,
  394. };
  395. /* OTGi/1190-EV1 HPVDD & AVDD */
  396. static struct regulator_init_data __maybe_unused wm8350_ldo4_data = {
  397. .constraints = {
  398. .name = "PVDD_OTGI+HPVDD+AVDD",
  399. .min_uV = 1200000,
  400. .max_uV = 1200000,
  401. .apply_uV = 1,
  402. .always_on = 1,
  403. },
  404. };
  405. static struct {
  406. int regulator;
  407. struct regulator_init_data *initdata;
  408. } wm1190_regulators[] = {
  409. { WM8350_DCDC_1, &wm8350_dcdc1_data },
  410. { WM8350_DCDC_3, &wm8350_dcdc3_data },
  411. { WM8350_DCDC_4, &wm8350_dcdc4_data },
  412. { WM8350_DCDC_6, &smdk6410_vddarm },
  413. { WM8350_LDO_1, &smdk6410_vddalive },
  414. { WM8350_LDO_2, &smdk6410_vddotg },
  415. { WM8350_LDO_3, &smdk6410_vddlcd },
  416. { WM8350_LDO_4, &wm8350_ldo4_data },
  417. };
  418. static int __init smdk6410_wm8350_init(struct wm8350 *wm8350)
  419. {
  420. int i;
  421. /* Configure the IRQ line */
  422. s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP);
  423. /* Instantiate the regulators */
  424. for (i = 0; i < ARRAY_SIZE(wm1190_regulators); i++)
  425. wm8350_register_regulator(wm8350,
  426. wm1190_regulators[i].regulator,
  427. wm1190_regulators[i].initdata);
  428. return 0;
  429. }
  430. static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = {
  431. .init = smdk6410_wm8350_init,
  432. .irq_high = 1,
  433. .irq_base = IRQ_BOARD_START,
  434. };
  435. #endif
  436. #ifdef CONFIG_SMDK6410_WM1192_EV1
  437. static struct gpio_led wm1192_pmic_leds[] = {
  438. {
  439. .name = "PMIC:red:power",
  440. .gpio = GPIO_BOARD_START + 3,
  441. .default_state = LEDS_GPIO_DEFSTATE_ON,
  442. },
  443. };
  444. static struct gpio_led_platform_data wm1192_pmic_led = {
  445. .num_leds = ARRAY_SIZE(wm1192_pmic_leds),
  446. .leds = wm1192_pmic_leds,
  447. };
  448. static struct platform_device wm1192_pmic_led_dev = {
  449. .name = "leds-gpio",
  450. .id = -1,
  451. .dev = {
  452. .platform_data = &wm1192_pmic_led,
  453. },
  454. };
  455. static int wm1192_pre_init(struct wm831x *wm831x)
  456. {
  457. int ret;
  458. /* Configure the IRQ line */
  459. s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP);
  460. ret = platform_device_register(&wm1192_pmic_led_dev);
  461. if (ret != 0)
  462. dev_err(wm831x->dev, "Failed to add PMIC LED: %d\n", ret);
  463. return 0;
  464. }
  465. static struct wm831x_backlight_pdata wm1192_backlight_pdata = {
  466. .isink = 1,
  467. .max_uA = 27554,
  468. };
  469. static struct regulator_init_data __maybe_unused wm1192_dcdc3 = {
  470. .constraints = {
  471. .name = "PVDD_MEM+PVDD_GPS",
  472. .always_on = 1,
  473. },
  474. };
  475. static struct regulator_consumer_supply wm1192_ldo1_consumers[] = {
  476. REGULATOR_SUPPLY("DVDD", "0-001b"), /* WM8580 */
  477. };
  478. static struct regulator_init_data __maybe_unused wm1192_ldo1 = {
  479. .constraints = {
  480. .name = "PVDD_LCD+PVDD_EXT",
  481. .always_on = 1,
  482. },
  483. .consumer_supplies = wm1192_ldo1_consumers,
  484. .num_consumer_supplies = ARRAY_SIZE(wm1192_ldo1_consumers),
  485. };
  486. static struct wm831x_status_pdata wm1192_led7_pdata = {
  487. .name = "LED7:green:",
  488. };
  489. static struct wm831x_status_pdata wm1192_led8_pdata = {
  490. .name = "LED8:green:",
  491. };
  492. static struct wm831x_pdata smdk6410_wm1192_pdata = {
  493. .pre_init = wm1192_pre_init,
  494. .backlight = &wm1192_backlight_pdata,
  495. .dcdc = {
  496. &smdk6410_vddarm, /* DCDC1 */
  497. &smdk6410_vddint, /* DCDC2 */
  498. &wm1192_dcdc3,
  499. },
  500. .gpio_base = GPIO_BOARD_START,
  501. .ldo = {
  502. &wm1192_ldo1, /* LDO1 */
  503. &smdk6410_vdduh_mmc, /* LDO2 */
  504. NULL, /* LDO3 NC */
  505. &smdk6410_vddotgi, /* LDO4 */
  506. &smdk6410_vddotg, /* LDO5 */
  507. &smdk6410_vddhi, /* LDO6 */
  508. &smdk6410_vddaudio, /* LDO7 */
  509. &smdk6410_vccm2mtv, /* LDO8 */
  510. &smdk6410_vddpll, /* LDO9 */
  511. &smdk6410_vccmc3bt, /* LDO10 */
  512. &smdk6410_vddalive, /* LDO11 */
  513. },
  514. .status = {
  515. &wm1192_led7_pdata,
  516. &wm1192_led8_pdata,
  517. },
  518. };
  519. #endif
  520. static struct i2c_board_info i2c_devs0[] __initdata = {
  521. { I2C_BOARD_INFO("24c08", 0x50), },
  522. { I2C_BOARD_INFO("wm8580", 0x1b), },
  523. #ifdef CONFIG_SMDK6410_WM1192_EV1
  524. { I2C_BOARD_INFO("wm8312", 0x34),
  525. .platform_data = &smdk6410_wm1192_pdata,
  526. .irq = S3C_EINT(12),
  527. },
  528. #endif
  529. #ifdef CONFIG_SMDK6410_WM1190_EV1
  530. { I2C_BOARD_INFO("wm8350", 0x1a),
  531. .platform_data = &smdk6410_wm8350_pdata,
  532. .irq = S3C_EINT(12),
  533. },
  534. #endif
  535. };
  536. static struct i2c_board_info i2c_devs1[] __initdata = {
  537. { I2C_BOARD_INFO("24c128", 0x57), }, /* Samsung S524AD0XD1 */
  538. };
  539. /* LCD Backlight data */
  540. static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {
  541. .no = S3C64XX_GPF(15),
  542. .func = S3C_GPIO_SFN(2),
  543. };
  544. static struct pwm_lookup smdk6410_pwm_lookup[] = {
  545. PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL, 78770,
  546. PWM_POLARITY_NORMAL),
  547. };
  548. static struct platform_pwm_backlight_data smdk6410_bl_data = {
  549. .enable_gpio = -1,
  550. };
  551. static struct dwc2_hsotg_plat smdk6410_hsotg_pdata;
  552. static void __init smdk6410_map_io(void)
  553. {
  554. u32 tmp;
  555. s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc));
  556. s3c64xx_set_xtal_freq(12000000);
  557. s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs));
  558. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  559. /* set the LCD type */
  560. tmp = __raw_readl(S3C64XX_SPCON);
  561. tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK;
  562. tmp |= S3C64XX_SPCON_LCD_SEL_RGB;
  563. __raw_writel(tmp, S3C64XX_SPCON);
  564. /* remove the lcd bypass */
  565. tmp = __raw_readl(S3C64XX_MODEM_MIFPCON);
  566. tmp &= ~MIFPCON_LCD_BYPASS;
  567. __raw_writel(tmp, S3C64XX_MODEM_MIFPCON);
  568. }
  569. static void __init smdk6410_machine_init(void)
  570. {
  571. u32 cs1;
  572. s3c_i2c0_set_platdata(NULL);
  573. s3c_i2c1_set_platdata(NULL);
  574. s3c_fb_set_platdata(&smdk6410_lcd_pdata);
  575. dwc2_hsotg_set_platdata(&smdk6410_hsotg_pdata);
  576. samsung_keypad_set_platdata(&smdk6410_keypad_data);
  577. s3c64xx_ts_set_platdata(NULL);
  578. /* configure nCS1 width to 16 bits */
  579. cs1 = __raw_readl(S3C64XX_SROM_BW) &
  580. ~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT);
  581. cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) |
  582. (1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) |
  583. (1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) <<
  584. S3C64XX_SROM_BW__NCS1__SHIFT;
  585. __raw_writel(cs1, S3C64XX_SROM_BW);
  586. /* set timing for nCS1 suitable for ethernet chip */
  587. __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) |
  588. (6 << S3C64XX_SROM_BCX__TACP__SHIFT) |
  589. (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) |
  590. (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) |
  591. (0xe << S3C64XX_SROM_BCX__TACC__SHIFT) |
  592. (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) |
  593. (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1);
  594. gpio_request(S3C64XX_GPN(5), "LCD power");
  595. gpio_request(S3C64XX_GPF(13), "LCD power");
  596. i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
  597. i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
  598. s3c_ide_set_platdata(&smdk6410_ide_pdata);
  599. platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
  600. pwm_add_table(smdk6410_pwm_lookup, ARRAY_SIZE(smdk6410_pwm_lookup));
  601. samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
  602. }
  603. MACHINE_START(SMDK6410, "SMDK6410")
  604. /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
  605. .atag_offset = 0x100,
  606. .nr_irqs = S3C64XX_NR_IRQS,
  607. .init_irq = s3c6410_init_irq,
  608. .map_io = smdk6410_map_io,
  609. .init_machine = smdk6410_machine_init,
  610. .init_time = samsung_timer_init,
  611. .restart = s3c64xx_restart,
  612. MACHINE_END