devices.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. /* linux/arch/arm/mach-msm/devices.c
  2. *
  3. * Copyright (C) 2008 Google, Inc.
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/platform_device.h>
  17. #include <mach/msm_iomap.h>
  18. #include "devices.h"
  19. #include <asm/mach/flash.h>
  20. #include <linux/mtd/nand.h>
  21. #include <linux/mtd/partitions.h>
  22. static struct resource resources_uart1[] = {
  23. {
  24. .start = INT_UART1,
  25. .end = INT_UART1,
  26. .flags = IORESOURCE_IRQ,
  27. },
  28. {
  29. .start = MSM_UART1_PHYS,
  30. .end = MSM_UART1_PHYS + MSM_UART1_SIZE - 1,
  31. .flags = IORESOURCE_MEM,
  32. },
  33. };
  34. static struct resource resources_uart2[] = {
  35. {
  36. .start = INT_UART2,
  37. .end = INT_UART2,
  38. .flags = IORESOURCE_IRQ,
  39. },
  40. {
  41. .start = MSM_UART2_PHYS,
  42. .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1,
  43. .flags = IORESOURCE_MEM,
  44. },
  45. };
  46. static struct resource resources_uart3[] = {
  47. {
  48. .start = INT_UART3,
  49. .end = INT_UART3,
  50. .flags = IORESOURCE_IRQ,
  51. },
  52. {
  53. .start = MSM_UART3_PHYS,
  54. .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1,
  55. .flags = IORESOURCE_MEM,
  56. },
  57. };
  58. struct platform_device msm_device_uart1 = {
  59. .name = "msm_serial",
  60. .id = 0,
  61. .num_resources = ARRAY_SIZE(resources_uart1),
  62. .resource = resources_uart1,
  63. };
  64. struct platform_device msm_device_uart2 = {
  65. .name = "msm_serial",
  66. .id = 1,
  67. .num_resources = ARRAY_SIZE(resources_uart2),
  68. .resource = resources_uart2,
  69. };
  70. struct platform_device msm_device_uart3 = {
  71. .name = "msm_serial",
  72. .id = 2,
  73. .num_resources = ARRAY_SIZE(resources_uart3),
  74. .resource = resources_uart3,
  75. };
  76. static struct resource resources_i2c[] = {
  77. {
  78. .start = MSM_I2C_PHYS,
  79. .end = MSM_I2C_PHYS + MSM_I2C_SIZE - 1,
  80. .flags = IORESOURCE_MEM,
  81. },
  82. {
  83. .start = INT_PWB_I2C,
  84. .end = INT_PWB_I2C,
  85. .flags = IORESOURCE_IRQ,
  86. },
  87. };
  88. struct platform_device msm_device_i2c = {
  89. .name = "msm_i2c",
  90. .id = 0,
  91. .num_resources = ARRAY_SIZE(resources_i2c),
  92. .resource = resources_i2c,
  93. };
  94. static struct resource resources_hsusb[] = {
  95. {
  96. .start = MSM_HSUSB_PHYS,
  97. .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
  98. .flags = IORESOURCE_MEM,
  99. },
  100. {
  101. .start = INT_USB_HS,
  102. .end = INT_USB_HS,
  103. .flags = IORESOURCE_IRQ,
  104. },
  105. };
  106. struct platform_device msm_device_hsusb = {
  107. .name = "msm_hsusb",
  108. .id = -1,
  109. .num_resources = ARRAY_SIZE(resources_hsusb),
  110. .resource = resources_hsusb,
  111. .dev = {
  112. .coherent_dma_mask = 0xffffffff,
  113. },
  114. };
  115. struct flash_platform_data msm_nand_data = {
  116. .parts = NULL,
  117. .nr_parts = 0,
  118. };
  119. static struct resource resources_nand[] = {
  120. [0] = {
  121. .start = 7,
  122. .end = 7,
  123. .flags = IORESOURCE_DMA,
  124. },
  125. };
  126. struct platform_device msm_device_nand = {
  127. .name = "msm_nand",
  128. .id = -1,
  129. .num_resources = ARRAY_SIZE(resources_nand),
  130. .resource = resources_nand,
  131. .dev = {
  132. .platform_data = &msm_nand_data,
  133. },
  134. };
  135. struct platform_device msm_device_smd = {
  136. .name = "msm_smd",
  137. .id = -1,
  138. };
  139. static struct resource resources_sdc1[] = {
  140. {
  141. .start = MSM_SDC1_PHYS,
  142. .end = MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1,
  143. .flags = IORESOURCE_MEM,
  144. },
  145. {
  146. .start = INT_SDC1_0,
  147. .end = INT_SDC1_1,
  148. .flags = IORESOURCE_IRQ,
  149. },
  150. {
  151. .start = 8,
  152. .end = 8,
  153. .flags = IORESOURCE_DMA,
  154. },
  155. };
  156. static struct resource resources_sdc2[] = {
  157. {
  158. .start = MSM_SDC2_PHYS,
  159. .end = MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1,
  160. .flags = IORESOURCE_MEM,
  161. },
  162. {
  163. .start = INT_SDC2_0,
  164. .end = INT_SDC2_1,
  165. .flags = IORESOURCE_IRQ,
  166. },
  167. {
  168. .start = 8,
  169. .end = 8,
  170. .flags = IORESOURCE_DMA,
  171. },
  172. };
  173. static struct resource resources_sdc3[] = {
  174. {
  175. .start = MSM_SDC3_PHYS,
  176. .end = MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1,
  177. .flags = IORESOURCE_MEM,
  178. },
  179. {
  180. .start = INT_SDC3_0,
  181. .end = INT_SDC3_1,
  182. .flags = IORESOURCE_IRQ,
  183. },
  184. {
  185. .start = 8,
  186. .end = 8,
  187. .flags = IORESOURCE_DMA,
  188. },
  189. };
  190. static struct resource resources_sdc4[] = {
  191. {
  192. .start = MSM_SDC4_PHYS,
  193. .end = MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1,
  194. .flags = IORESOURCE_MEM,
  195. },
  196. {
  197. .start = INT_SDC4_0,
  198. .end = INT_SDC4_1,
  199. .flags = IORESOURCE_IRQ,
  200. },
  201. {
  202. .start = 8,
  203. .end = 8,
  204. .flags = IORESOURCE_DMA,
  205. },
  206. };
  207. struct platform_device msm_device_sdc1 = {
  208. .name = "msm_sdcc",
  209. .id = 1,
  210. .num_resources = ARRAY_SIZE(resources_sdc1),
  211. .resource = resources_sdc1,
  212. .dev = {
  213. .coherent_dma_mask = 0xffffffff,
  214. },
  215. };
  216. struct platform_device msm_device_sdc2 = {
  217. .name = "msm_sdcc",
  218. .id = 2,
  219. .num_resources = ARRAY_SIZE(resources_sdc2),
  220. .resource = resources_sdc2,
  221. .dev = {
  222. .coherent_dma_mask = 0xffffffff,
  223. },
  224. };
  225. struct platform_device msm_device_sdc3 = {
  226. .name = "msm_sdcc",
  227. .id = 3,
  228. .num_resources = ARRAY_SIZE(resources_sdc3),
  229. .resource = resources_sdc3,
  230. .dev = {
  231. .coherent_dma_mask = 0xffffffff,
  232. },
  233. };
  234. struct platform_device msm_device_sdc4 = {
  235. .name = "msm_sdcc",
  236. .id = 4,
  237. .num_resources = ARRAY_SIZE(resources_sdc4),
  238. .resource = resources_sdc4,
  239. .dev = {
  240. .coherent_dma_mask = 0xffffffff,
  241. },
  242. };