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