board-3630sdp.c 5.3 KB

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