board-3630sdp.c 5.2 KB

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