board-3630sdp.c 5.1 KB

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