synchronousMemoryDatabase.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. /*
  2. * linux/arch/arm/mach-omap1/board-h2.c
  3. *
  4. * Board specific inits for OMAP-1610 H2
  5. *
  6. * Copyright (C) 2001 RidgeRun, Inc.
  7. * Author: Greg Lonnon <glonnon@ridgerun.com>
  8. *
  9. * Copyright (C) 2002 MontaVista Software, Inc.
  10. *
  11. * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
  12. * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
  13. *
  14. * H2 specific changes and cleanup
  15. * Copyright (C) 2004 Nokia Corporation by Imre Deak <imre.deak@nokia.com>
  16. *
  17. * This program is free software; you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License version 2 as
  19. * published by the Free Software Foundation.
  20. */
  21. #include <linux/gpio.h>
  22. #include <linux/kernel.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/delay.h>
  25. #include <linux/i2c.h>
  26. #include <linux/mtd/mtd.h>
  27. #include <linux/mtd/nand.h>
  28. #include <linux/mtd/partitions.h>
  29. #include <linux/mtd/physmap.h>
  30. #include <linux/input.h>
  31. #include <linux/i2c/tps65010.h>
  32. #include <linux/smc91x.h>
  33. #include <linux/omapfb.h>
  34. #include <linux/platform_data/gpio-omap.h>
  35. #include <linux/leds.h>
  36. #include <asm/mach-types.h>
  37. #include <asm/mach/arch.h>
  38. #include <asm/mach/map.h>
  39. #include <mach/mux.h>
  40. #include <linux/omap-dma.h>
  41. #include <mach/tc.h>
  42. #include <mach/irda.h>
  43. #include <linux/platform_data/keypad-omap.h>
  44. #include <mach/flash.h>
  45. #include <mach/hardware.h>
  46. #include <mach/usb.h>
  47. #include "common.h"
  48. #include "board-h2.h"
  49. #include "dma.h"
  50. /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
  51. #define OMAP1610_ETHR_START 0x04000300
  52. static const unsigned int h2_keymap[] = {
  53. KEY(0, 0, KEY_LEFT),
  54. KEY(1, 0, KEY_RIGHT),
  55. KEY(2, 0, KEY_3),
  56. KEY(3, 0, KEY_F10),
  57. KEY(4, 0, KEY_F5),
  58. KEY(5, 0, KEY_9),
  59. KEY(0, 1, KEY_DOWN),
  60. KEY(1, 1, KEY_UP),
  61. KEY(2, 1, KEY_2),
  62. KEY(3, 1, KEY_F9),
  63. KEY(4, 1, KEY_F7),
  64. KEY(5, 1, KEY_0),
  65. KEY(0, 2, KEY_ENTER),
  66. KEY(1, 2, KEY_6),
  67. KEY(2, 2, KEY_1),
  68. KEY(3, 2, KEY_F2),
  69. KEY(4, 2, KEY_F6),
  70. KEY(5, 2, KEY_HOME),
  71. KEY(0, 3, KEY_8),
  72. KEY(1, 3, KEY_5),
  73. KEY(2, 3, KEY_F12),
  74. KEY(3, 3, KEY_F3),
  75. KEY(4, 3, KEY_F8),
  76. KEY(5, 3, KEY_END),
  77. KEY(0, 4, KEY_7),
  78. KEY(1, 4, KEY_4),
  79. KEY(2, 4, KEY_F11),
  80. KEY(3, 4, KEY_F1),
  81. KEY(4, 4, KEY_F4),
  82. KEY(5, 4, KEY_ESC),
  83. KEY(0, 5, KEY_F13),
  84. KEY(1, 5, KEY_F14),
  85. KEY(2, 5, KEY_F15),
  86. KEY(3, 5, KEY_F16),
  87. KEY(4, 5, KEY_SLEEP),
  88. };
  89. static struct mtd_partition h2_nor_partitions[] = {
  90. /* bootloader (U-Boot, etc) in first sector */
  91. {
  92. .name = "bootloader",
  93. .offset = 0,
  94. .size = SZ_128K,
  95. .mask_flags = MTD_WRITEABLE, /* force read-only */
  96. },
  97. /* bootloader params in the next sector */
  98. {
  99. .name = "params",
  100. .offset = MTDPART_OFS_APPEND,
  101. .size = SZ_128K,
  102. .mask_flags = 0,
  103. },
  104. /* kernel */
  105. {
  106. .name = "kernel",
  107. .offset = MTDPART_OFS_APPEND,
  108. .size = SZ_2M,
  109. .mask_flags = 0
  110. },
  111. /* file system */
  112. {
  113. .name = "filesystem",
  114. .offset = MTDPART_OFS_APPEND,
  115. .size = MTDPART_SIZ_FULL,
  116. .mask_flags = 0
  117. }
  118. };
  119. static struct physmap_flash_data h2_nor_data = {
  120. .width = 2,
  121. .set_vpp = omap1_set_vpp,
  122. .parts = h2_nor_partitions,
  123. .nr_parts = ARRAY_SIZE(h2_nor_partitions),
  124. };
  125. static struct resource h2_nor_resource = {
  126. /* This is on CS3, wherever it's mapped */
  127. .flags = IORESOURCE_MEM,
  128. };
  129. static struct platform_device h2_nor_device = {
  130. .name = "physmap-flash",
  131. .id = 0,
  132. .dev = {
  133. .platform_data = &h2_nor_data,
  134. },
  135. .num_resources = 1,
  136. .resource = &h2_nor_resource,
  137. };
  138. static struct mtd_partition h2_nand_partitions[] = {
  139. #if 0
  140. /* REVISIT: enable these partitions if you make NAND BOOT
  141. * work on your H2 (rev C or newer); published versions of
  142. * x-load only support P2 and H3.
  143. */
  144. {
  145. .name = "xloader",
  146. .offset = 0,
  147. .size = 64 * 1024,
  148. .mask_flags = MTD_WRITEABLE, /* force read-only */
  149. },
  150. {
  151. .name = "bootloader",
  152. .offset = MTDPART_OFS_APPEND,
  153. .size = 256 * 1024,
  154. .mask_flags = MTD_WRITEABLE, /* force read-only */
  155. },
  156. {
  157. .name = "params",
  158. .offset = MTDPART_OFS_APPEND,
  159. .size = 192 * 1024,
  160. },
  161. {
  162. .name = "kernel",
  163. .offset = MTDPART_OFS_APPEND,
  164. .size = 2 * SZ_1M,
  165. },
  166. #endif
  167. {
  168. .name = "filesystem",
  169. .size = MTDPART_SIZ_FULL,
  170. .offset = MTDPART_OFS_APPEND,
  171. },
  172. };
  173. #define H2_NAND_RB_GPIO_PIN 62
  174. static int h2_nand_dev_ready(struct mtd_info *mtd)
  175. {
  176. return gpio_get_value(H2_NAND_RB_GPIO_PIN);
  177. }
  178. static struct platform_nand_data h2_nand_platdata = {
  179. .chip = {
  180. .nr_chips = 1,
  181. .chip_offset = 0,
  182. .nr_partitions = ARRAY_SIZE(h2_nand_partitions),