analysisDataOperation.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * arch/arm/mach-shmobile/board-ag5evm.c
  3. *
  4. * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com>
  5. * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. */
  21. #include <linux/kernel.h>
  22. #include <linux/init.h>
  23. #include <linux/interrupt.h>
  24. #include <linux/irq.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/delay.h>
  27. #include <linux/io.h>
  28. #include <linux/dma-mapping.h>
  29. #include <linux/regulator/fixed.h>
  30. #include <linux/regulator/machine.h>
  31. #include <linux/serial_sci.h>
  32. #include <linux/smsc911x.h>
  33. #include <linux/gpio.h>
  34. #include <linux/videodev2.h>
  35. #include <linux/input.h>
  36. #include <linux/input/sh_keysc.h>
  37. #include <linux/mmc/host.h>
  38. #include <linux/mmc/sh_mmcif.h>
  39. #include <linux/mmc/sh_mobile_sdhi.h>
  40. #include <linux/mfd/tmio.h>
  41. #include <linux/sh_clk.h>
  42. #include <video/sh_mobile_lcdc.h>
  43. #include <video/sh_mipi_dsi.h>
  44. #include <sound/sh_fsi.h>
  45. #include <mach/hardware.h>
  46. #include <mach/irqs.h>
  47. #include <mach/sh73a0.h>
  48. #include <mach/common.h>
  49. #include <asm/mach-types.h>
  50. #include <asm/mach/arch.h>
  51. #include <asm/hardware/gic.h>
  52. #include <asm/hardware/cache-l2x0.h>
  53. #include <asm/traps.h>
  54. /* Dummy supplies, where voltage doesn't matter */
  55. static struct regulator_consumer_supply dummy_supplies[] = {
  56. REGULATOR_SUPPLY("vddvario", "smsc911x"),
  57. REGULATOR_SUPPLY("vdd33a", "smsc911x"),
  58. };
  59. static struct resource smsc9220_resources[] = {
  60. [0] = {
  61. .start = 0x14000000,
  62. .end = 0x14000000 + SZ_64K - 1,
  63. .flags = IORESOURCE_MEM,
  64. },
  65. [1] = {
  66. .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
  67. .flags = IORESOURCE_IRQ,
  68. },
  69. };
  70. static struct smsc911x_platform_config smsc9220_platdata = {
  71. .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  72. .phy_interface = PHY_INTERFACE_MODE_MII,
  73. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  74. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  75. };
  76. static struct platform_device eth_device = {
  77. .name = "smsc911x",
  78. .id = 0,
  79. .dev = {
  80. .platform_data = &smsc9220_platdata,
  81. },
  82. .resource = smsc9220_resources,
  83. .num_resources = ARRAY_SIZE(smsc9220_resources),
  84. };
  85. static struct sh_keysc_info keysc_platdata = {
  86. .mode = SH_KEYSC_MODE_6,
  87. .scan_timing = 3,
  88. .delay = 100,
  89. .keycodes = {
  90. KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
  91. KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
  92. KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
  93. KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
  94. KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
  95. KEY_COFFEE,
  96. KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
  97. KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
  98. KEY_COMPUTER,
  99. },
  100. };
  101. static struct resource keysc_resources[] = {
  102. [0] = {
  103. .name = "KEYSC",
  104. .start = 0xe61b0000,
  105. .end = 0xe61b0098 - 1,
  106. .flags = IORESOURCE_MEM,
  107. },
  108. [1] = {
  109. .start = gic_spi(71),
  110. .flags = IORESOURCE_IRQ,
  111. },
  112. };
  113. static struct platform_device keysc_device = {
  114. .name = "sh_keysc",
  115. .id = 0,
  116. .num_resources = ARRAY_SIZE(keysc_resources),
  117. .resource = keysc_resources,
  118. .dev = {
  119. .platform_data = &keysc_platdata,
  120. },
  121. };
  122. /* FSI A */
  123. static struct resource fsi_resources[] = {
  124. [0] = {
  125. .name = "FSI",
  126. .start = 0xEC230000,
  127. .end = 0xEC230400 - 1,
  128. .flags = IORESOURCE_MEM,
  129. },
  130. [1] = {
  131. .start = gic_spi(146),
  132. .flags = IORESOURCE_IRQ,
  133. },
  134. };
  135. static struct platform_device fsi_device = {
  136. .name = "sh_fsi2",
  137. .id = -1,
  138. .num_resources = ARRAY_SIZE(fsi_resources),
  139. .resource = fsi_resources,
  140. };
  141. /* Fixed 1.8V regulator to be used by MMCIF */
  142. static struct regulator_consumer_supply fixed1v8_power_consumers[] =
  143. {
  144. REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
  145. REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
  146. };
  147. static struct resource sh_mmcif_resources[] = {
  148. [0] = {
  149. .name = "MMCIF",
  150. .start = 0xe6bd0000,
  151. .end = 0xe6bd00ff,
  152. .flags = IORESOURCE_MEM,
  153. },
  154. [1] = {