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_irq(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. omap_init_irq();
  63. }
  64. #ifdef CONFIG_OMAP_MUX
  65. static struct omap_board_mux board_mux[] __initdata = {
  66. { .reg_offset = OMAP_MUX_TERMINATOR },
  67. };
  68. #endif
  69. /*
  70. * SDP3630 CS organization
  71. * See also the Switch S8 settings in the comments.
  72. */
  73. static char chip_sel_sdp[][GPMC_CS_NUM] = {
  74. {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
  75. {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
  76. {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
  77. };
  78. static struct mtd_partition sdp_nor_partitions[] = {
  79. /* bootloader (U-Boot, etc) in first sector */
  80. {
  81. .name = "Bootloader-NOR",
  82. .offset = 0,
  83. .size = SZ_256K,
  84. .mask_flags = MTD_WRITEABLE, /* force read-only */
  85. },
  86. /* bootloader params in the next sector */
  87. {
  88. .name = "Params-NOR",
  89. .offset = MTDPART_OFS_APPEND,
  90. .size = SZ_256K,
  91. .mask_flags = 0,
  92. },
  93. /* kernel */
  94. {
  95. .name = "Kernel-NOR",
  96. .offset = MTDPART_OFS_APPEND,
  97. .size = SZ_2M,
  98. .mask_flags = 0
  99. },
  100. /* file system */
  101. {
  102. .name = "Filesystem-NOR",
  103. .offset = MTDPART_OFS_APPEND,
  104. .size = MTDPART_SIZ_FULL,
  105. .mask_flags = 0
  106. }
  107. };
  108. static struct mtd_partition sdp_onenand_partitions[] = {
  109. {
  110. .name = "X-Loader-OneNAND",
  111. .offset = 0,
  112. .size = 4 * (64 * 2048),
  113. .mask_flags = MTD_WRITEABLE /* force read-only */
  114. },
  115. {
  116. .name = "U-Boot-OneNAND",
  117. .offset = MTDPART_OFS_APPEND,
  118. .size = 2 * (64 * 2048),
  119. .mask_flags = MTD_WRITEABLE /* force read-only */
  120. },
  121. {
  122. .name = "U-Boot Environment-OneNAND",
  123. .offset = MTDPART_OFS_APPEND,
  124. .size = 1 * (64 * 2048),
  125. },
  126. {
  127. .name = "Kernel-OneNAND",
  128. .offset = MTDPART_OFS_APPEND,
  129. .size = 16 * (64 * 2048),
  130. },
  131. {
  132. .name = "File System-OneNAND",
  133. .offset = MTDPART_OFS_APPEND,
  134. .size = MTDPART_SIZ_FULL,
  135. },
  136. };
  137. static struct mtd_partition sdp_nand_partitions[] = {
  138. /* All the partition sizes are listed in terms of NAND block size */
  139. {
  140. .name = "X-Loader-NAND",
  141. .offset = 0,
  142. .size = 4 * (64 * 2048),
  143. .mask_flags = MTD_WRITEABLE, /* force read-only */
  144. },
  145. {
  146. .name = "U-Boot-NAND",
  147. .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
  148. .size = 10 * (64 * 2048),
  149. .mask_flags = MTD_WRITEABLE, /* force read-only */
  150. },
  151. {
  152. .name = "Boot Env-NAND",
  153. .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */
  154. .size = 6 * (64 * 2048),
  155. },
  156. {
  157. .name = "Kernel-NAND",
  158. .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
  159. .size = 40 * (64 * 2048),
  160. },
  161. {
  162. .name = "File System - NAND",
  163. .size = MTDPART_SIZ_FULL,
  164. .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */
  165. },
  166. };
  167. static struct flash_partitions sdp_flash_partitions[] = {
  168. {
  169. .parts = sdp_nor_partitions,
  170. .nr_parts = ARRAY_SIZE(sdp_nor_partitions),
  171. },
  172. {
  173. .parts = sdp_onenand_partitions,
  174. .nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
  175. },
  176. {
  177. .parts = sdp_nand_partitions,
  178. .nr_parts = ARRAY_SIZE(sdp_nand_partitions),
  179. },
  180. };
  181. static void __init omap_sdp_init(void)
  182. {
  183. omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
  184. zoom_peripherals_init();
  185. zoom_display_init();
  186. board_smc91x_init();
  187. board_flash_init(sdp_flash_partitions, chip_sel_sdp);
  188. enable_board_wakeup_source();
  189. usb_ehci_init(&ehci_pdata);
  190. }
  191. MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
  192. .boot_params = 0x80000100,
  193. .map_io = omap3_map_io,
  194. .reserve = omap_reserve,
  195. .init_irq = omap_sdp_init_irq,
  196. .init_machine = omap_sdp_init,
  197. .timer = &omap_timer,
  198. MACHINE_END