realizationOfDataCalculation.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * linux/arch/arm/mach-omap1/board-h3.c
  3. *
  4. * This file contains OMAP1710 H3 specific code.
  5. *
  6. * Copyright (C) 2004 Texas Instruments, Inc.
  7. * Copyright (C) 2002 MontaVista Software, Inc.
  8. * Copyright (C) 2001 RidgeRun, Inc.
  9. * Author: RidgeRun, Inc.
  10. * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/gpio.h>
  17. #include <linux/types.h>
  18. #include <linux/init.h>
  19. #include <linux/major.h>
  20. #include <linux/kernel.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/errno.h>
  23. #include <linux/workqueue.h>
  24. #include <linux/i2c.h>
  25. #include <linux/mtd/mtd.h>
  26. #include <linux/mtd/nand.h>
  27. #include <linux/mtd/partitions.h>
  28. #include <linux/mtd/physmap.h>
  29. #include <linux/input.h>
  30. #include <linux/spi/spi.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/setup.h>
  37. #include <asm/page.h>
  38. #include <asm/mach-types.h>
  39. #include <asm/mach/arch.h>
  40. #include <asm/mach/map.h>
  41. #include <mach/mux.h>
  42. #include <mach/tc.h>
  43. #include <linux/platform_data/keypad-omap.h>
  44. #include <linux/omap-dma.h>
  45. #include <mach/flash.h>
  46. #include <mach/hardware.h>
  47. #include <mach/irqs.h>
  48. #include <mach/usb.h>
  49. #include "common.h"
  50. #include "board-h3.h"
  51. /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */
  52. #define OMAP1710_ETHR_START 0x04000300
  53. #define H3_TS_GPIO 48
  54. static const unsigned int h3_keymap[] = {
  55. KEY(0, 0, KEY_LEFT),
  56. KEY(1, 0, KEY_RIGHT),
  57. KEY(2, 0, KEY_3),
  58. KEY(3, 0, KEY_F10),
  59. KEY(4, 0, KEY_F5),
  60. KEY(5, 0, KEY_9),
  61. KEY(0, 1, KEY_DOWN),
  62. KEY(1, 1, KEY_UP),
  63. KEY(2, 1, KEY_2),
  64. KEY(3, 1, KEY_F9),
  65. KEY(4, 1, KEY_F7),
  66. KEY(5, 1, KEY_0),
  67. KEY(0, 2, KEY_ENTER),
  68. KEY(1, 2, KEY_6),
  69. KEY(2, 2, KEY_1),
  70. KEY(3, 2, KEY_F2),
  71. KEY(4, 2, KEY_F6),
  72. KEY(5, 2, KEY_HOME),
  73. KEY(0, 3, KEY_8),
  74. KEY(1, 3, KEY_5),
  75. KEY(2, 3, KEY_F12),
  76. KEY(3, 3, KEY_F3),
  77. KEY(4, 3, KEY_F8),
  78. KEY(5, 3, KEY_END),
  79. KEY(0, 4, KEY_7),
  80. KEY(1, 4, KEY_4),
  81. KEY(2, 4, KEY_F11),
  82. KEY(3, 4, KEY_F1),
  83. KEY(4, 4, KEY_F4),
  84. KEY(5, 4, KEY_ESC),
  85. KEY(0, 5, KEY_F13),
  86. KEY(1, 5, KEY_F14),
  87. KEY(2, 5, KEY_F15),
  88. KEY(3, 5, KEY_F16),
  89. KEY(4, 5, KEY_SLEEP),
  90. };
  91. static struct mtd_partition nor_partitions[] = {
  92. /* bootloader (U-Boot, etc) in first sector */
  93. {
  94. .name = "bootloader",
  95. .offset = 0,
  96. .size = SZ_128K,
  97. .mask_flags = MTD_WRITEABLE, /* force read-only */
  98. },
  99. /* bootloader params in the next sector */
  100. {
  101. .name = "params",
  102. .offset = MTDPART_OFS_APPEND,
  103. .size = SZ_128K,
  104. .mask_flags = 0,
  105. },
  106. /* kernel */
  107. {
  108. .name = "kernel",
  109. .offset = MTDPART_OFS_APPEND,
  110. .size = SZ_2M,
  111. .mask_flags = 0
  112. },
  113. /* file system */
  114. {
  115. .name = "filesystem",
  116. .offset = MTDPART_OFS_APPEND,
  117. .size = MTDPART_SIZ_FULL,
  118. .mask_flags = 0
  119. }
  120. };
  121. static struct physmap_flash_data nor_data = {
  122. .width = 2,
  123. .set_vpp = omap1_set_vpp,
  124. .parts = nor_partitions,
  125. .nr_parts = ARRAY_SIZE(nor_partitions),
  126. };
  127. static struct resource nor_resource = {
  128. /* This is on CS3, wherever it's mapped */
  129. .flags = IORESOURCE_MEM,
  130. };
  131. static struct platform_device nor_device = {
  132. .name = "physmap-flash",
  133. .id = 0,
  134. .dev = {
  135. .platform_data = &nor_data,
  136. },
  137. .num_resources = 1,
  138. .resource = &nor_resource,
  139. };
  140. static struct mtd_partition nand_partitions[] = {
  141. #if 0
  142. /* REVISIT: enable these partitions if you make NAND BOOT work */
  143. {
  144. .name = "xloader",
  145. .offset = 0,
  146. .size = 64 * 1024,