board-3630sdp.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. * Copyright (C) 2009 Texas Instruments Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/init.h>
  10. #include <linux/platform_device.h>
  11. #include <linux/input.h>
  12. #include <linux/gpio.h>
  13. #include <linux/mtd/nand.h>
  14. #include <asm/mach-types.h>
  15. #include <asm/mach/arch.h>
  16. #include "common.h"
  17. #include "gpmc-smc91x.h"
  18. #include "board-zoom.h"
  19. #include "board-flash.h"
  20. #include "mux.h"
  21. #include "sdram-hynix-h8mbx00u0mer-0em.h"
  22. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  23. static struct omap_smc91x_platform_data board_smc91x_data = {
  24. .cs = 3,
  25. .flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,
  26. };
  27. static void __init board_smc91x_init(void)
  28. {
  29. board_smc91x_data.gpio_irq = 158;
  30. gpmc_smc91x_init(&board_smc91x_data);
  31. }
  32. #else
  33. static inline void board_smc91x_init(void)
  34. {
  35. }
  36. #endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
  37. static void enable_board_wakeup_source(void)
  38. {
  39. /* T2 interrupt line (keypad) */
  40. omap_mux_init_signal("sys_nirq",
  41. OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
  42. }
  43. static struct usbhs_phy_data phy_data[] __initdata = {
  44. {
  45. .port = 1,
  46. .reset_gpio = 126,
  47. .vcc_gpio = -EINVAL,
  48. },
  49. {
  50. .port = 2,
  51. .reset_gpio = 61,
  52. .vcc_gpio = -EINVAL,
  53. },
  54. };
  55. static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
  56. .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  57. .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
  58. };
  59. #ifdef CONFIG_OMAP_MUX
  60. static struct omap_board_mux board_mux[] __initdata = {
  61. { .reg_offset = OMAP_MUX_TERMINATOR },
  62. };
  63. #endif
  64. /*
  65. * SDP3630 CS organization
  66. * See also the Switch S8 settings in the comments.
  67. */
  68. static char chip_sel_sdp[][GPMC_CS_NUM] = {
  69. {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
  70. {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
  71. {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
  72. };
  73. static struct mtd_partition sdp_nor_partitions[] = {
  74. /* bootloader (U-Boot, etc) in first sector */
  75. {
  76. .name = "Bootloader-NOR",
  77. .offset = 0,
  78. .size = SZ_256K,
  79. .mask_flags = MTD_WRITEABLE, /* force read-only */
  80. },
  81. /* bootloader params in the next sector */
  82. {
  83. .name = "Params-NOR",
  84. .offset = MTDPART_OFS_APPEND,
  85. .size = SZ_256K,
  86. .mask_flags = 0,
  87. },
  88. /* kernel */
  89. {
  90. .name = "Kernel-NOR",
  91. .offset = MTDPART_OFS_APPEND,
  92. .size = SZ_2M,
  93. .mask_flags = 0
  94. },
  95. /* file system */
  96. {
  97. .name = "Filesystem-NOR",
  98. .offset = MTDPART_OFS_APPEND,
  99. .size = MTDPART_SIZ_FULL,
  100. .mask_flags = 0
  101. }
  102. };
  103. static struct mtd_partition sdp_onenand_partitions[] = {
  104. {
  105. .name = "X-Loader-OneNAND",
  106. .offset = 0,
  107. .size = 4 * (64 * 2048),
  108. .mask_flags = MTD_WRITEABLE /* force read-only */
  109. },
  110. {
  111. .name = "U-Boot-OneNAND",
  112. .offset = MTDPART_OFS_APPEND,
  113. .size = 2 * (64 * 2048),
  114. .mask_flags = MTD_WRITEABLE /* force read-only */
  115. },
  116. {
  117. .name = "U-Boot Environment-OneNAND",
  118. .offset = MTDPART_OFS_APPEND,
  119. .size = 1 * (64 * 2048),
  120. },
  121. {
  122. .name = "Kernel-OneNAND",
  123. .offset = MTDPART_OFS_APPEND,
  124. .size = 16 * (64 * 2048),
  125. },
  126. {
  127. .name = "File System-OneNAND",
  128. .offset = MTDPART_OFS_APPEND,
  129. .size = MTDPART_SIZ_FULL,
  130. },
  131. };
  132. static struct mtd_partition sdp_nand_partitions[] = {
  133. /* All the partition sizes are listed in terms of NAND block size */
  134. {
  135. .name = "X-Loader-NAND",
  136. .offset = 0,
  137. .size = 4 * (64 * 2048),
  138. .mask_flags = MTD_WRITEABLE, /* force read-only */
  139. },
  140. {
  141. .name = "U-Boot-NAND",
  142. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  143. .size = 10 * (64 * 2048),
  144. .mask_flags = MTD_WRITEABLE, /* force read-only */
  145. },
  146. {
  147. .name = "Boot Env-NAND",
  148. .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
  149. .size = 6 * (64 * 2048),
  150. },
  151. {
  152. .name = "Kernel-NAND",
  153. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  154. .size = 40 * (64 * 2048),
  155. },
  156. {
  157. .name = "File System - NAND",
  158. .size = MTDPART_SIZ_FULL,
  159. .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
  160. },
  161. };
  162. static struct flash_partitions sdp_flash_partitions[] = {
  163. {
  164. .parts = sdp_nor_partitions,
  165. .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
  166. },
  167. {
  168. .parts = sdp_onenand_partitions,
  169. .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
  170. },
  171. {
  172. .parts = sdp_nand_partitions,
  173. .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
  174. },
  175. };
  176. static void __init omap_sdp_init(void)
  177. {
  178. omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
  179. zoom_peripherals_init();
  180. omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
  181. h8mbx00u0mer0em_sdrc_params);
  182. zoom_display_init();
  183. board_smc91x_init();
  184. board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
  185. enable_board_wakeup_source();
  186. usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
  187. usbhs_init(&usbhs_bdata);
  188. }
  189. MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
  190. .atag_offset = 0x100,
  191. .reserve = omap_reserve,
  192. .map_io = omap3_map_io,
  193. .init_early = omap3630_init_early,
  194. .init_irq = omap3_init_irq,
  195. .handle_irq = omap3_intc_handle_irq,
  196. .init_machine = omap_sdp_init,
  197. .init_late = omap3630_init_late,
  198. .init_time = omap3_sync32k_timer_init,
  199. .restart = omap3xxx_restart,
  200. MACHINE_END