mach-jive.c 17 KB

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