mach-rx3715.c 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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/timer.h>
  18. #include <linux/init.h>
  19. #include <linux/tty.h>
  20. #include <linux/console.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/serial_core.h>
  23. #include <linux/serial.h>
  24. #include <linux/mtd/mtd.h>
  25. #include <linux/mtd/nand.h>
  26. #include <linux/mtd/nand_ecc.h>
  27. #include <linux/mtd/partitions.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/map.h>
  30. #include <asm/mach/irq.h>
  31. #include <asm/hardware.h>
  32. #include <asm/io.h>
  33. #include <asm/irq.h>
  34. #include <asm/mach-types.h>
  35. #include <asm/arch/regs-serial.h>
  36. #include <asm/arch/regs-gpio.h>
  37. #include <asm/arch/regs-lcd.h>
  38. #include <asm/arch/h1940.h>
  39. #include <asm/arch/nand.h>
  40. #include <asm/arch/fb.h>
  41. #include <asm/plat-s3c24xx/clock.h>
  42. #include <asm/plat-s3c24xx/devs.h>
  43. #include <asm/plat-s3c24xx/cpu.h>
  44. #include <asm/plat-s3c24xx/pm.h>
  45. static struct map_desc rx3715_iodesc[] __initdata = {
  46. /* dump ISA space somewhere unused */
  47. {
  48. .virtual = (u32)S3C24XX_VA_ISA_WORD,
  49. .pfn = __phys_to_pfn(S3C2410_CS3),
  50. .length = SZ_1M,
  51. .type = MT_DEVICE,
  52. }, {
  53. .virtual = (u32)S3C24XX_VA_ISA_BYTE,
  54. .pfn = __phys_to_pfn(S3C2410_CS3),
  55. .length = SZ_1M,
  56. .type = MT_DEVICE,
  57. },
  58. };
  59. static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = {
  60. [0] = {
  61. .name = "fclk",
  62. .divisor = 0,
  63. .min_baud = 0,
  64. .max_baud = 0,
  65. }
  66. };
  67. static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
  68. [0] = {
  69. .hwport = 0,
  70. .flags = 0,
  71. .ucon = 0x3c5,
  72. .ulcon = 0x03,
  73. .ufcon = 0x51,
  74. .clocks = rx3715_serial_clocks,
  75. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  76. },
  77. [1] = {
  78. .hwport = 1,
  79. .flags = 0,
  80. .ucon = 0x3c5,
  81. .ulcon = 0x03,
  82. .ufcon = 0x00,
  83. .clocks = rx3715_serial_clocks,
  84. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  85. },
  86. /* IR port */
  87. [2] = {
  88. .hwport = 2,
  89. .uart_flags = UPF_CONS_FLOW,
  90. .ucon = 0x3c5,
  91. .ulcon = 0x43,
  92. .ufcon = 0x51,
  93. .clocks = rx3715_serial_clocks,
  94. .clocks_size = ARRAY_SIZE(rx3715_serial_clocks),
  95. }
  96. };
  97. /* framebuffer lcd controller information */
  98. static struct s3c2410fb_mach_info rx3715_lcdcfg __initdata = {
  99. .regs = {
  100. .lcdcon1 = S3C2410_LCDCON1_TFT16BPP | \
  101. S3C2410_LCDCON1_TFT | \
  102. S3C2410_LCDCON1_CLKVAL(0x0C),
  103. .lcdcon2 = S3C2410_LCDCON2_VBPD(5) | \
  104. S3C2410_LCDCON2_LINEVAL(319) | \
  105. S3C2410_LCDCON2_VFPD(6) | \
  106. S3C2410_LCDCON2_VSPW(2),
  107. .lcdcon3 = S3C2410_LCDCON3_HBPD(35) | \
  108. S3C2410_LCDCON3_HOZVAL(239) | \
  109. S3C2410_LCDCON3_HFPD(35),
  110. .lcdcon4 = S3C2410_LCDCON4_MVAL(0) | \
  111. S3C2410_LCDCON4_HSPW(7),
  112. .lcdcon5 = S3C2410_LCDCON5_INVVLINE |
  113. S3C2410_LCDCON5_FRM565 |
  114. S3C2410_LCDCON5_HWSWP,
  115. },
  116. .lpcsel = 0xf82,
  117. .gpccon = 0xaa955699,
  118. .gpccon_mask = 0xffc003cc,
  119. .gpcup = 0x0000ffff,
  120. .gpcup_mask = 0xffffffff,
  121. .gpdcon = 0xaa95aaa1,
  122. .gpdcon_mask = 0xffc0fff0,
  123. .gpdup = 0x0000faff,
  124. .gpdup_mask = 0xffffffff,
  125. .fixed_syncs = 1,
  126. .width = 240,
  127. .height = 320,
  128. .xres = {
  129. .min = 240,
  130. .max = 240,
  131. .defval = 240,
  132. },
  133. .yres = {
  134. .max = 320,
  135. .min = 320,
  136. .defval = 320,
  137. },
  138. .bpp = {
  139. .min = 16,
  140. .max = 16,
  141. .defval = 16,
  142. },
  143. };
  144. static struct mtd_partition rx3715_nand_part[] = {
  145. [0] = {
  146. .name = "Whole Flash",
  147. .offset = 0,
  148. .size = MTDPART_SIZ_FULL,
  149. .mask_flags = MTD_WRITEABLE,
  150. }
  151. };
  152. static struct s3c2410_nand_set rx3715_nand_sets[] = {
  153. [0] = {
  154. .name = "Internal",
  155. .nr_chips = 1,
  156. .nr_partitions = ARRAY_SIZE(rx3715_nand_part),
  157. .partitions = rx3715_nand_part,
  158. },
  159. };
  160. static struct s3c2410_platform_nand rx3715_nand_info = {
  161. .tacls = 25,
  162. .twrph0 = 50,
  163. .twrph1 = 15,
  164. .nr_sets = ARRAY_SIZE(rx3715_nand_sets),
  165. .sets = rx3715_nand_sets,
  166. };
  167. static struct platform_device *rx3715_devices[] __initdata = {
  168. &s3c_device_usb,
  169. &s3c_device_lcd,
  170. &s3c_device_wdt,
  171. &s3c_device_i2c,
  172. &s3c_device_iis,
  173. &s3c_device_nand,
  174. };
  175. static struct s3c24xx_board rx3715_board __initdata = {
  176. .devices = rx3715_devices,
  177. .devices_count = ARRAY_SIZE(rx3715_devices)
  178. };
  179. static void __init rx3715_map_io(void)
  180. {
  181. s3c_device_nand.dev.platform_data = &rx3715_nand_info;
  182. s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
  183. s3c24xx_init_clocks(16934000);
  184. s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
  185. s3c24xx_set_board(&rx3715_board);
  186. }
  187. static void __init rx3715_init_irq(void)
  188. {
  189. s3c24xx_init_irq();
  190. }
  191. static void __init rx3715_init_machine(void)
  192. {
  193. #ifdef CONFIG_PM_H1940
  194. memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
  195. #endif
  196. s3c2410_pm_init();
  197. s3c24xx_fb_set_platdata(&rx3715_lcdcfg);
  198. }
  199. MACHINE_START(RX3715, "IPAQ-RX3715")
  200. /* Maintainer: Ben Dooks <ben@fluff.org> */
  201. .phys_io = S3C2410_PA_UART,
  202. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
  203. .boot_params = S3C2410_SDRAM_PA + 0x100,
  204. .map_io = rx3715_map_io,
  205. .init_irq = rx3715_init_irq,
  206. .init_machine = rx3715_init_machine,
  207. .timer = &s3c24xx_timer,
  208. MACHINE_END