mach-jive.c 17 KB

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