mach-rx3715.c 4.9 KB

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