mach-rx3715.c 5.5 KB

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