Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved. |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #include <linux/kernel.h> |
| 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/bootmem.h> |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 16 | #include <mach/irqs.h> |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 17 | #include <mach/iommu.h> |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 18 | #include <mach/socinfo.h> |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 19 | |
| 20 | static struct resource msm_iommu_jpegd_resources[] = { |
| 21 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 22 | .start = 0x07300000, |
| 23 | .end = 0x07300000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 24 | .name = "physbase", |
| 25 | .flags = IORESOURCE_MEM, |
| 26 | }, |
| 27 | { |
| 28 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 29 | .start = 98, |
| 30 | .end = 98, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 31 | .flags = IORESOURCE_IRQ, |
| 32 | }, |
| 33 | { |
| 34 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 35 | .start = 97, |
| 36 | .end = 97, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 37 | .flags = IORESOURCE_IRQ, |
| 38 | }, |
| 39 | }; |
| 40 | |
| 41 | static struct resource msm_iommu_vpe_resources[] = { |
| 42 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 43 | .start = 0x07400000, |
| 44 | .end = 0x07400000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 45 | .name = "physbase", |
| 46 | .flags = IORESOURCE_MEM, |
| 47 | }, |
| 48 | { |
| 49 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 50 | .start = 84, |
| 51 | .end = 84, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 52 | .flags = IORESOURCE_IRQ, |
| 53 | }, |
| 54 | { |
| 55 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 56 | .start = 83, |
| 57 | .end = 83, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 58 | .flags = IORESOURCE_IRQ, |
| 59 | }, |
| 60 | }; |
| 61 | |
| 62 | static struct resource msm_iommu_mdp0_resources[] = { |
| 63 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 64 | .start = 0x07500000, |
| 65 | .end = 0x07500000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 66 | .name = "physbase", |
| 67 | .flags = IORESOURCE_MEM, |
| 68 | }, |
| 69 | { |
| 70 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 71 | .start = 96, |
| 72 | .end = 96, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 73 | .flags = IORESOURCE_IRQ, |
| 74 | }, |
| 75 | { |
| 76 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 77 | .start = 95, |
| 78 | .end = 95, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 79 | .flags = IORESOURCE_IRQ, |
| 80 | }, |
| 81 | }; |
| 82 | |
| 83 | static struct resource msm_iommu_mdp1_resources[] = { |
| 84 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 85 | .start = 0x07600000, |
| 86 | .end = 0x07600000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 87 | .name = "physbase", |
| 88 | .flags = IORESOURCE_MEM, |
| 89 | }, |
| 90 | { |
| 91 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 92 | .start = 94, |
| 93 | .end = 94, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 94 | .flags = IORESOURCE_IRQ, |
| 95 | }, |
| 96 | { |
| 97 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 98 | .start = 93, |
| 99 | .end = 93, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 100 | .flags = IORESOURCE_IRQ, |
| 101 | }, |
| 102 | }; |
| 103 | |
| 104 | static struct resource msm_iommu_rot_resources[] = { |
| 105 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 106 | .start = 0x07700000, |
| 107 | .end = 0x07700000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 108 | .name = "physbase", |
| 109 | .flags = IORESOURCE_MEM, |
| 110 | }, |
| 111 | { |
| 112 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 113 | .start = 92, |
| 114 | .end = 92, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 115 | .flags = IORESOURCE_IRQ, |
| 116 | }, |
| 117 | { |
| 118 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 119 | .start = 91, |
| 120 | .end = 91, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 121 | .flags = IORESOURCE_IRQ, |
| 122 | }, |
| 123 | }; |
| 124 | |
| 125 | static struct resource msm_iommu_ijpeg_resources[] = { |
| 126 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 127 | .start = 0x07800000, |
| 128 | .end = 0x07800000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 129 | .name = "physbase", |
| 130 | .flags = IORESOURCE_MEM, |
| 131 | }, |
| 132 | { |
| 133 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 134 | .start = 100, |
| 135 | .end = 100, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 136 | .flags = IORESOURCE_IRQ, |
| 137 | }, |
| 138 | { |
| 139 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 140 | .start = 99, |
| 141 | .end = 99, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 142 | .flags = IORESOURCE_IRQ, |
| 143 | }, |
| 144 | }; |
| 145 | |
| 146 | static struct resource msm_iommu_vfe_resources[] = { |
| 147 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 148 | .start = 0x07900000, |
| 149 | .end = 0x07900000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 150 | .name = "physbase", |
| 151 | .flags = IORESOURCE_MEM, |
| 152 | }, |
| 153 | { |
| 154 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 155 | .start = 86, |
| 156 | .end = 86, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 157 | .flags = IORESOURCE_IRQ, |
| 158 | }, |
| 159 | { |
| 160 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 161 | .start = 85, |
| 162 | .end = 85, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 163 | .flags = IORESOURCE_IRQ, |
| 164 | }, |
| 165 | }; |
| 166 | |
| 167 | static struct resource msm_iommu_vcodec_a_resources[] = { |
| 168 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 169 | .start = 0x07A00000, |
| 170 | .end = 0x07A00000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 171 | .name = "physbase", |
| 172 | .flags = IORESOURCE_MEM, |
| 173 | }, |
| 174 | { |
| 175 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 176 | .start = 90, |
| 177 | .end = 90, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 178 | .flags = IORESOURCE_IRQ, |
| 179 | }, |
| 180 | { |
| 181 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 182 | .start = 89, |
| 183 | .end = 89, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 184 | .flags = IORESOURCE_IRQ, |
| 185 | }, |
| 186 | }; |
| 187 | |
| 188 | static struct resource msm_iommu_vcodec_b_resources[] = { |
| 189 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 190 | .start = 0x07B00000, |
| 191 | .end = 0x07B00000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 192 | .name = "physbase", |
| 193 | .flags = IORESOURCE_MEM, |
| 194 | }, |
| 195 | { |
| 196 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 197 | .start = 88, |
| 198 | .end = 88, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 199 | .flags = IORESOURCE_IRQ, |
| 200 | }, |
| 201 | { |
| 202 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 203 | .start = 87, |
| 204 | .end = 87, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 205 | .flags = IORESOURCE_IRQ, |
| 206 | }, |
| 207 | }; |
| 208 | |
| 209 | static struct resource msm_iommu_gfx3d_resources[] = { |
| 210 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 211 | .start = 0x07C00000, |
| 212 | .end = 0x07C00000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 213 | .name = "physbase", |
| 214 | .flags = IORESOURCE_MEM, |
| 215 | }, |
| 216 | { |
| 217 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 218 | .start = 102, |
| 219 | .end = 102, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 220 | .flags = IORESOURCE_IRQ, |
| 221 | }, |
| 222 | { |
| 223 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 224 | .start = 101, |
| 225 | .end = 101, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 226 | .flags = IORESOURCE_IRQ, |
| 227 | }, |
| 228 | }; |
| 229 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 230 | static struct resource msm_iommu_gfx3d1_resources[] = { |
| 231 | { |
| 232 | .start = 0x07D00000, |
| 233 | .end = 0x07D00000 + SZ_1M - 1, |
| 234 | .name = "physbase", |
| 235 | .flags = IORESOURCE_MEM, |
| 236 | }, |
| 237 | { |
| 238 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 239 | .start = 243, |
| 240 | .end = 243, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 241 | .flags = IORESOURCE_IRQ, |
| 242 | }, |
| 243 | { |
| 244 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 245 | .start = 242, |
| 246 | .end = 242, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 247 | .flags = IORESOURCE_IRQ, |
| 248 | }, |
| 249 | }; |
| 250 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 251 | static struct resource msm_iommu_gfx2d0_resources[] = { |
| 252 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 253 | .start = 0x07D00000, |
| 254 | .end = 0x07D00000 + SZ_1M - 1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 255 | .name = "physbase", |
| 256 | .flags = IORESOURCE_MEM, |
| 257 | }, |
| 258 | { |
| 259 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 260 | .start = 104, |
| 261 | .end = 104, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 262 | .flags = IORESOURCE_IRQ, |
| 263 | }, |
| 264 | { |
| 265 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 266 | .start = 103, |
| 267 | .end = 103, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 268 | .flags = IORESOURCE_IRQ, |
| 269 | }, |
| 270 | }; |
| 271 | |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 272 | static struct resource msm_iommu_gfx2d1_resources[] = { |
| 273 | { |
Stepan Moskovchenko | 69e2136 | 2011-02-11 12:28:17 -0800 | [diff] [blame] | 274 | .start = 0x07E00000, |
| 275 | .end = 0x07E00000 + SZ_1M - 1, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 276 | .name = "physbase", |
| 277 | .flags = IORESOURCE_MEM, |
| 278 | }, |
| 279 | { |
| 280 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 281 | .start = 243, |
| 282 | .end = 243, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 283 | .flags = IORESOURCE_IRQ, |
| 284 | }, |
| 285 | { |
| 286 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 287 | .start = 242, |
| 288 | .end = 242, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 289 | .flags = IORESOURCE_IRQ, |
| 290 | }, |
| 291 | }; |
| 292 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 293 | static struct resource msm_iommu_vcap_resources[] = { |
| 294 | { |
| 295 | .start = 0x07200000, |
| 296 | .end = 0x07200000 + SZ_1M - 1, |
| 297 | .name = "physbase", |
| 298 | .flags = IORESOURCE_MEM, |
| 299 | }, |
| 300 | { |
| 301 | .name = "nonsecure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 302 | .start = 269, |
| 303 | .end = 269, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 304 | .flags = IORESOURCE_IRQ, |
| 305 | }, |
| 306 | { |
| 307 | .name = "secure_irq", |
Stepan Moskovchenko | c64fd94 | 2011-10-27 17:47:58 -0700 | [diff] [blame] | 308 | .start = 268, |
| 309 | .end = 268, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 310 | .flags = IORESOURCE_IRQ, |
| 311 | }, |
| 312 | }; |
| 313 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 314 | static struct platform_device msm_root_iommu_dev = { |
| 315 | .name = "msm_iommu", |
| 316 | .id = -1, |
| 317 | }; |
| 318 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 319 | static struct msm_iommu_dev jpegd_iommu = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 320 | .name = "jpegd", |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 321 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 322 | }; |
| 323 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 324 | static struct msm_iommu_dev vpe_iommu = { |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 325 | .name = "vpe", |
| 326 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 327 | }; |
| 328 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 329 | static struct msm_iommu_dev mdp0_iommu = { |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 330 | .name = "mdp0", |
| 331 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 332 | }; |
| 333 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 334 | static struct msm_iommu_dev mdp1_iommu = { |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 335 | .name = "mdp1", |
| 336 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 337 | }; |
| 338 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 339 | static struct msm_iommu_dev rot_iommu = { |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 340 | .name = "rot", |
| 341 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 342 | }; |
| 343 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 344 | static struct msm_iommu_dev ijpeg_iommu = { |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 345 | .name = "ijpeg", |
| 346 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 347 | }; |
| 348 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 349 | static struct msm_iommu_dev vfe_iommu = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 350 | .name = "vfe", |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 351 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 352 | }; |
| 353 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 354 | static struct msm_iommu_dev vcodec_a_iommu = { |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 355 | .name = "vcodec_a", |
| 356 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 357 | }; |
| 358 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 359 | static struct msm_iommu_dev vcodec_b_iommu = { |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 360 | .name = "vcodec_b", |
| 361 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 362 | }; |
| 363 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 364 | static struct msm_iommu_dev gfx3d_iommu = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 365 | .name = "gfx3d", |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 366 | .ncb = 3, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 367 | }; |
| 368 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 369 | static struct msm_iommu_dev gfx3d1_iommu = { |
| 370 | .name = "gfx3d1", |
| 371 | .ncb = 3, |
| 372 | }; |
| 373 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 374 | static struct msm_iommu_dev gfx2d0_iommu = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 375 | .name = "gfx2d0", |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 376 | .ncb = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 377 | }; |
| 378 | |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 379 | static struct msm_iommu_dev gfx2d1_iommu = { |
| 380 | .name = "gfx2d1", |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 381 | .ncb = 2, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 382 | }; |
| 383 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 384 | static struct msm_iommu_dev vcap_iommu = { |
| 385 | .name = "vcap", |
| 386 | .ncb = 2, |
| 387 | }; |
| 388 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 389 | static struct platform_device msm_device_iommu_jpegd = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 390 | .name = "msm_iommu", |
| 391 | .id = 0, |
| 392 | .dev = { |
| 393 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 394 | .platform_data = &jpegd_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 395 | }, |
| 396 | .num_resources = ARRAY_SIZE(msm_iommu_jpegd_resources), |
| 397 | .resource = msm_iommu_jpegd_resources, |
| 398 | }; |
| 399 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 400 | static struct platform_device msm_device_iommu_vpe = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 401 | .name = "msm_iommu", |
| 402 | .id = 1, |
| 403 | .dev = { |
| 404 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 405 | .platform_data = &vpe_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 406 | }, |
| 407 | .num_resources = ARRAY_SIZE(msm_iommu_vpe_resources), |
| 408 | .resource = msm_iommu_vpe_resources, |
| 409 | }; |
| 410 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 411 | static struct platform_device msm_device_iommu_mdp0 = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 412 | .name = "msm_iommu", |
| 413 | .id = 2, |
| 414 | .dev = { |
| 415 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 416 | .platform_data = &mdp0_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 417 | }, |
| 418 | .num_resources = ARRAY_SIZE(msm_iommu_mdp0_resources), |
| 419 | .resource = msm_iommu_mdp0_resources, |
| 420 | }; |
| 421 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 422 | static struct platform_device msm_device_iommu_mdp1 = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 423 | .name = "msm_iommu", |
| 424 | .id = 3, |
| 425 | .dev = { |
| 426 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 427 | .platform_data = &mdp1_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 428 | }, |
| 429 | .num_resources = ARRAY_SIZE(msm_iommu_mdp1_resources), |
| 430 | .resource = msm_iommu_mdp1_resources, |
| 431 | }; |
| 432 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 433 | static struct platform_device msm_device_iommu_rot = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 434 | .name = "msm_iommu", |
| 435 | .id = 4, |
| 436 | .dev = { |
| 437 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 438 | .platform_data = &rot_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 439 | }, |
| 440 | .num_resources = ARRAY_SIZE(msm_iommu_rot_resources), |
| 441 | .resource = msm_iommu_rot_resources, |
| 442 | }; |
| 443 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 444 | static struct platform_device msm_device_iommu_ijpeg = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 445 | .name = "msm_iommu", |
| 446 | .id = 5, |
| 447 | .dev = { |
| 448 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 449 | .platform_data = &ijpeg_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 450 | }, |
| 451 | .num_resources = ARRAY_SIZE(msm_iommu_ijpeg_resources), |
| 452 | .resource = msm_iommu_ijpeg_resources, |
| 453 | }; |
| 454 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 455 | static struct platform_device msm_device_iommu_vfe = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 456 | .name = "msm_iommu", |
| 457 | .id = 6, |
| 458 | .dev = { |
| 459 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 460 | .platform_data = &vfe_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 461 | }, |
| 462 | .num_resources = ARRAY_SIZE(msm_iommu_vfe_resources), |
| 463 | .resource = msm_iommu_vfe_resources, |
| 464 | }; |
| 465 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 466 | static struct platform_device msm_device_iommu_vcodec_a = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 467 | .name = "msm_iommu", |
| 468 | .id = 7, |
| 469 | .dev = { |
| 470 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 471 | .platform_data = &vcodec_a_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 472 | }, |
| 473 | .num_resources = ARRAY_SIZE(msm_iommu_vcodec_a_resources), |
| 474 | .resource = msm_iommu_vcodec_a_resources, |
| 475 | }; |
| 476 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 477 | static struct platform_device msm_device_iommu_vcodec_b = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 478 | .name = "msm_iommu", |
| 479 | .id = 8, |
| 480 | .dev = { |
| 481 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 482 | .platform_data = &vcodec_b_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 483 | }, |
| 484 | .num_resources = ARRAY_SIZE(msm_iommu_vcodec_b_resources), |
| 485 | .resource = msm_iommu_vcodec_b_resources, |
| 486 | }; |
| 487 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 488 | static struct platform_device msm_device_iommu_gfx3d = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 489 | .name = "msm_iommu", |
| 490 | .id = 9, |
| 491 | .dev = { |
| 492 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 493 | .platform_data = &gfx3d_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 494 | }, |
| 495 | .num_resources = ARRAY_SIZE(msm_iommu_gfx3d_resources), |
| 496 | .resource = msm_iommu_gfx3d_resources, |
| 497 | }; |
| 498 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 499 | static struct platform_device msm_device_iommu_gfx3d1 = { |
| 500 | .name = "msm_iommu", |
| 501 | .id = 10, |
| 502 | .dev = { |
| 503 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 504 | .platform_data = &gfx3d1_iommu, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 505 | }, |
| 506 | .num_resources = ARRAY_SIZE(msm_iommu_gfx3d1_resources), |
| 507 | .resource = msm_iommu_gfx3d1_resources, |
| 508 | }; |
| 509 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 510 | static struct platform_device msm_device_iommu_gfx2d0 = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 511 | .name = "msm_iommu", |
| 512 | .id = 10, |
| 513 | .dev = { |
| 514 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 515 | .platform_data = &gfx2d0_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 516 | }, |
| 517 | .num_resources = ARRAY_SIZE(msm_iommu_gfx2d0_resources), |
| 518 | .resource = msm_iommu_gfx2d0_resources, |
| 519 | }; |
| 520 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 521 | static struct platform_device msm_device_iommu_gfx2d1 = { |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 522 | .name = "msm_iommu", |
| 523 | .id = 11, |
| 524 | .dev = { |
| 525 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 526 | .platform_data = &gfx2d1_iommu, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 527 | }, |
| 528 | .num_resources = ARRAY_SIZE(msm_iommu_gfx2d1_resources), |
| 529 | .resource = msm_iommu_gfx2d1_resources, |
| 530 | }; |
| 531 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 532 | static struct platform_device msm_device_iommu_vcap = { |
| 533 | .name = "msm_iommu", |
| 534 | .id = 11, |
| 535 | .dev = { |
| 536 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 537 | .platform_data = &vcap_iommu, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 538 | }, |
| 539 | .num_resources = ARRAY_SIZE(msm_iommu_vcap_resources), |
| 540 | .resource = msm_iommu_vcap_resources, |
| 541 | }; |
| 542 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 543 | static struct msm_iommu_ctx_dev jpegd_src_ctx = { |
| 544 | .name = "jpegd_src", |
| 545 | .num = 0, |
| 546 | .mids = {0, -1} |
| 547 | }; |
| 548 | |
| 549 | static struct msm_iommu_ctx_dev jpegd_dst_ctx = { |
| 550 | .name = "jpegd_dst", |
| 551 | .num = 1, |
| 552 | .mids = {1, -1} |
| 553 | }; |
| 554 | |
| 555 | static struct msm_iommu_ctx_dev vpe_src_ctx = { |
| 556 | .name = "vpe_src", |
| 557 | .num = 0, |
| 558 | .mids = {0, -1} |
| 559 | }; |
| 560 | |
| 561 | static struct msm_iommu_ctx_dev vpe_dst_ctx = { |
| 562 | .name = "vpe_dst", |
| 563 | .num = 1, |
| 564 | .mids = {1, -1} |
| 565 | }; |
| 566 | |
| 567 | static struct msm_iommu_ctx_dev mdp_vg1_ctx = { |
| 568 | .name = "mdp_vg1", |
| 569 | .num = 0, |
| 570 | .mids = {0, 2, -1} |
| 571 | }; |
| 572 | |
| 573 | static struct msm_iommu_ctx_dev mdp_rgb1_ctx = { |
| 574 | .name = "mdp_rgb1", |
| 575 | .num = 1, |
| 576 | .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1} |
| 577 | }; |
| 578 | |
| 579 | static struct msm_iommu_ctx_dev mdp_vg2_ctx = { |
| 580 | .name = "mdp_vg2", |
| 581 | .num = 0, |
| 582 | .mids = {0, 2, -1} |
| 583 | }; |
| 584 | |
| 585 | static struct msm_iommu_ctx_dev mdp_rgb2_ctx = { |
| 586 | .name = "mdp_rgb2", |
| 587 | .num = 1, |
| 588 | .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1} |
| 589 | }; |
| 590 | |
| 591 | static struct msm_iommu_ctx_dev rot_src_ctx = { |
| 592 | .name = "rot_src", |
| 593 | .num = 0, |
| 594 | .mids = {0, -1} |
| 595 | }; |
| 596 | |
| 597 | static struct msm_iommu_ctx_dev rot_dst_ctx = { |
| 598 | .name = "rot_dst", |
| 599 | .num = 1, |
| 600 | .mids = {1, -1} |
| 601 | }; |
| 602 | |
| 603 | static struct msm_iommu_ctx_dev ijpeg_src_ctx = { |
| 604 | .name = "ijpeg_src", |
| 605 | .num = 0, |
| 606 | .mids = {0, -1} |
| 607 | }; |
| 608 | |
| 609 | static struct msm_iommu_ctx_dev ijpeg_dst_ctx = { |
| 610 | .name = "ijpeg_dst", |
| 611 | .num = 1, |
| 612 | .mids = {1, -1} |
| 613 | }; |
| 614 | |
| 615 | static struct msm_iommu_ctx_dev vfe_imgwr_ctx = { |
| 616 | .name = "vfe_imgwr", |
| 617 | .num = 0, |
| 618 | .mids = {2, 3, 4, 5, 6, 7, 8, -1} |
| 619 | }; |
| 620 | |
| 621 | static struct msm_iommu_ctx_dev vfe_misc_ctx = { |
| 622 | .name = "vfe_misc", |
| 623 | .num = 1, |
| 624 | .mids = {0, 1, 9, -1} |
| 625 | }; |
| 626 | |
| 627 | static struct msm_iommu_ctx_dev vcodec_a_stream_ctx = { |
| 628 | .name = "vcodec_a_stream", |
| 629 | .num = 0, |
| 630 | .mids = {2, 5, -1} |
| 631 | }; |
| 632 | |
| 633 | static struct msm_iommu_ctx_dev vcodec_a_mm1_ctx = { |
| 634 | .name = "vcodec_a_mm1", |
| 635 | .num = 1, |
| 636 | .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1} |
| 637 | }; |
| 638 | |
| 639 | static struct msm_iommu_ctx_dev vcodec_b_mm2_ctx = { |
| 640 | .name = "vcodec_b_mm2", |
| 641 | .num = 0, |
| 642 | .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1} |
| 643 | }; |
| 644 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 645 | static struct msm_iommu_ctx_dev gfx3d_user_ctx = { |
| 646 | .name = "gfx3d_user", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 647 | .num = 0, |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 648 | .mids = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1} |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 649 | }; |
| 650 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 651 | static struct msm_iommu_ctx_dev gfx3d_priv_ctx = { |
| 652 | .name = "gfx3d_priv", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 653 | .num = 1, |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 654 | .mids = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, |
| 655 | 31, -1} |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 656 | }; |
| 657 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 658 | static struct msm_iommu_ctx_dev gfx3d1_user_ctx = { |
| 659 | .name = "gfx3d1_user", |
| 660 | .num = 0, |
| 661 | .mids = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1} |
| 662 | }; |
| 663 | |
| 664 | static struct msm_iommu_ctx_dev gfx3d1_priv_ctx = { |
| 665 | .name = "gfx3d1_priv", |
| 666 | .num = 1, |
| 667 | .mids = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, |
| 668 | 31, -1} |
| 669 | }; |
| 670 | |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 671 | static struct msm_iommu_ctx_dev gfx2d0_2d0_ctx = { |
| 672 | .name = "gfx2d0_2d0", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 673 | .num = 0, |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 674 | .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1} |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 675 | }; |
| 676 | |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 677 | static struct msm_iommu_ctx_dev gfx2d1_2d1_ctx = { |
| 678 | .name = "gfx2d1_2d1", |
| 679 | .num = 0, |
| 680 | .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1} |
| 681 | }; |
| 682 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 683 | static struct msm_iommu_ctx_dev vcap_vc_ctx = { |
| 684 | .name = "vcap_vc", |
| 685 | .num = 0, |
| 686 | .mids = {0, -1} |
| 687 | }; |
| 688 | |
| 689 | static struct msm_iommu_ctx_dev vcap_vp_ctx = { |
| 690 | .name = "vcap_vp", |
| 691 | .num = 1, |
| 692 | .mids = {1, -1} |
| 693 | }; |
| 694 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 695 | static struct platform_device msm_device_jpegd_src_ctx = { |
| 696 | .name = "msm_iommu_ctx", |
| 697 | .id = 0, |
| 698 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 699 | .parent = &msm_device_iommu_jpegd.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 700 | .platform_data = &jpegd_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 701 | }, |
| 702 | }; |
| 703 | |
| 704 | static struct platform_device msm_device_jpegd_dst_ctx = { |
| 705 | .name = "msm_iommu_ctx", |
| 706 | .id = 1, |
| 707 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 708 | .parent = &msm_device_iommu_jpegd.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 709 | .platform_data = &jpegd_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 710 | }, |
| 711 | }; |
| 712 | |
| 713 | static struct platform_device msm_device_vpe_src_ctx = { |
| 714 | .name = "msm_iommu_ctx", |
| 715 | .id = 2, |
| 716 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 717 | .parent = &msm_device_iommu_vpe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 718 | .platform_data = &vpe_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 719 | }, |
| 720 | }; |
| 721 | |
| 722 | static struct platform_device msm_device_vpe_dst_ctx = { |
| 723 | .name = "msm_iommu_ctx", |
| 724 | .id = 3, |
| 725 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 726 | .parent = &msm_device_iommu_vpe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 727 | .platform_data = &vpe_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 728 | }, |
| 729 | }; |
| 730 | |
| 731 | static struct platform_device msm_device_mdp_vg1_ctx = { |
| 732 | .name = "msm_iommu_ctx", |
| 733 | .id = 4, |
| 734 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 735 | .parent = &msm_device_iommu_mdp0.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 736 | .platform_data = &mdp_vg1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 737 | }, |
| 738 | }; |
| 739 | |
| 740 | static struct platform_device msm_device_mdp_rgb1_ctx = { |
| 741 | .name = "msm_iommu_ctx", |
| 742 | .id = 5, |
| 743 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 744 | .parent = &msm_device_iommu_mdp0.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 745 | .platform_data = &mdp_rgb1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 746 | }, |
| 747 | }; |
| 748 | |
| 749 | static struct platform_device msm_device_mdp_vg2_ctx = { |
| 750 | .name = "msm_iommu_ctx", |
| 751 | .id = 6, |
| 752 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 753 | .parent = &msm_device_iommu_mdp1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 754 | .platform_data = &mdp_vg2_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 755 | }, |
| 756 | }; |
| 757 | |
| 758 | static struct platform_device msm_device_mdp_rgb2_ctx = { |
| 759 | .name = "msm_iommu_ctx", |
| 760 | .id = 7, |
| 761 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 762 | .parent = &msm_device_iommu_mdp1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 763 | .platform_data = &mdp_rgb2_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 764 | }, |
| 765 | }; |
| 766 | |
| 767 | static struct platform_device msm_device_rot_src_ctx = { |
| 768 | .name = "msm_iommu_ctx", |
| 769 | .id = 8, |
| 770 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 771 | .parent = &msm_device_iommu_rot.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 772 | .platform_data = &rot_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 773 | }, |
| 774 | }; |
| 775 | |
| 776 | static struct platform_device msm_device_rot_dst_ctx = { |
| 777 | .name = "msm_iommu_ctx", |
| 778 | .id = 9, |
| 779 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 780 | .parent = &msm_device_iommu_rot.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 781 | .platform_data = &rot_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 782 | }, |
| 783 | }; |
| 784 | |
| 785 | static struct platform_device msm_device_ijpeg_src_ctx = { |
| 786 | .name = "msm_iommu_ctx", |
| 787 | .id = 10, |
| 788 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 789 | .parent = &msm_device_iommu_ijpeg.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 790 | .platform_data = &ijpeg_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 791 | }, |
| 792 | }; |
| 793 | |
| 794 | static struct platform_device msm_device_ijpeg_dst_ctx = { |
| 795 | .name = "msm_iommu_ctx", |
| 796 | .id = 11, |
| 797 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 798 | .parent = &msm_device_iommu_ijpeg.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 799 | .platform_data = &ijpeg_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 800 | }, |
| 801 | }; |
| 802 | |
| 803 | static struct platform_device msm_device_vfe_imgwr_ctx = { |
| 804 | .name = "msm_iommu_ctx", |
| 805 | .id = 12, |
| 806 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 807 | .parent = &msm_device_iommu_vfe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 808 | .platform_data = &vfe_imgwr_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 809 | }, |
| 810 | }; |
| 811 | |
| 812 | static struct platform_device msm_device_vfe_misc_ctx = { |
| 813 | .name = "msm_iommu_ctx", |
| 814 | .id = 13, |
| 815 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 816 | .parent = &msm_device_iommu_vfe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 817 | .platform_data = &vfe_misc_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 818 | }, |
| 819 | }; |
| 820 | |
| 821 | static struct platform_device msm_device_vcodec_a_stream_ctx = { |
| 822 | .name = "msm_iommu_ctx", |
| 823 | .id = 14, |
| 824 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 825 | .parent = &msm_device_iommu_vcodec_a.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 826 | .platform_data = &vcodec_a_stream_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 827 | }, |
| 828 | }; |
| 829 | |
| 830 | static struct platform_device msm_device_vcodec_a_mm1_ctx = { |
| 831 | .name = "msm_iommu_ctx", |
| 832 | .id = 15, |
| 833 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 834 | .parent = &msm_device_iommu_vcodec_a.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 835 | .platform_data = &vcodec_a_mm1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 836 | }, |
| 837 | }; |
| 838 | |
| 839 | static struct platform_device msm_device_vcodec_b_mm2_ctx = { |
| 840 | .name = "msm_iommu_ctx", |
| 841 | .id = 16, |
| 842 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 843 | .parent = &msm_device_iommu_vcodec_b.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 844 | .platform_data = &vcodec_b_mm2_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 845 | }, |
| 846 | }; |
| 847 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 848 | static struct platform_device msm_device_gfx3d_user_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 849 | .name = "msm_iommu_ctx", |
| 850 | .id = 17, |
| 851 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 852 | .parent = &msm_device_iommu_gfx3d.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 853 | .platform_data = &gfx3d_user_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 854 | }, |
| 855 | }; |
| 856 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 857 | static struct platform_device msm_device_gfx3d_priv_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 858 | .name = "msm_iommu_ctx", |
| 859 | .id = 18, |
| 860 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 861 | .parent = &msm_device_iommu_gfx3d.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 862 | .platform_data = &gfx3d_priv_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 863 | }, |
| 864 | }; |
| 865 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 866 | static struct platform_device msm_device_gfx3d1_user_ctx = { |
| 867 | .name = "msm_iommu_ctx", |
| 868 | .id = 19, |
| 869 | .dev = { |
| 870 | .parent = &msm_device_iommu_gfx3d1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 871 | .platform_data = &gfx3d1_user_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 872 | }, |
| 873 | }; |
| 874 | |
| 875 | static struct platform_device msm_device_gfx3d1_priv_ctx = { |
| 876 | .name = "msm_iommu_ctx", |
| 877 | .id = 20, |
| 878 | .dev = { |
| 879 | .parent = &msm_device_iommu_gfx3d1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 880 | .platform_data = &gfx3d1_priv_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 881 | }, |
| 882 | }; |
| 883 | |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 884 | static struct platform_device msm_device_gfx2d0_2d0_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 885 | .name = "msm_iommu_ctx", |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 886 | .id = 19, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 887 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 888 | .parent = &msm_device_iommu_gfx2d0.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 889 | .platform_data = &gfx2d0_2d0_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 890 | }, |
| 891 | }; |
| 892 | |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 893 | static struct platform_device msm_device_gfx2d1_2d1_ctx = { |
| 894 | .name = "msm_iommu_ctx", |
| 895 | .id = 20, |
| 896 | .dev = { |
| 897 | .parent = &msm_device_iommu_gfx2d1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 898 | .platform_data = &gfx2d1_2d1_ctx, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 899 | }, |
| 900 | }; |
| 901 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 902 | static struct platform_device msm_device_vcap_vc_ctx = { |
| 903 | .name = "msm_iommu_ctx", |
| 904 | .id = 21, |
| 905 | .dev = { |
| 906 | .parent = &msm_device_iommu_vcap.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 907 | .platform_data = &vcap_vc_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 908 | }, |
| 909 | }; |
| 910 | |
| 911 | static struct platform_device msm_device_vcap_vp_ctx = { |
| 912 | .name = "msm_iommu_ctx", |
| 913 | .id = 22, |
| 914 | .dev = { |
| 915 | .parent = &msm_device_iommu_vcap.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 916 | .platform_data = &vcap_vp_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 917 | }, |
| 918 | }; |
| 919 | |
| 920 | static struct platform_device *msm_iommu_common_devs[] = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 921 | &msm_device_iommu_vpe, |
| 922 | &msm_device_iommu_mdp0, |
| 923 | &msm_device_iommu_mdp1, |
| 924 | &msm_device_iommu_rot, |
| 925 | &msm_device_iommu_ijpeg, |
| 926 | &msm_device_iommu_vfe, |
| 927 | &msm_device_iommu_vcodec_a, |
| 928 | &msm_device_iommu_vcodec_b, |
| 929 | &msm_device_iommu_gfx3d, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 930 | }; |
| 931 | |
| 932 | static struct platform_device *msm_iommu_gfx2d_devs[] = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 933 | &msm_device_iommu_gfx2d0, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 934 | &msm_device_iommu_gfx2d1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 935 | }; |
| 936 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 937 | static struct platform_device *msm_iommu_8064_devs[] = { |
| 938 | &msm_device_iommu_gfx3d1, |
| 939 | &msm_device_iommu_vcap, |
| 940 | }; |
| 941 | |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 942 | static struct platform_device *msm_iommu_jpegd_devs[] = { |
| 943 | &msm_device_iommu_jpegd, |
| 944 | }; |
| 945 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 946 | static struct platform_device *msm_iommu_common_ctx_devs[] = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 947 | &msm_device_vpe_src_ctx, |
| 948 | &msm_device_vpe_dst_ctx, |
| 949 | &msm_device_mdp_vg1_ctx, |
| 950 | &msm_device_mdp_rgb1_ctx, |
| 951 | &msm_device_mdp_vg2_ctx, |
| 952 | &msm_device_mdp_rgb2_ctx, |
| 953 | &msm_device_rot_src_ctx, |
| 954 | &msm_device_rot_dst_ctx, |
| 955 | &msm_device_ijpeg_src_ctx, |
| 956 | &msm_device_ijpeg_dst_ctx, |
| 957 | &msm_device_vfe_imgwr_ctx, |
| 958 | &msm_device_vfe_misc_ctx, |
| 959 | &msm_device_vcodec_a_stream_ctx, |
| 960 | &msm_device_vcodec_a_mm1_ctx, |
| 961 | &msm_device_vcodec_b_mm2_ctx, |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 962 | &msm_device_gfx3d_user_ctx, |
| 963 | &msm_device_gfx3d_priv_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 964 | }; |
| 965 | |
| 966 | static struct platform_device *msm_iommu_gfx2d_ctx_devs[] = { |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 967 | &msm_device_gfx2d0_2d0_ctx, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 968 | &msm_device_gfx2d1_2d1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 969 | }; |
| 970 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 971 | static struct platform_device *msm_iommu_8064_ctx_devs[] = { |
| 972 | &msm_device_gfx3d1_user_ctx, |
| 973 | &msm_device_gfx3d1_priv_ctx, |
| 974 | &msm_device_vcap_vc_ctx, |
| 975 | &msm_device_vcap_vp_ctx, |
| 976 | }; |
| 977 | |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 978 | static struct platform_device *msm_iommu_jpegd_ctx_devs[] = { |
| 979 | &msm_device_jpegd_src_ctx, |
| 980 | &msm_device_jpegd_dst_ctx, |
| 981 | }; |
| 982 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 983 | static int __init iommu_init(void) |
| 984 | { |
| 985 | int ret; |
Stepan Moskovchenko | 15f209c | 2011-10-31 15:32:44 -0700 | [diff] [blame] | 986 | if (!msm_soc_version_supports_iommu()) { |
Stepan Moskovchenko | 75f1e67 | 2011-10-21 19:49:44 -0700 | [diff] [blame] | 987 | pr_err("IOMMU is not supported on this SoC version.\n"); |
| 988 | return -ENODEV; |
| 989 | } |
| 990 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 991 | ret = platform_device_register(&msm_root_iommu_dev); |
| 992 | if (ret != 0) { |
| 993 | pr_err("Failed to register root IOMMU device!\n"); |
| 994 | goto failure; |
| 995 | } |
| 996 | |
| 997 | /* Initialize common devs */ |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 998 | platform_add_devices(msm_iommu_common_devs, |
| 999 | ARRAY_SIZE(msm_iommu_common_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1000 | |
| 1001 | /* Initialize soc-specific devs */ |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1002 | if (cpu_is_msm8x60() || cpu_is_msm8960()) { |
| 1003 | platform_add_devices(msm_iommu_jpegd_devs, |
| 1004 | ARRAY_SIZE(msm_iommu_jpegd_devs)); |
| 1005 | platform_add_devices(msm_iommu_gfx2d_devs, |
| 1006 | ARRAY_SIZE(msm_iommu_gfx2d_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1007 | } |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1008 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1009 | if (cpu_is_apq8064()) { |
| 1010 | platform_add_devices(msm_iommu_jpegd_devs, |
| 1011 | ARRAY_SIZE(msm_iommu_jpegd_devs)); |
| 1012 | platform_add_devices(msm_iommu_8064_devs, |
| 1013 | ARRAY_SIZE(msm_iommu_8064_devs)); |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 1014 | } |
| 1015 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1016 | /* Initialize common ctx_devs */ |
Stepan Moskovchenko | 6ca487f | 2012-03-13 18:12:29 -0700 | [diff] [blame] | 1017 | ret = platform_add_devices(msm_iommu_common_ctx_devs, |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1018 | ARRAY_SIZE(msm_iommu_common_ctx_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1019 | |
| 1020 | /* Initialize soc-specific ctx_devs */ |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1021 | if (cpu_is_msm8x60() || cpu_is_msm8960()) { |
| 1022 | platform_add_devices(msm_iommu_jpegd_ctx_devs, |
| 1023 | ARRAY_SIZE(msm_iommu_jpegd_ctx_devs)); |
| 1024 | platform_add_devices(msm_iommu_gfx2d_ctx_devs, |
| 1025 | ARRAY_SIZE(msm_iommu_gfx2d_ctx_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1026 | } |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1027 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1028 | if (cpu_is_apq8064()) { |
| 1029 | platform_add_devices(msm_iommu_jpegd_ctx_devs, |
| 1030 | ARRAY_SIZE(msm_iommu_jpegd_ctx_devs)); |
| 1031 | platform_add_devices(msm_iommu_8064_ctx_devs, |
| 1032 | ARRAY_SIZE(msm_iommu_8064_ctx_devs)); |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 1033 | } |
| 1034 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1035 | return 0; |
| 1036 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1037 | failure: |
| 1038 | return ret; |
| 1039 | } |
| 1040 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1041 | static void __exit iommu_exit(void) |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1042 | { |
| 1043 | int i; |
| 1044 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1045 | /* Common ctx_devs */ |
| 1046 | for (i = 0; i < ARRAY_SIZE(msm_iommu_common_ctx_devs); i++) |
| 1047 | platform_device_unregister(msm_iommu_common_ctx_devs[i]); |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1048 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1049 | /* Common devs. */ |
| 1050 | for (i = 0; i < ARRAY_SIZE(msm_iommu_common_devs); ++i) |
| 1051 | platform_device_unregister(msm_iommu_common_devs[i]); |
| 1052 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1053 | if (cpu_is_msm8x60() || cpu_is_msm8960()) { |
| 1054 | for (i = 0; i < ARRAY_SIZE(msm_iommu_gfx2d_ctx_devs); i++) |
| 1055 | platform_device_unregister(msm_iommu_gfx2d_ctx_devs[i]); |
| 1056 | |
| 1057 | for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_ctx_devs); i++) |
| 1058 | platform_device_unregister(msm_iommu_jpegd_ctx_devs[i]); |
| 1059 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1060 | for (i = 0; i < ARRAY_SIZE(msm_iommu_gfx2d_devs); i++) |
| 1061 | platform_device_unregister(msm_iommu_gfx2d_devs[i]); |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1062 | |
| 1063 | for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_devs); i++) |
| 1064 | platform_device_unregister(msm_iommu_jpegd_devs[i]); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1065 | } |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1066 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1067 | if (cpu_is_apq8064()) { |
| 1068 | for (i = 0; i < ARRAY_SIZE(msm_iommu_8064_ctx_devs); i++) |
| 1069 | platform_device_unregister(msm_iommu_8064_ctx_devs[i]); |
| 1070 | |
| 1071 | for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_ctx_devs); i++) |
| 1072 | platform_device_unregister(msm_iommu_jpegd_ctx_devs[i]); |
| 1073 | |
| 1074 | for (i = 0; i < ARRAY_SIZE(msm_iommu_8064_devs); i++) |
| 1075 | platform_device_unregister(msm_iommu_8064_devs[i]); |
| 1076 | |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 1077 | for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_devs); i++) |
| 1078 | platform_device_unregister(msm_iommu_jpegd_devs[i]); |
| 1079 | } |
| 1080 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1081 | platform_device_unregister(&msm_root_iommu_dev); |
| 1082 | } |
| 1083 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1084 | subsys_initcall(iommu_init); |
| 1085 | module_exit(iommu_exit); |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1086 | |
| 1087 | MODULE_LICENSE("GPL v2"); |
| 1088 | MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>"); |