board-3630sdp.c 5.1 KB

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