mach-smdk6410.c 17 KB

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