aspenite.c 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /*
  2. * linux/arch/arm/mach-mmp/aspenite.c
  3. *
  4. * Support for the Marvell PXA168-based Aspenite and Zylonite2
  5. * Development Platform.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * publishhed by the Free Software Foundation.
  10. */
  11. #include <linux/init.h>
  12. #include <linux/kernel.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/smc91x.h>
  15. #include <linux/mtd/mtd.h>
  16. #include <linux/mtd/partitions.h>
  17. #include <linux/mtd/nand.h>
  18. #include <linux/interrupt.h>
  19. #include <asm/mach-types.h>
  20. #include <asm/mach/arch.h>
  21. #include <mach/addr-map.h>
  22. #include <mach/mfp-pxa168.h>
  23. #include <mach/pxa168.h>
  24. #include <mach/gpio.h>
  25. #include <video/pxa168fb.h>
  26. #include <linux/input.h>
  27. #include <plat/pxa27x_keypad.h>
  28. #include "common.h"
  29. static unsigned long common_pin_config[] __initdata = {
  30. /* Data Flash Interface */
  31. GPIO0_DFI_D15,
  32. GPIO1_DFI_D14,
  33. GPIO2_DFI_D13,
  34. GPIO3_DFI_D12,
  35. GPIO4_DFI_D11,
  36. GPIO5_DFI_D10,
  37. GPIO6_DFI_D9,
  38. GPIO7_DFI_D8,
  39. GPIO8_DFI_D7,
  40. GPIO9_DFI_D6,
  41. GPIO10_DFI_D5,
  42. GPIO11_DFI_D4,
  43. GPIO12_DFI_D3,
  44. GPIO13_DFI_D2,
  45. GPIO14_DFI_D1,
  46. GPIO15_DFI_D0,
  47. /* Static Memory Controller */
  48. GPIO18_SMC_nCS0,
  49. GPIO34_SMC_nCS1,
  50. GPIO23_SMC_nLUA,
  51. GPIO25_SMC_nLLA,
  52. GPIO28_SMC_RDY,
  53. GPIO29_SMC_SCLK,
  54. GPIO35_SMC_BE1,
  55. GPIO36_SMC_BE2,
  56. GPIO27_GPIO, /* Ethernet IRQ */
  57. /* UART1 */
  58. GPIO107_UART1_RXD,
  59. GPIO108_UART1_TXD,
  60. /* SSP1 */
  61. GPIO113_I2S_MCLK,
  62. GPIO114_I2S_FRM,
  63. GPIO115_I2S_BCLK,
  64. GPIO116_I2S_RXD,
  65. GPIO117_I2S_TXD,
  66. /* LCD */
  67. GPIO56_LCD_FCLK_RD,
  68. GPIO57_LCD_LCLK_A0,
  69. GPIO58_LCD_PCLK_WR,
  70. GPIO59_LCD_DENA_BIAS,
  71. GPIO60_LCD_DD0,
  72. GPIO61_LCD_DD1,
  73. GPIO62_LCD_DD2,
  74. GPIO63_LCD_DD3,
  75. GPIO64_LCD_DD4,
  76. GPIO65_LCD_DD5,
  77. GPIO66_LCD_DD6,
  78. GPIO67_LCD_DD7,
  79. GPIO68_LCD_DD8,
  80. GPIO69_LCD_DD9,
  81. GPIO70_LCD_DD10,
  82. GPIO71_LCD_DD11,
  83. GPIO72_LCD_DD12,
  84. GPIO73_LCD_DD13,
  85. GPIO74_LCD_DD14,
  86. GPIO75_LCD_DD15,
  87. GPIO76_LCD_DD16,
  88. GPIO77_LCD_DD17,
  89. GPIO78_LCD_DD18,
  90. GPIO79_LCD_DD19,
  91. GPIO80_LCD_DD20,
  92. GPIO81_LCD_DD21,
  93. GPIO82_LCD_DD22,
  94. GPIO83_LCD_DD23,
  95. /* Keypad */
  96. GPIO109_KP_MKIN1,
  97. GPIO110_KP_MKIN0,
  98. GPIO111_KP_MKOUT7,
  99. GPIO112_KP_MKOUT6,
  100. GPIO121_KP_MKIN4,
  101. };
  102. static struct smc91x_platdata smc91x_info = {
  103. .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
  104. };
  105. static struct resource smc91x_resources[] = {
  106. [0] = {
  107. .start = SMC_CS1_PHYS_BASE + 0x300,
  108. .end = SMC_CS1_PHYS_BASE + 0xfffff,
  109. .flags = IORESOURCE_MEM,
  110. },
  111. [1] = {
  112. .start = gpio_to_irq(27),
  113. .end = gpio_to_irq(27),
  114. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  115. }
  116. };
  117. static struct platform_device smc91x_device = {
  118. .name = "smc91x",
  119. .id = 0,
  120. .dev = {
  121. .platform_data = &smc91x_info,
  122. },
  123. .num_resources = ARRAY_SIZE(smc91x_resources),
  124. .resource = smc91x_resources,
  125. };
  126. static struct mtd_partition aspenite_nand_partitions[] = {
  127. {
  128. .name = "bootloader",
  129. .offset = 0,
  130. .size = SZ_1M,
  131. .mask_flags = MTD_WRITEABLE,
  132. }, {
  133. .name = "reserved",
  134. .offset = MTDPART_OFS_APPEND,
  135. .size = SZ_128K,
  136. .mask_flags = MTD_WRITEABLE,
  137. }, {
  138. .name = "reserved",
  139. .offset = MTDPART_OFS_APPEND,
  140. .size = SZ_8M,
  141. .mask_flags = MTD_WRITEABLE,
  142. }, {
  143. .name = "kernel",
  144. .offset = MTDPART_OFS_APPEND,
  145. .size = (SZ_2M + SZ_1M),
  146. .mask_flags = 0,
  147. }, {
  148. .name = "filesystem",
  149. .offset = MTDPART_OFS_APPEND,
  150. .size = SZ_48M,
  151. .mask_flags = 0,
  152. }
  153. };
  154. static struct pxa3xx_nand_platform_data aspenite_nand_info = {
  155. .enable_arbiter = 1,
  156. .parts = aspenite_nand_partitions,
  157. .nr_parts = ARRAY_SIZE(aspenite_nand_partitions),
  158. };
  159. static struct i2c_board_info aspenite_i2c_info[] __initdata = {
  160. { I2C_BOARD_INFO("wm8753", 0x1b), },
  161. };
  162. static struct fb_videomode video_modes[] = {
  163. [0] = {
  164. .pixclock = 30120,
  165. .refresh = 60,
  166. .xres = 800,
  167. .yres = 480,
  168. .hsync_len = 1,
  169. .left_margin = 215,
  170. .right_margin = 40,
  171. .vsync_len = 1,
  172. .upper_margin = 34,
  173. .lower_margin = 10,
  174. .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
  175. },
  176. };
  177. struct pxa168fb_mach_info aspenite_lcd_info = {
  178. .id = "Graphic Frame",
  179. .modes = video_modes,
  180. .num_modes = ARRAY_SIZE(video_modes),
  181. .pix_fmt = PIX_FMT_RGB565,
  182. .io_pin_allocation_mode = PIN_MODE_DUMB_24,
  183. .dumb_mode = DUMB_MODE_RGB888,
  184. .active = 1,
  185. .panel_rbswap = 0,
  186. .invert_pixclock = 0,
  187. };
  188. static unsigned int aspenite_matrix_key_map[] = {
  189. KEY(0, 6, KEY_UP), /* SW 4 */
  190. KEY(0, 7, KEY_DOWN), /* SW 5 */
  191. KEY(1, 6, KEY_LEFT), /* SW 6 */
  192. KEY(1, 7, KEY_RIGHT), /* SW 7 */
  193. KEY(4, 6, KEY_ENTER), /* SW 8 */
  194. KEY(4, 7, KEY_ESC), /* SW 9 */
  195. };
  196. static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = {
  197. .matrix_key_rows = 5,
  198. .matrix_key_cols = 8,
  199. .matrix_key_map = aspenite_matrix_key_map,
  200. .matrix_key_map_size = ARRAY_SIZE(aspenite_matrix_key_map),
  201. .debounce_interval = 30,
  202. };
  203. static void __init common_init(void)
  204. {
  205. mfp_config(ARRAY_AND_SIZE(common_pin_config));
  206. /* on-chip devices */
  207. pxa168_add_uart(1);
  208. pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info));
  209. pxa168_add_ssp(1);
  210. pxa168_add_nand(&aspenite_nand_info);
  211. pxa168_add_fb(&aspenite_lcd_info);
  212. pxa168_add_keypad(&aspenite_keypad_info);
  213. /* off-chip devices */
  214. platform_device_register(&smc91x_device);
  215. }
  216. MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
  217. .map_io = mmp_map_io,
  218. .nr_irqs = IRQ_BOARD_START,
  219. .init_irq = pxa168_init_irq,
  220. .timer = &pxa168_timer,
  221. .init_machine = common_init,
  222. MACHINE_END
  223. MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
  224. .map_io = mmp_map_io,
  225. .nr_irqs = IRQ_BOARD_START,
  226. .init_irq = pxa168_init_irq,
  227. .timer = &pxa168_timer,
  228. .init_machine = common_init,
  229. MACHINE_END