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