mach-rx3715.c 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /* linux/arch/arm/mach-s3c2440/mach-rx3715.c
  2. *
  3. * Copyright (c) 2003-2004 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * http://www.handhelds.org/projects/rx3715.html
  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/memblock.h>
  18. #include <linux/timer.h>
  19. #include <linux/init.h>
  20. #include <linux/tty.h>
  21. #include <linux/console.h>
  22. #include <linux/sysdev.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/serial_core.h>
  25. #include <linux/serial.h>
  26. #include <linux/io.h>
  27. #include <linux/mtd/mtd.h>
  28. #include <linux/mtd/nand.h>
  29. #include <linux/mtd/nand_ecc.h>
  30. #include <linux/mtd/partitions.h>
  31. #include <asm/mach/arch.h>
  32. #include <asm/mach/map.h>
  33. #include <asm/mach/irq.h>
  34. #include <mach/hardware.h>
  35. #include <asm/irq.h>
  36. #include <asm/mach-types.h>
  37. #include <plat/regs-serial.h>
  38. #include <mach/regs-gpio.h>
  39. #include <mach/regs-lcd.h>
  40. #include <mach/h1940.h>
  41. #include <plat/nand.h>
  42. #include <mach/fb.h>
  43. #include <plat/clock.h>
  44. #include <plat/devs.h>
  45. #include <plat/cpu.h>
  46. #include <plat/pm.h>
  47. static struct map_desc rx3715_iodesc[] __initdata = {
  48. /* dump ISA space somewhere unused */
  49. {
  50. .virtual = (u32)S3C24XX_VA_ISA_WORD,
  51. .pfn = __phys_to_pfn(S3C2410_CS3),
  52. .length = SZ_1M,
  53. .type = MT_DEVICE,
  54. }, {
  55. .virtual = (u32)S3C24XX_VA_ISA_BYTE,
  56. .pfn = __phys_to_pfn(S3C2410_CS3),
  57. .length = SZ_1M,
  58. .type = MT_DEVICE,
  59. },
  60. };
  61. static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
  62. [0] = {
  63. .name = "fclk",
  64. .divisor = 0,
  65. .min_baud = 0,
  66. .max_baud = 0,
  67. }
  68. };
  69. static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
  70. [0] = {
  71. .hwport = 0,
  72. .flags = 0,
  73. .ucon = 0x3c5,
  74. .ulcon = 0x03,
  75. .ufcon = 0x51,
  76. .clocks = rx3715_serial_clocks,
  77. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  78. },
  79. [1] = {
  80. .hwport = 1,
  81. .flags = 0,
  82. .ucon = 0x3c5,
  83. .ulcon = 0x03,
  84. .ufcon = 0x00,
  85. .clocks = rx3715_serial_clocks,
  86. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  87. },
  88. /* IR port */
  89. [2] = {
  90. .hwport = 2,
  91. .uart_flags = UPF_CONS_FLOW,
  92. .ucon = 0x3c5,
  93. .ulcon = 0x43,
  94. .ufcon = 0x51,
  95. .clocks = rx3715_serial_clocks,
  96. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  97. }
  98. };
  99. /* framebuffer lcd controller information */
  100. static struct s3c2410fb_display rx3715_lcdcfg __initdata = {
  101. .lcdcon5 = S3C2410_LCDCON5_INVVLINE |
  102. S3C2410_LCDCON5_FRM565 |
  103. S3C2410_LCDCON5_HWSWP,
  104. .type = S3C2410_LCDCON1_TFT,
  105. .width = 240,
  106. .height = 320,
  107. .pixclock = 260000,
  108. .xres = 240,
  109. .yres = 320,
  110. .bpp = 16,
  111. .left_margin = 36,
  112. .right_margin = 36,
  113. .hsync_len = 8,
  114. .upper_margin = 6,
  115. .lower_margin = 7,
  116. .vsync_len = 3,
  117. };
  118. static struct s3c2410fb_mach_info rx3715_fb_info __initdata = {
  119. .displays = &rx3715_lcdcfg,
  120. .num_displays = 1,
  121. .default_display = 0,
  122. .lpcsel = 0xf82,
  123. .gpccon = 0xaa955699,
  124. .gpccon_mask = 0xffc003cc,
  125. .gpcup = 0x0000ffff,
  126. .gpcup_mask = 0xffffffff,
  127. .gpdcon = 0xaa95aaa1,
  128. .gpdcon_mask = 0xffc0fff0,
  129. .gpdup = 0x0000faff,
  130. .gpdup_mask = 0xffffffff,
  131. };
  132. static struct mtd_partition __initdata rx3715_nand_part[] = {
  133. [0] = {
  134. .name = "Whole Flash",
  135. .offset = 0,
  136. .size = MTDPART_SIZ_FULL,
  137. .mask_flags = MTD_WRITEABLE,
  138. }
  139. };
  140. static struct s3c2410_nand_set __initdata rx3715_nand_sets[] = {
  141. [0] = {
  142. .name = "Internal",
  143. .nr_chips = 1,
  144. .nr_partitions = ARRAY_SIZE(rx3715_nand_part),
  145. .partitions = rx3715_nand_part,
  146. },
  147. };
  148. static struct s3c2410_platform_nand __initdata rx3715_nand_info = {
  149. .tacls = 25,
  150. .twrph0 = 50,
  151. .twrph1 = 15,
  152. .nr_sets = ARRAY_SIZE(rx3715_nand_sets),
  153. .sets = rx3715_nand_sets,
  154. };
  155. static struct platform_device *rx3715_devices[] __initdata = {
  156. &s3c_device_ohci,
  157. &s3c_device_lcd,
  158. &s3c_device_wdt,
  159. &s3c_device_i2c0,
  160. &s3c_device_iis,
  161. &s3c_device_nand,
  162. };
  163. static void __init rx3715_map_io(void)
  164. {
  165. s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
  166. s3c24xx_init_clocks(16934000);
  167. s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
  168. }
  169. /* H1940 and RX3715 need to reserve this for suspend */
  170. static void __init rx3715_reserve(void)
  171. {
  172. memblock_reserve(0x30003000, 0x1000);
  173. memblock_reserve(0x30081000, 0x1000);
  174. }
  175. static void __init rx3715_init_irq(void)
  176. {
  177. s3c24xx_init_irq();
  178. }
  179. static void __init rx3715_init_machine(void)
  180. {
  181. #ifdef CONFIG_PM_H1940
  182. memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
  183. #endif
  184. s3c_pm_init();
  185. s3c_nand_set_platdata(&rx3715_nand_info);
  186. s3c24xx_fb_set_platdata(&rx3715_fb_info);
  187. platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
  188. }
  189. MACHINE_START(RX3715, "IPAQ-RX3715")
  190. /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
  191. .boot_params = S3C2410_SDRAM_PA + 0x100,
  192. .map_io = rx3715_map_io,
  193. .reserve = rx3715_reserve,
  194. .init_irq = rx3715_init_irq,
  195. .init_machine = rx3715_init_machine,
  196. .timer = &s3c24xx_timer,
  197. MACHINE_END