mach-rx3715.c 5.0 KB

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