mach-rx3715.c 4.8 KB

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