board-3630sdp.c 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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 <asm/mach-types.h>
  14. #include <asm/mach/arch.h>
  15. #include <plat/common.h>
  16. #include <plat/board.h>
  17. #include <plat/gpmc-smc91x.h>
  18. #include <plat/usb.h>
  19. #include <mach/board-zoom.h>
  20. #include "board-flash.h"
  21. #include "mux.h"
  22. #include "sdram-hynix-h8mbx00u0mer-0em.h"
  23. #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
  24. static struct omap_smc91x_platform_data board_smc91x_data = {
  25. .cs = 3,
  26. .flags = GPMC_MUX_ADD_DATA | IORESOURCE_IRQ_LOWLEVEL,
  27. };
  28. static void __init board_smc91x_init(void)
  29. {
  30. board_smc91x_data.gpio_irq = 158;
  31. gpmc_smc91x_init(&board_smc91x_data);
  32. }
  33. #else
  34. static inline void board_smc91x_init(void)
  35. {
  36. }
  37. #endif /* defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) */
  38. static void enable_board_wakeup_source(void)
  39. {
  40. /* T2 interrupt line (keypad) */
  41. omap_mux_init_signal("sys_nirq",
  42. OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
  43. }
  44. static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
  45. .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
  46. .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
  47. .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
  48. .phy_reset = true,
  49. .reset_gpio_port[0] = 126,
  50. .reset_gpio_port[1] = 61,
  51. .reset_gpio_port[2] = -EINVAL
  52. };
  53. static struct omap_board_config_kernel sdp_config[] __initdata = {
  54. };
  55. static void __init omap_sdp_init_early(void)
  56. {
  57. omap_board_config = sdp_config;
  58. omap_board_config_size = ARRAY_SIZE(sdp_config);
  59. omap2_init_common_infrastructure();
  60. omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
  61. h8mbx00u0mer0em_sdrc_params);
  62. }
  63. #ifdef CONFIG_OMAP_MUX
  64. static struct omap_board_mux board_mux[] __initdata = {
  65. { .reg_offset = OMAP_MUX_TERMINATOR },
  66. };
  67. #endif
  68. /*
  69. * SDP3630 CS organization
  70. * See also the Switch S8 settings in the comments.
  71. */
  72. static char chip_sel_sdp[][GPMC_CS_NUM] = {
  73. {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
  74. {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
  75. {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
  76. };
  77. static struct mtd_partition sdp_nor_partitions[] = {
  78. /* bootloader (U-Boot, etc) in first sector */
  79. {
  80. .name = "Bootloader-NOR",
  81. .offset = 0,
  82. .size = SZ_256K,
  83. .mask_flags = MTD_WRITEABLE, /* force read-only */
  84. },
  85. /* bootloader params in the next sector */
  86. {
  87. .name = "Params-NOR",
  88. .offset = MTDPART_OFS_APPEND,
  89. .size = SZ_256K,
  90. .mask_flags = 0,
  91. },
  92. /* kernel */
  93. {
  94. .name = "Kernel-NOR",
  95. .offset = MTDPART_OFS_APPEND,
  96. .size = SZ_2M,
  97. .mask_flags = 0
  98. },
  99. /* file system */
  100. {
  101. .name = "Filesystem-NOR",
  102. .offset = MTDPART_OFS_APPEND,
  103. .size = MTDPART_SIZ_FULL,
  104. .mask_flags = 0
  105. }
  106. };
  107. static struct mtd_partition sdp_onenand_partitions[] = {
  108. {
  109. .name = "X-Loader-OneNAND",
  110. .offset = 0,
  111. .size = 4 * (64 * 2048),
  112. .mask_flags = MTD_WRITEABLE /* force read-only */
  113. },
  114. {
  115. .name = "U-Boot-OneNAND",
  116. .offset = MTDPART_OFS_APPEND,
  117. .size = 2 * (64 * 2048),
  118. .mask_flags = MTD_WRITEABLE /* force read-only */
  119. },
  120. {
  121. .name = "U-Boot Environment-OneNAND",
  122. .offset = MTDPART_OFS_APPEND,
  123. .size = 1 * (64 * 2048),
  124. },
  125. {
  126. .name = "Kernel-OneNAND",
  127. .offset = MTDPART_OFS_APPEND,
  128. .size = 16 * (64 * 2048),
  129. },
  130. {
  131. .name = "File System-OneNAND",
  132. .offset = MTDPART_OFS_APPEND,
  133. .size = MTDPART_SIZ_FULL,
  134. },
  135. };
  136. static struct mtd_partition sdp_nand_partitions[] = {
  137. /* All the partition sizes are listed in terms of NAND block size */
  138. {
  139. .name = "X-Loader-NAND",
  140. .offset = 0,
  141. .size = 4 * (64 * 2048),
  142. .mask_flags = MTD_WRITEABLE, /* force read-only */
  143. },
  144. {
  145. .name = "U-Boot-NAND",
  146. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  147. .size = 10 * (64 * 2048),
  148. .mask_flags = MTD_WRITEABLE, /* force read-only */
  149. },
  150. {
  151. .name = "Boot Env-NAND",
  152. .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
  153. .size = 6 * (64 * 2048),
  154. },
  155. {
  156. .name = "Kernel-NAND",
  157. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  158. .size = 40 * (64 * 2048),
  159. },
  160. {
  161. .name = "File System - NAND",
  162. .size = MTDPART_SIZ_FULL,
  163. .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
  164. },
  165. };
  166. static struct flash_partitions sdp_flash_partitions[] = {
  167. {
  168. .parts = sdp_nor_partitions,
  169. .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
  170. },
  171. {
  172. .parts = sdp_onenand_partitions,
  173. .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
  174. },
  175. {
  176. .parts = sdp_nand_partitions,
  177. .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
  178. },
  179. };
  180. static void __init omap_sdp_init(void)
  181. {
  182. omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
  183. zoom_peripherals_init();
  184. zoom_display_init();
  185. board_smc91x_init();
  186. board_flash_init(sdp_flash_partitions, chip_sel_sdp);
  187. enable_board_wakeup_source();
  188. usb_ehci_init(&ehci_pdata);
  189. }
  190. MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
  191. .boot_params = 0x80000100,
  192. .reserve = omap_reserve,
  193. .map_io = omap3_map_io,
  194. .init_early = omap_sdp_init_early,
  195. .init_irq = omap_init_irq,
  196. .init_machine = omap_sdp_init,
  197. .timer = &omap_timer,
  198. MACHINE_END