mach-jive.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. /* linux/arch/arm/mach-s3c2410/mach-jive.c
  2. *
  3. * Copyright 2007 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  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. #include <linux/kernel.h>
  13. #include <linux/types.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/list.h>
  16. #include <linux/timer.h>
  17. #include <linux/init.h>
  18. #include <linux/gpio.h>
  19. #include <linux/syscore_ops.h>
  20. #include <linux/serial_core.h>
  21. #include <linux/serial_s3c.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/i2c.h>
  24. #include <video/ili9320.h>
  25. #include <linux/spi/spi.h>
  26. #include <linux/spi/spi_gpio.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/mach/map.h>
  29. #include <asm/mach/irq.h>
  30. #include <linux/platform_data/mtd-nand-s3c2410.h>
  31. #include <linux/platform_data/i2c-s3c2410.h>
  32. #include <mach/regs-gpio.h>
  33. #include <mach/regs-lcd.h>
  34. #include <mach/fb.h>
  35. #include <mach/gpio-samsung.h>
  36. #include <asm/mach-types.h>
  37. #include <linux/mtd/mtd.h>
  38. #include <linux/mtd/nand.h>
  39. #include <linux/mtd/nand_ecc.h>
  40. #include <linux/mtd/partitions.h>
  41. #include <plat/gpio-cfg.h>
  42. #include <plat/devs.h>
  43. #include <plat/cpu.h>
  44. #include <plat/pm.h>
  45. #include <linux/platform_data/usb-s3c2410_udc.h>
  46. #include <plat/samsung-time.h>
  47. #include "common.h"
  48. #include "s3c2412-power.h"
  49. static struct map_desc jive_iodesc[] __initdata = {
  50. };
  51. #define UCON S3C2410_UCON_DEFAULT
  52. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
  53. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  54. static struct s3c2410_uartcfg jive_uartcfgs[] = {
  55. [0] = {
  56. .hwport = 0,
  57. .flags = 0,
  58. .ucon = UCON,
  59. .ulcon = ULCON,
  60. .ufcon = UFCON,
  61. },
  62. [1] = {
  63. .hwport = 1,
  64. .flags = 0,
  65. .ucon = UCON,
  66. .ulcon = ULCON,
  67. .ufcon = UFCON,
  68. },
  69. [2] = {
  70. .hwport = 2,
  71. .flags = 0,
  72. .ucon = UCON,
  73. .ulcon = ULCON,
  74. .ufcon = UFCON,
  75. }
  76. };
  77. /* Jive flash assignment
  78. *
  79. * 0x00000000-0x00028000 : uboot
  80. * 0x00028000-0x0002c000 : uboot env
  81. * 0x0002c000-0x00030000 : spare
  82. * 0x00030000-0x00200000 : zimage A
  83. * 0x00200000-0x01600000 : cramfs A
  84. * 0x01600000-0x017d0000 : zimage B
  85. * 0x017d0000-0x02bd0000 : cramfs B
  86. * 0x02bd0000-0x03fd0000 : yaffs
  87. */
  88. static struct mtd_partition __initdata jive_imageA_nand_part[] = {
  89. #ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER
  90. /* Don't allow access to the bootloader from linux */
  91. {
  92. .name = "uboot",
  93. .offset = 0,
  94. .size = (160 * SZ_1K),
  95. .mask_flags = MTD_WRITEABLE, /* force read-only */
  96. },
  97. /* spare */
  98. {
  99. .name = "spare",
  100. .offset = (176 * SZ_1K),
  101. .size = (16 * SZ_1K),
  102. },
  103. #endif
  104. /* booted images */
  105. {
  106. .name = "kernel (ro)",
  107. .offset = (192 * SZ_1K),
  108. .size = (SZ_2M) - (192 * SZ_1K),
  109. .mask_flags = MTD_WRITEABLE, /* force read-only */
  110. }, {
  111. .name = "root (ro)",
  112. .offset = (SZ_2M),
  113. .size = (20 * SZ_1M),
  114. .mask_flags = MTD_WRITEABLE, /* force read-only */
  115. },
  116. /* yaffs */
  117. {
  118. .name = "yaffs",
  119. .offset = (44 * SZ_1M),
  120. .size = (20 * SZ_1M),
  121. },
  122. /* bootloader environment */
  123. {
  124. .name = "env",
  125. .offset = (160 * SZ_1K),
  126. .size = (16 * SZ_1K),
  127. },
  128. /* upgrade images */
  129. {
  130. .name = "zimage",
  131. .offset = (22 * SZ_1M),
  132. .size = (2 * SZ_1M) - (192 * SZ_1K),
  133. }, {
  134. .name = "cramfs",
  135. .offset = (24 * SZ_1M) - (192*SZ_1K),
  136. .size = (20 * SZ_1M),
  137. },
  138. };
  139. static struct mtd_partition __initdata jive_imageB_nand_part[] = {
  140. #ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER
  141. /* Don't allow access to the bootloader from linux */
  142. {
  143. .name = "uboot",
  144. .offset = 0,
  145. .size = (160 * SZ_1K),
  146. .mask_flags = MTD_WRITEABLE, /* force read-only */
  147. },
  148. /* spare */
  149. {
  150. .name = "spare",
  151. .offset = (176 * SZ_1K),
  152. .size = (16 * SZ_1K),
  153. },
  154. #endif
  155. /* booted images */
  156. {
  157. .name = "kernel (ro)",
  158. .offset = (22 * SZ_1M),
  159. .size = (2 * SZ_1M) - (192 * SZ_1K),
  160. .mask_flags = MTD_WRITEABLE, /* force read-only */
  161. },
  162. {
  163. .name = "root (ro)",
  164. .offset = (24 * SZ_1M) - (192 * SZ_1K),
  165. .size = (20 * SZ_1M),
  166. .mask_flags = MTD_WRITEABLE, /* force read-only */
  167. },
  168. /* yaffs */
  169. {
  170. .name = "yaffs",
  171. .offset = (44 * SZ_1M),
  172. .size = (20 * SZ_1M),
  173. },
  174. /* bootloader environment */
  175. {
  176. .name = "env",
  177. .offset = (160 * SZ_1K),
  178. .size = (16 * SZ_1K),
  179. },
  180. /* upgrade images */
  181. {
  182. .name = "zimage",
  183. .offset = (192 * SZ_1K),
  184. .size = (2 * SZ_1M) - (192 * SZ_1K),
  185. }, {
  186. .name = "cramfs",
  187. .offset = (2 * SZ_1M),
  188. .size = (20 * SZ_1M),
  189. },
  190. };
  191. static struct s3c2410_nand_set __initdata jive_nand_sets[] = {
  192. [0] = {
  193. .name = "flash",
  194. .nr_chips = 1,
  195. .nr_partitions = ARRAY_SIZE(jive_imageA_nand_part),
  196. .partitions = jive_imageA_nand_part,
  197. },
  198. };
  199. static struct s3c2410_platform_nand __initdata jive_nand_info = {
  200. /* set taken from osiris nand timings, possibly still conservative */
  201. .tacls = 30,
  202. .twrph0 = 55,
  203. .twrph1 = 40,
  204. .sets = jive_nand_sets,
  205. .nr_sets = ARRAY_SIZE(jive_nand_sets),
  206. };
  207. static int __init jive_mtdset(char *options)
  208. {
  209. struct s3c2410_nand_set *nand = &jive_nand_sets[0];
  210. unsigned long set;
  211. if (options == NULL || options[0] == '\0')
  212. return 0;
  213. if (kstrtoul(options, 10, &set)) {
  214. printk(KERN_ERR "failed to parse mtdset=%s\n", options);
  215. return 0;
  216. }
  217. switch (set) {
  218. case 1:
  219. nand->nr_partitions = ARRAY_SIZE(jive_imageB_nand_part);
  220. nand->partitions = jive_imageB_nand_part;
  221. case 0:
  222. /* this is already setup in the nand info */
  223. break;
  224. default:
  225. printk(KERN_ERR "Unknown mtd set %ld specified,"
  226. "using default.", set);
  227. }
  228. return 0;
  229. }
  230. /* parse the mtdset= option given to the kernel command line */
  231. __setup("mtdset=", jive_mtdset);
  232. /* LCD timing and setup */
  233. #define LCD_XRES (240)
  234. #define LCD_YRES (320)
  235. #define LCD_LEFT_MARGIN (12)
  236. #define LCD_RIGHT_MARGIN (12)
  237. #define LCD_LOWER_MARGIN (12)
  238. #define LCD_UPPER_MARGIN (12)
  239. #define LCD_VSYNC (2)
  240. #define LCD_HSYNC (2)
  241. #define LCD_REFRESH (60)
  242. #define LCD_HTOT (LCD_HSYNC + LCD_LEFT_MARGIN + LCD_XRES + LCD_RIGHT_MARGIN)
  243. #define LCD_VTOT (LCD_VSYNC + LCD_LOWER_MARGIN + LCD_YRES + LCD_UPPER_MARGIN)
  244. static struct s3c2410fb_display jive_vgg2432a4_display[] = {
  245. [0] = {
  246. .width = LCD_XRES,
  247. .height = LCD_YRES,
  248. .xres = LCD_XRES,
  249. .yres = LCD_YRES,
  250. .left_margin = LCD_LEFT_MARGIN,
  251. .right_margin = LCD_RIGHT_MARGIN,
  252. .upper_margin = LCD_UPPER_MARGIN,
  253. .lower_margin = LCD_LOWER_MARGIN,
  254. .hsync_len = LCD_HSYNC,
  255. .vsync_len = LCD_VSYNC,
  256. .pixclock = (1000000000000LL /
  257. (LCD_REFRESH * LCD_HTOT * LCD_VTOT)),
  258. .bpp = 16,
  259. .type = (S3C2410_LCDCON1_TFT16BPP |
  260. S3C2410_LCDCON1_TFT),
  261. .lcdcon5 = (S3C2410_LCDCON5_FRM565 |
  262. S3C2410_LCDCON5_INVVLINE |
  263. S3C2410_LCDCON5_INVVFRAME |
  264. S3C2410_LCDCON5_INVVDEN |
  265. S3C2410_LCDCON5_PWREN),
  266. },
  267. };
  268. /* todo - put into gpio header */
  269. #define S3C2410_GPCCON_MASK(x) (3 << ((x) * 2))
  270. #define S3C2410_GPDCON_MASK(x) (3 << ((x) * 2))
  271. static struct s3c2410fb_mach_info jive_lcd_config = {
  272. .displays = jive_vgg2432a4_display,
  273. .num_displays = ARRAY_SIZE(jive_vgg2432a4_display),
  274. .default_display = 0,
  275. /* Enable VD[2..7], VD[10..15], VD[18..23] and VCLK, syncs, VDEN
  276. * and disable the pull down resistors on pins we are using for LCD
  277. * data. */
  278. .gpcup = (0xf << 1) | (0x3f << 10),
  279. .gpccon = (S3C2410_GPC1_VCLK | S3C2410_GPC2_VLINE |
  280. S3C2410_GPC3_VFRAME | S3C2410_GPC4_VM |
  281. S3C2410_GPC10_VD2 | S3C2410_GPC11_VD3 |
  282. S3C2410_GPC12_VD4 | S3C2410_GPC13_VD5 |
  283. S3C2410_GPC14_VD6 | S3C2410_GPC15_VD7),
  284. .gpccon_mask = (S3C2410_GPCCON_MASK(1) | S3C2410_GPCCON_MASK(2) |
  285. S3C2410_GPCCON_MASK(3) | S3C2410_GPCCON_MASK(4) |
  286. S3C2410_GPCCON_MASK(10) | S3C2410_GPCCON_MASK(11) |
  287. S3C2410_GPCCON_MASK(12) | S3C2410_GPCCON_MASK(13) |
  288. S3C2410_GPCCON_MASK(14) | S3C2410_GPCCON_MASK(15)),
  289. .gpdup = (0x3f << 2) | (0x3f << 10),
  290. .gpdcon = (S3C2410_GPD2_VD10 | S3C2410_GPD3_VD11 |
  291. S3C2410_GPD4_VD12 | S3C2410_GPD5_VD13 |
  292. S3C2410_GPD6_VD14 | S3C2410_GPD7_VD15 |
  293. S3C2410_GPD10_VD18 | S3C2410_GPD11_VD19 |
  294. S3C2410_GPD12_VD20 | S3C2410_GPD13_VD21 |
  295. S3C2410_GPD14_VD22 | S3C2410_GPD15_VD23),
  296. .gpdcon_mask = (S3C2410_GPDCON_MASK(2) | S3C2410_GPDCON_MASK(3) |
  297. S3C2410_GPDCON_MASK(4) | S3C2410_GPDCON_MASK(5) |
  298. S3C2410_GPDCON_MASK(6) | S3C2410_GPDCON_MASK(7) |
  299. S3C2410_GPDCON_MASK(10) | S3C2410_GPDCON_MASK(11)|
  300. S3C2410_GPDCON_MASK(12) | S3C2410_GPDCON_MASK(13)|
  301. S3C2410_GPDCON_MASK(14) | S3C2410_GPDCON_MASK(15)),
  302. };
  303. /* ILI9320 support. */
  304. static void jive_lcm_reset(unsigned int set)
  305. {
  306. printk(KERN_DEBUG "%s(%d)\n", __func__, set);
  307. gpio_set_value(S3C2410_GPG(13), set);
  308. }
  309. #undef LCD_UPPER_MARGIN
  310. #define LCD_UPPER_MARGIN 2
  311. static struct ili9320_platdata jive_lcm_config = {
  312. .hsize = LCD_XRES,
  313. .vsize = LCD_YRES,
  314. .reset = jive_lcm_reset,
  315. .suspend = ILI9320_SUSPEND_DEEP,
  316. .entry_mode = ILI9320_ENTRYMODE_ID(3) | ILI9320_ENTRYMODE_BGR,
  317. .display2 = (ILI9320_DISPLAY2_FP(LCD_UPPER_MARGIN) |
  318. ILI9320_DISPLAY2_BP(LCD_LOWER_MARGIN)),
  319. .display3 = 0x0,
  320. .display4 = 0x0,
  321. .rgb_if1 = (ILI9320_RGBIF1_RIM_RGB18 |
  322. ILI9320_RGBIF1_RM | ILI9320_RGBIF1_CLK_RGBIF),
  323. .rgb_if2 = ILI9320_RGBIF2_DPL,
  324. .interface2 = 0x0,
  325. .interface3 = 0x3,
  326. .interface4 = (ILI9320_INTERFACE4_RTNE(16) |
  327. ILI9320_INTERFACE4_DIVE(1)),
  328. .interface5 = 0x0,
  329. .interface6 = 0x0,
  330. };
  331. /* LCD SPI support */
  332. static struct spi_gpio_platform_data jive_lcd_spi = {
  333. .sck = S3C2410_GPG(8),
  334. .mosi = S3C2410_GPB(8),
  335. .miso = SPI_GPIO_NO_MISO,
  336. };
  337. static struct platform_device jive_device_lcdspi = {
  338. .name = "spi-gpio",
  339. .id = 1,
  340. .dev.platform_data = &jive_lcd_spi,
  341. };
  342. /* WM8750 audio code SPI definition */
  343. static struct spi_gpio_platform_data jive_wm8750_spi = {
  344. .sck = S3C2410_GPB(4),
  345. .mosi = S3C2410_GPB(9),
  346. .miso = SPI_GPIO_NO_MISO,
  347. };
  348. static struct platform_device jive_device_wm8750 = {
  349. .name = "spi-gpio",
  350. .id = 2,
  351. .dev.platform_data = &jive_wm8750_spi,
  352. };
  353. /* JIVE SPI devices. */
  354. static struct spi_board_info __initdata jive_spi_devs[] = {
  355. [0] = {
  356. .modalias = "VGG2432A4",
  357. .bus_num = 1,
  358. .chip_select = 0,
  359. .mode = SPI_MODE_3, /* CPOL=1, CPHA=1 */
  360. .max_speed_hz = 100000,
  361. .platform_data = &jive_lcm_config,
  362. .controller_data = (void *)S3C2410_GPB(7),
  363. }, {
  364. .modalias = "WM8750",
  365. .bus_num = 2,
  366. .chip_select = 0,
  367. .mode = SPI_MODE_0, /* CPOL=0, CPHA=0 */
  368. .max_speed_hz = 100000,
  369. .controller_data = (void *)S3C2410_GPH(10),
  370. },
  371. };
  372. /* I2C bus and device configuration. */
  373. static struct s3c2410_platform_i2c jive_i2c_cfg __initdata = {
  374. .frequency = 80 * 1000,
  375. .flags = S3C_IICFLG_FILTER,
  376. .sda_delay = 2,
  377. };
  378. static struct i2c_board_info jive_i2c_devs[] __initdata = {
  379. [0] = {
  380. I2C_BOARD_INFO("lis302dl", 0x1c),
  381. .irq = IRQ_EINT14,
  382. },
  383. };
  384. /* The platform devices being used. */
  385. static struct platform_device *jive_devices[] __initdata = {
  386. &s3c_device_ohci,
  387. &s3c_device_rtc,
  388. &s3c_device_wdt,
  389. &s3c_device_i2c0,
  390. &s3c_device_lcd,
  391. &jive_device_lcdspi,
  392. &jive_device_wm8750,
  393. &s3c_device_nand,
  394. &s3c_device_usbgadget,
  395. &s3c2412_device_dma,
  396. };
  397. static struct s3c2410_udc_mach_info jive_udc_cfg __initdata = {
  398. .vbus_pin = S3C2410_GPG(1), /* detect is on GPG1 */
  399. };
  400. /* Jive power management device */
  401. #ifdef CONFIG_PM
  402. static int jive_pm_suspend(void)
  403. {
  404. /* Write the magic value u-boot uses to check for resume into
  405. * the INFORM0 register, and ensure INFORM1 is set to the
  406. * correct address to resume from. */
  407. __raw_writel(0x2BED, S3C2412_INFORM0);
  408. __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
  409. return 0;
  410. }
  411. static void jive_pm_resume(void)
  412. {
  413. __raw_writel(0x0, S3C2412_INFORM0);
  414. }
  415. #else
  416. #define jive_pm_suspend NULL
  417. #define jive_pm_resume NULL
  418. #endif
  419. static struct syscore_ops jive_pm_syscore_ops = {
  420. .suspend = jive_pm_suspend,
  421. .resume = jive_pm_resume,
  422. };
  423. static void __init jive_map_io(void)
  424. {
  425. s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc));
  426. s3c24xx_init_uarts(jive_uartcfgs, ARRAY_SIZE(jive_uartcfgs));
  427. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  428. }
  429. static void __init jive_init_time(void)
  430. {
  431. s3c2412_init_clocks(12000000);
  432. samsung_timer_init();
  433. }
  434. static void jive_power_off(void)
  435. {
  436. printk(KERN_INFO "powering system down...\n");
  437. gpio_request_one(S3C2410_GPC(5), GPIOF_OUT_INIT_HIGH, NULL);
  438. gpio_free(S3C2410_GPC(5));
  439. }
  440. static void __init jive_machine_init(void)
  441. {
  442. /* register system core operations for managing low level suspend */
  443. register_syscore_ops(&jive_pm_syscore_ops);
  444. /* write our sleep configurations for the IO. Pull down all unused
  445. * IO, ensure that we have turned off all peripherals we do not
  446. * need, and configure the ones we do need. */
  447. /* Port B sleep */
  448. __raw_writel(S3C2412_SLPCON_IN(0) |
  449. S3C2412_SLPCON_PULL(1) |
  450. S3C2412_SLPCON_HIGH(2) |
  451. S3C2412_SLPCON_PULL(3) |
  452. S3C2412_SLPCON_PULL(4) |
  453. S3C2412_SLPCON_PULL(5) |
  454. S3C2412_SLPCON_PULL(6) |
  455. S3C2412_SLPCON_HIGH(7) |
  456. S3C2412_SLPCON_PULL(8) |
  457. S3C2412_SLPCON_PULL(9) |
  458. S3C2412_SLPCON_PULL(10), S3C2412_GPBSLPCON);
  459. /* Port C sleep */
  460. __raw_writel(S3C2412_SLPCON_PULL(0) |
  461. S3C2412_SLPCON_PULL(1) |
  462. S3C2412_SLPCON_PULL(2) |
  463. S3C2412_SLPCON_PULL(3) |
  464. S3C2412_SLPCON_PULL(4) |
  465. S3C2412_SLPCON_PULL(5) |
  466. S3C2412_SLPCON_LOW(6) |
  467. S3C2412_SLPCON_PULL(6) |
  468. S3C2412_SLPCON_PULL(7) |
  469. S3C2412_SLPCON_PULL(8) |
  470. S3C2412_SLPCON_PULL(9) |
  471. S3C2412_SLPCON_PULL(10) |
  472. S3C2412_SLPCON_PULL(11) |
  473. S3C2412_SLPCON_PULL(12) |
  474. S3C2412_SLPCON_PULL(13) |
  475. S3C2412_SLPCON_PULL(14) |
  476. S3C2412_SLPCON_PULL(15), S3C2412_GPCSLPCON);
  477. /* Port D sleep */
  478. __raw_writel(S3C2412_SLPCON_ALL_PULL, S3C2412_GPDSLPCON);
  479. /* Port F sleep */
  480. __raw_writel(S3C2412_SLPCON_LOW(0) |
  481. S3C2412_SLPCON_LOW(1) |
  482. S3C2412_SLPCON_LOW(2) |
  483. S3C2412_SLPCON_EINT(3) |
  484. S3C2412_SLPCON_EINT(4) |
  485. S3C2412_SLPCON_EINT(5) |
  486. S3C2412_SLPCON_EINT(6) |
  487. S3C2412_SLPCON_EINT(7), S3C2412_GPFSLPCON);
  488. /* Port G sleep */
  489. __raw_writel(S3C2412_SLPCON_IN(0) |
  490. S3C2412_SLPCON_IN(1) |
  491. S3C2412_SLPCON_IN(2) |
  492. S3C2412_SLPCON_IN(3) |
  493. S3C2412_SLPCON_IN(4) |
  494. S3C2412_SLPCON_IN(5) |
  495. S3C2412_SLPCON_IN(6) |
  496. S3C2412_SLPCON_IN(7) |
  497. S3C2412_SLPCON_PULL(8) |
  498. S3C2412_SLPCON_PULL(9) |
  499. S3C2412_SLPCON_IN(10) |
  500. S3C2412_SLPCON_PULL(11) |
  501. S3C2412_SLPCON_PULL(12) |
  502. S3C2412_SLPCON_PULL(13) |
  503. S3C2412_SLPCON_IN(14) |
  504. S3C2412_SLPCON_PULL(15), S3C2412_GPGSLPCON);
  505. /* Port H sleep */
  506. __raw_writel(S3C2412_SLPCON_PULL(0) |
  507. S3C2412_SLPCON_PULL(1) |
  508. S3C2412_SLPCON_PULL(2) |
  509. S3C2412_SLPCON_PULL(3) |
  510. S3C2412_SLPCON_PULL(4) |
  511. S3C2412_SLPCON_PULL(5) |
  512. S3C2412_SLPCON_PULL(6) |
  513. S3C2412_SLPCON_IN(7) |
  514. S3C2412_SLPCON_IN(8) |
  515. S3C2412_SLPCON_PULL(9) |
  516. S3C2412_SLPCON_IN(10), S3C2412_GPHSLPCON);
  517. /* initialise the power management now we've setup everything. */
  518. s3c_pm_init();
  519. /** TODO - check that this is after the cmdline option! */
  520. s3c_nand_set_platdata(&jive_nand_info);
  521. /* initialise the spi */
  522. gpio_request(S3C2410_GPG(13), "lcm reset");
  523. gpio_direction_output(S3C2410_GPG(13), 0);
  524. gpio_request(S3C2410_GPB(7), "jive spi");
  525. gpio_direction_output(S3C2410_GPB(7), 1);
  526. gpio_request_one(S3C2410_GPB(6), GPIOF_OUT_INIT_LOW, NULL);
  527. gpio_free(S3C2410_GPB(6));
  528. gpio_request_one(S3C2410_GPG(8), GPIOF_OUT_INIT_HIGH, NULL);
  529. gpio_free(S3C2410_GPG(8));
  530. /* initialise the WM8750 spi */
  531. gpio_request(S3C2410_GPH(10), "jive wm8750 spi");
  532. gpio_direction_output(S3C2410_GPH(10), 1);
  533. /* Turn off suspend on both USB ports, and switch the
  534. * selectable USB port to USB device mode. */
  535. s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
  536. S3C2410_MISCCR_USBSUSPND0 |
  537. S3C2410_MISCCR_USBSUSPND1, 0x0);
  538. s3c24xx_udc_set_platdata(&jive_udc_cfg);
  539. s3c24xx_fb_set_platdata(&jive_lcd_config);
  540. spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs));
  541. s3c_i2c0_set_platdata(&jive_i2c_cfg);
  542. i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs));
  543. pm_power_off = jive_power_off;
  544. platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices));
  545. }
  546. MACHINE_START(JIVE, "JIVE")
  547. /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
  548. .atag_offset = 0x100,
  549. .init_irq = s3c2412_init_irq,
  550. .map_io = jive_map_io,
  551. .init_machine = jive_machine_init,
  552. .init_time = jive_init_time,
  553. MACHINE_END