devices.c 5.1 KB

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