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