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, |
Shubhraprakash Das | 935e6a5 | 2012-04-05 14:47:30 -0600 | [diff] [blame] | 367 | .ttbr_split = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 368 | }; |
| 369 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 370 | static struct msm_iommu_dev gfx3d1_iommu = { |
| 371 | .name = "gfx3d1", |
| 372 | .ncb = 3, |
Shubhraprakash Das | 935e6a5 | 2012-04-05 14:47:30 -0600 | [diff] [blame] | 373 | .ttbr_split = 2, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 374 | }; |
| 375 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 376 | static struct msm_iommu_dev gfx2d0_iommu = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 377 | .name = "gfx2d0", |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 378 | .ncb = 2, |
Shubhraprakash Das | 5ff6352 | 2012-04-26 16:00:05 -0600 | [diff] [blame] | 379 | .ttbr_split = 2, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 380 | }; |
| 381 | |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 382 | static struct msm_iommu_dev gfx2d1_iommu = { |
| 383 | .name = "gfx2d1", |
Stepan Moskovchenko | a43d8c1 | 2011-02-24 18:00:42 -0800 | [diff] [blame] | 384 | .ncb = 2, |
Shubhraprakash Das | 5ff6352 | 2012-04-26 16:00:05 -0600 | [diff] [blame] | 385 | .ttbr_split = 2, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 386 | }; |
| 387 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 388 | static struct msm_iommu_dev vcap_iommu = { |
| 389 | .name = "vcap", |
| 390 | .ncb = 2, |
| 391 | }; |
| 392 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 393 | static struct platform_device msm_device_iommu_jpegd = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 394 | .name = "msm_iommu", |
| 395 | .id = 0, |
| 396 | .dev = { |
| 397 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 398 | .platform_data = &jpegd_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 399 | }, |
| 400 | .num_resources = ARRAY_SIZE(msm_iommu_jpegd_resources), |
| 401 | .resource = msm_iommu_jpegd_resources, |
| 402 | }; |
| 403 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 404 | static struct platform_device msm_device_iommu_vpe = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 405 | .name = "msm_iommu", |
| 406 | .id = 1, |
| 407 | .dev = { |
| 408 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 409 | .platform_data = &vpe_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 410 | }, |
| 411 | .num_resources = ARRAY_SIZE(msm_iommu_vpe_resources), |
| 412 | .resource = msm_iommu_vpe_resources, |
| 413 | }; |
| 414 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 415 | static struct platform_device msm_device_iommu_mdp0 = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 416 | .name = "msm_iommu", |
| 417 | .id = 2, |
| 418 | .dev = { |
| 419 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 420 | .platform_data = &mdp0_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 421 | }, |
| 422 | .num_resources = ARRAY_SIZE(msm_iommu_mdp0_resources), |
| 423 | .resource = msm_iommu_mdp0_resources, |
| 424 | }; |
| 425 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 426 | static struct platform_device msm_device_iommu_mdp1 = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 427 | .name = "msm_iommu", |
| 428 | .id = 3, |
| 429 | .dev = { |
| 430 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 431 | .platform_data = &mdp1_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 432 | }, |
| 433 | .num_resources = ARRAY_SIZE(msm_iommu_mdp1_resources), |
| 434 | .resource = msm_iommu_mdp1_resources, |
| 435 | }; |
| 436 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 437 | static struct platform_device msm_device_iommu_rot = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 438 | .name = "msm_iommu", |
| 439 | .id = 4, |
| 440 | .dev = { |
| 441 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 442 | .platform_data = &rot_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 443 | }, |
| 444 | .num_resources = ARRAY_SIZE(msm_iommu_rot_resources), |
| 445 | .resource = msm_iommu_rot_resources, |
| 446 | }; |
| 447 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 448 | static struct platform_device msm_device_iommu_ijpeg = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 449 | .name = "msm_iommu", |
| 450 | .id = 5, |
| 451 | .dev = { |
| 452 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 453 | .platform_data = &ijpeg_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 454 | }, |
| 455 | .num_resources = ARRAY_SIZE(msm_iommu_ijpeg_resources), |
| 456 | .resource = msm_iommu_ijpeg_resources, |
| 457 | }; |
| 458 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 459 | static struct platform_device msm_device_iommu_vfe = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 460 | .name = "msm_iommu", |
| 461 | .id = 6, |
| 462 | .dev = { |
| 463 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 464 | .platform_data = &vfe_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 465 | }, |
| 466 | .num_resources = ARRAY_SIZE(msm_iommu_vfe_resources), |
| 467 | .resource = msm_iommu_vfe_resources, |
| 468 | }; |
| 469 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 470 | static struct platform_device msm_device_iommu_vcodec_a = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 471 | .name = "msm_iommu", |
| 472 | .id = 7, |
| 473 | .dev = { |
| 474 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 475 | .platform_data = &vcodec_a_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 476 | }, |
| 477 | .num_resources = ARRAY_SIZE(msm_iommu_vcodec_a_resources), |
| 478 | .resource = msm_iommu_vcodec_a_resources, |
| 479 | }; |
| 480 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 481 | static struct platform_device msm_device_iommu_vcodec_b = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 482 | .name = "msm_iommu", |
| 483 | .id = 8, |
| 484 | .dev = { |
| 485 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 486 | .platform_data = &vcodec_b_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 487 | }, |
| 488 | .num_resources = ARRAY_SIZE(msm_iommu_vcodec_b_resources), |
| 489 | .resource = msm_iommu_vcodec_b_resources, |
| 490 | }; |
| 491 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 492 | static struct platform_device msm_device_iommu_gfx3d = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 493 | .name = "msm_iommu", |
| 494 | .id = 9, |
| 495 | .dev = { |
| 496 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 497 | .platform_data = &gfx3d_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 498 | }, |
| 499 | .num_resources = ARRAY_SIZE(msm_iommu_gfx3d_resources), |
| 500 | .resource = msm_iommu_gfx3d_resources, |
| 501 | }; |
| 502 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 503 | static struct platform_device msm_device_iommu_gfx3d1 = { |
| 504 | .name = "msm_iommu", |
| 505 | .id = 10, |
| 506 | .dev = { |
| 507 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 508 | .platform_data = &gfx3d1_iommu, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 509 | }, |
| 510 | .num_resources = ARRAY_SIZE(msm_iommu_gfx3d1_resources), |
| 511 | .resource = msm_iommu_gfx3d1_resources, |
| 512 | }; |
| 513 | |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 514 | static struct platform_device msm_device_iommu_gfx2d0 = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 515 | .name = "msm_iommu", |
| 516 | .id = 10, |
| 517 | .dev = { |
| 518 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 519 | .platform_data = &gfx2d0_iommu, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 520 | }, |
| 521 | .num_resources = ARRAY_SIZE(msm_iommu_gfx2d0_resources), |
| 522 | .resource = msm_iommu_gfx2d0_resources, |
| 523 | }; |
| 524 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 525 | static struct platform_device msm_device_iommu_gfx2d1 = { |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 526 | .name = "msm_iommu", |
| 527 | .id = 11, |
| 528 | .dev = { |
| 529 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 530 | .platform_data = &gfx2d1_iommu, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 531 | }, |
| 532 | .num_resources = ARRAY_SIZE(msm_iommu_gfx2d1_resources), |
| 533 | .resource = msm_iommu_gfx2d1_resources, |
| 534 | }; |
| 535 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 536 | static struct platform_device msm_device_iommu_vcap = { |
| 537 | .name = "msm_iommu", |
| 538 | .id = 11, |
| 539 | .dev = { |
| 540 | .parent = &msm_root_iommu_dev.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 541 | .platform_data = &vcap_iommu, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 542 | }, |
| 543 | .num_resources = ARRAY_SIZE(msm_iommu_vcap_resources), |
| 544 | .resource = msm_iommu_vcap_resources, |
| 545 | }; |
| 546 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 547 | static struct msm_iommu_ctx_dev jpegd_src_ctx = { |
| 548 | .name = "jpegd_src", |
| 549 | .num = 0, |
| 550 | .mids = {0, -1} |
| 551 | }; |
| 552 | |
| 553 | static struct msm_iommu_ctx_dev jpegd_dst_ctx = { |
| 554 | .name = "jpegd_dst", |
| 555 | .num = 1, |
| 556 | .mids = {1, -1} |
| 557 | }; |
| 558 | |
| 559 | static struct msm_iommu_ctx_dev vpe_src_ctx = { |
| 560 | .name = "vpe_src", |
| 561 | .num = 0, |
| 562 | .mids = {0, -1} |
| 563 | }; |
| 564 | |
| 565 | static struct msm_iommu_ctx_dev vpe_dst_ctx = { |
| 566 | .name = "vpe_dst", |
| 567 | .num = 1, |
| 568 | .mids = {1, -1} |
| 569 | }; |
| 570 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 571 | static struct msm_iommu_ctx_dev mdp_port0_cb0_ctx = { |
| 572 | .name = "mdp_port0_cb0", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 573 | .num = 0, |
| 574 | .mids = {0, 2, -1} |
| 575 | }; |
| 576 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 577 | static struct msm_iommu_ctx_dev mdp_port0_cb1_ctx = { |
| 578 | .name = "mdp_port0_cb1", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 579 | .num = 1, |
| 580 | .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1} |
| 581 | }; |
| 582 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 583 | static struct msm_iommu_ctx_dev mdp_port1_cb0_ctx = { |
| 584 | .name = "mdp_port1_cb0", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 585 | .num = 0, |
| 586 | .mids = {0, 2, -1} |
| 587 | }; |
| 588 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 589 | static struct msm_iommu_ctx_dev mdp_port1_cb1_ctx = { |
| 590 | .name = "mdp_port1_cb1", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 591 | .num = 1, |
| 592 | .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1} |
| 593 | }; |
| 594 | |
| 595 | static struct msm_iommu_ctx_dev rot_src_ctx = { |
| 596 | .name = "rot_src", |
| 597 | .num = 0, |
| 598 | .mids = {0, -1} |
| 599 | }; |
| 600 | |
| 601 | static struct msm_iommu_ctx_dev rot_dst_ctx = { |
| 602 | .name = "rot_dst", |
| 603 | .num = 1, |
| 604 | .mids = {1, -1} |
| 605 | }; |
| 606 | |
| 607 | static struct msm_iommu_ctx_dev ijpeg_src_ctx = { |
| 608 | .name = "ijpeg_src", |
| 609 | .num = 0, |
| 610 | .mids = {0, -1} |
| 611 | }; |
| 612 | |
| 613 | static struct msm_iommu_ctx_dev ijpeg_dst_ctx = { |
| 614 | .name = "ijpeg_dst", |
| 615 | .num = 1, |
| 616 | .mids = {1, -1} |
| 617 | }; |
| 618 | |
| 619 | static struct msm_iommu_ctx_dev vfe_imgwr_ctx = { |
| 620 | .name = "vfe_imgwr", |
| 621 | .num = 0, |
| 622 | .mids = {2, 3, 4, 5, 6, 7, 8, -1} |
| 623 | }; |
| 624 | |
| 625 | static struct msm_iommu_ctx_dev vfe_misc_ctx = { |
| 626 | .name = "vfe_misc", |
| 627 | .num = 1, |
| 628 | .mids = {0, 1, 9, -1} |
| 629 | }; |
| 630 | |
| 631 | static struct msm_iommu_ctx_dev vcodec_a_stream_ctx = { |
| 632 | .name = "vcodec_a_stream", |
| 633 | .num = 0, |
| 634 | .mids = {2, 5, -1} |
| 635 | }; |
| 636 | |
| 637 | static struct msm_iommu_ctx_dev vcodec_a_mm1_ctx = { |
| 638 | .name = "vcodec_a_mm1", |
| 639 | .num = 1, |
| 640 | .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1} |
| 641 | }; |
| 642 | |
| 643 | static struct msm_iommu_ctx_dev vcodec_b_mm2_ctx = { |
| 644 | .name = "vcodec_b_mm2", |
| 645 | .num = 0, |
| 646 | .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1} |
| 647 | }; |
| 648 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 649 | static struct msm_iommu_ctx_dev gfx3d_user_ctx = { |
| 650 | .name = "gfx3d_user", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 651 | .num = 0, |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 652 | .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] | 653 | }; |
| 654 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 655 | static struct msm_iommu_ctx_dev gfx3d_priv_ctx = { |
| 656 | .name = "gfx3d_priv", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 657 | .num = 1, |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 658 | .mids = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, |
| 659 | 31, -1} |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 660 | }; |
| 661 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 662 | static struct msm_iommu_ctx_dev gfx3d1_user_ctx = { |
| 663 | .name = "gfx3d1_user", |
| 664 | .num = 0, |
| 665 | .mids = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1} |
| 666 | }; |
| 667 | |
| 668 | static struct msm_iommu_ctx_dev gfx3d1_priv_ctx = { |
| 669 | .name = "gfx3d1_priv", |
| 670 | .num = 1, |
| 671 | .mids = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, |
| 672 | 31, -1} |
| 673 | }; |
| 674 | |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 675 | static struct msm_iommu_ctx_dev gfx2d0_2d0_ctx = { |
| 676 | .name = "gfx2d0_2d0", |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 677 | .num = 0, |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 678 | .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1} |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 679 | }; |
| 680 | |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 681 | static struct msm_iommu_ctx_dev gfx2d1_2d1_ctx = { |
| 682 | .name = "gfx2d1_2d1", |
| 683 | .num = 0, |
| 684 | .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1} |
| 685 | }; |
| 686 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 687 | static struct msm_iommu_ctx_dev vcap_vc_ctx = { |
| 688 | .name = "vcap_vc", |
| 689 | .num = 0, |
| 690 | .mids = {0, -1} |
| 691 | }; |
| 692 | |
| 693 | static struct msm_iommu_ctx_dev vcap_vp_ctx = { |
| 694 | .name = "vcap_vp", |
| 695 | .num = 1, |
| 696 | .mids = {1, -1} |
| 697 | }; |
| 698 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 699 | static struct platform_device msm_device_jpegd_src_ctx = { |
| 700 | .name = "msm_iommu_ctx", |
| 701 | .id = 0, |
| 702 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 703 | .parent = &msm_device_iommu_jpegd.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 704 | .platform_data = &jpegd_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 705 | }, |
| 706 | }; |
| 707 | |
| 708 | static struct platform_device msm_device_jpegd_dst_ctx = { |
| 709 | .name = "msm_iommu_ctx", |
| 710 | .id = 1, |
| 711 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 712 | .parent = &msm_device_iommu_jpegd.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 713 | .platform_data = &jpegd_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 714 | }, |
| 715 | }; |
| 716 | |
| 717 | static struct platform_device msm_device_vpe_src_ctx = { |
| 718 | .name = "msm_iommu_ctx", |
| 719 | .id = 2, |
| 720 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 721 | .parent = &msm_device_iommu_vpe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 722 | .platform_data = &vpe_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 723 | }, |
| 724 | }; |
| 725 | |
| 726 | static struct platform_device msm_device_vpe_dst_ctx = { |
| 727 | .name = "msm_iommu_ctx", |
| 728 | .id = 3, |
| 729 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 730 | .parent = &msm_device_iommu_vpe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 731 | .platform_data = &vpe_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 732 | }, |
| 733 | }; |
| 734 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 735 | static struct platform_device msm_device_mdp_port0_cb0_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 736 | .name = "msm_iommu_ctx", |
| 737 | .id = 4, |
| 738 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 739 | .parent = &msm_device_iommu_mdp0.dev, |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 740 | .platform_data = &mdp_port0_cb0_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 741 | }, |
| 742 | }; |
| 743 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 744 | static struct platform_device msm_device_mdp_port0_cb1_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 745 | .name = "msm_iommu_ctx", |
| 746 | .id = 5, |
| 747 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 748 | .parent = &msm_device_iommu_mdp0.dev, |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 749 | .platform_data = &mdp_port0_cb1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 750 | }, |
| 751 | }; |
| 752 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 753 | static struct platform_device msm_device_mdp_port1_cb0_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 754 | .name = "msm_iommu_ctx", |
| 755 | .id = 6, |
| 756 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 757 | .parent = &msm_device_iommu_mdp1.dev, |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 758 | .platform_data = &mdp_port1_cb0_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 759 | }, |
| 760 | }; |
| 761 | |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 762 | static struct platform_device msm_device_mdp_port1_cb1_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 763 | .name = "msm_iommu_ctx", |
| 764 | .id = 7, |
| 765 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 766 | .parent = &msm_device_iommu_mdp1.dev, |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 767 | .platform_data = &mdp_port1_cb1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 768 | }, |
| 769 | }; |
| 770 | |
| 771 | static struct platform_device msm_device_rot_src_ctx = { |
| 772 | .name = "msm_iommu_ctx", |
| 773 | .id = 8, |
| 774 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 775 | .parent = &msm_device_iommu_rot.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 776 | .platform_data = &rot_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 777 | }, |
| 778 | }; |
| 779 | |
| 780 | static struct platform_device msm_device_rot_dst_ctx = { |
| 781 | .name = "msm_iommu_ctx", |
| 782 | .id = 9, |
| 783 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 784 | .parent = &msm_device_iommu_rot.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 785 | .platform_data = &rot_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 786 | }, |
| 787 | }; |
| 788 | |
| 789 | static struct platform_device msm_device_ijpeg_src_ctx = { |
| 790 | .name = "msm_iommu_ctx", |
| 791 | .id = 10, |
| 792 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 793 | .parent = &msm_device_iommu_ijpeg.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 794 | .platform_data = &ijpeg_src_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 795 | }, |
| 796 | }; |
| 797 | |
| 798 | static struct platform_device msm_device_ijpeg_dst_ctx = { |
| 799 | .name = "msm_iommu_ctx", |
| 800 | .id = 11, |
| 801 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 802 | .parent = &msm_device_iommu_ijpeg.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 803 | .platform_data = &ijpeg_dst_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 804 | }, |
| 805 | }; |
| 806 | |
| 807 | static struct platform_device msm_device_vfe_imgwr_ctx = { |
| 808 | .name = "msm_iommu_ctx", |
| 809 | .id = 12, |
| 810 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 811 | .parent = &msm_device_iommu_vfe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 812 | .platform_data = &vfe_imgwr_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 813 | }, |
| 814 | }; |
| 815 | |
| 816 | static struct platform_device msm_device_vfe_misc_ctx = { |
| 817 | .name = "msm_iommu_ctx", |
| 818 | .id = 13, |
| 819 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 820 | .parent = &msm_device_iommu_vfe.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 821 | .platform_data = &vfe_misc_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 822 | }, |
| 823 | }; |
| 824 | |
| 825 | static struct platform_device msm_device_vcodec_a_stream_ctx = { |
| 826 | .name = "msm_iommu_ctx", |
| 827 | .id = 14, |
| 828 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 829 | .parent = &msm_device_iommu_vcodec_a.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 830 | .platform_data = &vcodec_a_stream_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 831 | }, |
| 832 | }; |
| 833 | |
| 834 | static struct platform_device msm_device_vcodec_a_mm1_ctx = { |
| 835 | .name = "msm_iommu_ctx", |
| 836 | .id = 15, |
| 837 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 838 | .parent = &msm_device_iommu_vcodec_a.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 839 | .platform_data = &vcodec_a_mm1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 840 | }, |
| 841 | }; |
| 842 | |
| 843 | static struct platform_device msm_device_vcodec_b_mm2_ctx = { |
| 844 | .name = "msm_iommu_ctx", |
| 845 | .id = 16, |
| 846 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 847 | .parent = &msm_device_iommu_vcodec_b.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 848 | .platform_data = &vcodec_b_mm2_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 849 | }, |
| 850 | }; |
| 851 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 852 | static struct platform_device msm_device_gfx3d_user_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 853 | .name = "msm_iommu_ctx", |
| 854 | .id = 17, |
| 855 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 856 | .parent = &msm_device_iommu_gfx3d.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 857 | .platform_data = &gfx3d_user_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 858 | }, |
| 859 | }; |
| 860 | |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 861 | static struct platform_device msm_device_gfx3d_priv_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 862 | .name = "msm_iommu_ctx", |
| 863 | .id = 18, |
| 864 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 865 | .parent = &msm_device_iommu_gfx3d.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 866 | .platform_data = &gfx3d_priv_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 867 | }, |
| 868 | }; |
| 869 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 870 | static struct platform_device msm_device_gfx3d1_user_ctx = { |
| 871 | .name = "msm_iommu_ctx", |
| 872 | .id = 19, |
| 873 | .dev = { |
| 874 | .parent = &msm_device_iommu_gfx3d1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 875 | .platform_data = &gfx3d1_user_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 876 | }, |
| 877 | }; |
| 878 | |
| 879 | static struct platform_device msm_device_gfx3d1_priv_ctx = { |
| 880 | .name = "msm_iommu_ctx", |
| 881 | .id = 20, |
| 882 | .dev = { |
| 883 | .parent = &msm_device_iommu_gfx3d1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 884 | .platform_data = &gfx3d1_priv_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 885 | }, |
| 886 | }; |
| 887 | |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 888 | static struct platform_device msm_device_gfx2d0_2d0_ctx = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 889 | .name = "msm_iommu_ctx", |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 890 | .id = 19, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 891 | .dev = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 892 | .parent = &msm_device_iommu_gfx2d0.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 893 | .platform_data = &gfx2d0_2d0_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 894 | }, |
| 895 | }; |
| 896 | |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 897 | static struct platform_device msm_device_gfx2d1_2d1_ctx = { |
| 898 | .name = "msm_iommu_ctx", |
| 899 | .id = 20, |
| 900 | .dev = { |
| 901 | .parent = &msm_device_iommu_gfx2d1.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 902 | .platform_data = &gfx2d1_2d1_ctx, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 903 | }, |
| 904 | }; |
| 905 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 906 | static struct platform_device msm_device_vcap_vc_ctx = { |
| 907 | .name = "msm_iommu_ctx", |
| 908 | .id = 21, |
| 909 | .dev = { |
| 910 | .parent = &msm_device_iommu_vcap.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 911 | .platform_data = &vcap_vc_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 912 | }, |
| 913 | }; |
| 914 | |
| 915 | static struct platform_device msm_device_vcap_vp_ctx = { |
| 916 | .name = "msm_iommu_ctx", |
| 917 | .id = 22, |
| 918 | .dev = { |
| 919 | .parent = &msm_device_iommu_vcap.dev, |
Stepan Moskovchenko | 8eea941 | 2012-03-13 17:58:13 -0700 | [diff] [blame] | 920 | .platform_data = &vcap_vp_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 921 | }, |
| 922 | }; |
| 923 | |
| 924 | static struct platform_device *msm_iommu_common_devs[] = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 925 | &msm_device_iommu_vpe, |
| 926 | &msm_device_iommu_mdp0, |
| 927 | &msm_device_iommu_mdp1, |
| 928 | &msm_device_iommu_rot, |
| 929 | &msm_device_iommu_ijpeg, |
| 930 | &msm_device_iommu_vfe, |
| 931 | &msm_device_iommu_vcodec_a, |
| 932 | &msm_device_iommu_vcodec_b, |
| 933 | &msm_device_iommu_gfx3d, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 934 | }; |
| 935 | |
| 936 | static struct platform_device *msm_iommu_gfx2d_devs[] = { |
Stepan Moskovchenko | 1294332 | 2010-11-12 19:29:49 -0800 | [diff] [blame] | 937 | &msm_device_iommu_gfx2d0, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 938 | &msm_device_iommu_gfx2d1, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 939 | }; |
| 940 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 941 | static struct platform_device *msm_iommu_8064_devs[] = { |
| 942 | &msm_device_iommu_gfx3d1, |
| 943 | &msm_device_iommu_vcap, |
| 944 | }; |
| 945 | |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 946 | static struct platform_device *msm_iommu_jpegd_devs[] = { |
| 947 | &msm_device_iommu_jpegd, |
| 948 | }; |
| 949 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 950 | static struct platform_device *msm_iommu_common_ctx_devs[] = { |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 951 | &msm_device_vpe_src_ctx, |
| 952 | &msm_device_vpe_dst_ctx, |
Ravishangar Kalyanam | e9658eb | 2012-05-15 14:58:55 -0700 | [diff] [blame] | 953 | &msm_device_mdp_port0_cb0_ctx, |
| 954 | &msm_device_mdp_port0_cb1_ctx, |
| 955 | &msm_device_mdp_port1_cb0_ctx, |
| 956 | &msm_device_mdp_port1_cb1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 957 | &msm_device_rot_src_ctx, |
| 958 | &msm_device_rot_dst_ctx, |
| 959 | &msm_device_ijpeg_src_ctx, |
| 960 | &msm_device_ijpeg_dst_ctx, |
| 961 | &msm_device_vfe_imgwr_ctx, |
| 962 | &msm_device_vfe_misc_ctx, |
| 963 | &msm_device_vcodec_a_stream_ctx, |
| 964 | &msm_device_vcodec_a_mm1_ctx, |
| 965 | &msm_device_vcodec_b_mm2_ctx, |
Stepan Moskovchenko | a5fcd5f | 2010-11-12 19:29:50 -0800 | [diff] [blame] | 966 | &msm_device_gfx3d_user_ctx, |
| 967 | &msm_device_gfx3d_priv_ctx, |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 968 | }; |
| 969 | |
| 970 | static struct platform_device *msm_iommu_gfx2d_ctx_devs[] = { |
Stepan Moskovchenko | ff25ff8 | 2010-11-12 19:29:51 -0800 | [diff] [blame] | 971 | &msm_device_gfx2d0_2d0_ctx, |
Stepan Moskovchenko | e8952e3 | 2010-11-12 19:29:52 -0800 | [diff] [blame] | 972 | &msm_device_gfx2d1_2d1_ctx, |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 973 | }; |
| 974 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 975 | static struct platform_device *msm_iommu_8064_ctx_devs[] = { |
| 976 | &msm_device_gfx3d1_user_ctx, |
| 977 | &msm_device_gfx3d1_priv_ctx, |
| 978 | &msm_device_vcap_vc_ctx, |
| 979 | &msm_device_vcap_vp_ctx, |
| 980 | }; |
| 981 | |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 982 | static struct platform_device *msm_iommu_jpegd_ctx_devs[] = { |
| 983 | &msm_device_jpegd_src_ctx, |
| 984 | &msm_device_jpegd_dst_ctx, |
| 985 | }; |
| 986 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 987 | static int __init iommu_init(void) |
| 988 | { |
| 989 | int ret; |
Sathish Ambley | d1b89ed | 2012-02-07 21:47:47 -0800 | [diff] [blame] | 990 | if (!msm_soc_version_supports_iommu_v1()) { |
| 991 | pr_err("IOMMU v1 is not supported on this SoC version.\n"); |
Stepan Moskovchenko | 75f1e67 | 2011-10-21 19:49:44 -0700 | [diff] [blame] | 992 | return -ENODEV; |
| 993 | } |
| 994 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 995 | ret = platform_device_register(&msm_root_iommu_dev); |
| 996 | if (ret != 0) { |
| 997 | pr_err("Failed to register root IOMMU device!\n"); |
| 998 | goto failure; |
| 999 | } |
| 1000 | |
| 1001 | /* Initialize common devs */ |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1002 | platform_add_devices(msm_iommu_common_devs, |
| 1003 | ARRAY_SIZE(msm_iommu_common_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1004 | |
| 1005 | /* Initialize soc-specific devs */ |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1006 | if (cpu_is_msm8x60() || cpu_is_msm8960()) { |
| 1007 | platform_add_devices(msm_iommu_jpegd_devs, |
| 1008 | ARRAY_SIZE(msm_iommu_jpegd_devs)); |
| 1009 | platform_add_devices(msm_iommu_gfx2d_devs, |
| 1010 | ARRAY_SIZE(msm_iommu_gfx2d_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1011 | } |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1012 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1013 | if (cpu_is_apq8064()) { |
| 1014 | platform_add_devices(msm_iommu_jpegd_devs, |
| 1015 | ARRAY_SIZE(msm_iommu_jpegd_devs)); |
| 1016 | platform_add_devices(msm_iommu_8064_devs, |
| 1017 | ARRAY_SIZE(msm_iommu_8064_devs)); |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 1018 | } |
| 1019 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1020 | /* Initialize common ctx_devs */ |
Stepan Moskovchenko | 6ca487f | 2012-03-13 18:12:29 -0700 | [diff] [blame] | 1021 | ret = platform_add_devices(msm_iommu_common_ctx_devs, |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1022 | ARRAY_SIZE(msm_iommu_common_ctx_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1023 | |
| 1024 | /* Initialize soc-specific ctx_devs */ |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1025 | if (cpu_is_msm8x60() || cpu_is_msm8960()) { |
| 1026 | platform_add_devices(msm_iommu_jpegd_ctx_devs, |
| 1027 | ARRAY_SIZE(msm_iommu_jpegd_ctx_devs)); |
| 1028 | platform_add_devices(msm_iommu_gfx2d_ctx_devs, |
| 1029 | ARRAY_SIZE(msm_iommu_gfx2d_ctx_devs)); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1030 | } |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1031 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1032 | if (cpu_is_apq8064()) { |
| 1033 | platform_add_devices(msm_iommu_jpegd_ctx_devs, |
| 1034 | ARRAY_SIZE(msm_iommu_jpegd_ctx_devs)); |
| 1035 | platform_add_devices(msm_iommu_8064_ctx_devs, |
| 1036 | ARRAY_SIZE(msm_iommu_8064_ctx_devs)); |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 1037 | } |
| 1038 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1039 | return 0; |
| 1040 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1041 | failure: |
| 1042 | return ret; |
| 1043 | } |
| 1044 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1045 | static void __exit iommu_exit(void) |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1046 | { |
| 1047 | int i; |
| 1048 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1049 | /* Common ctx_devs */ |
| 1050 | for (i = 0; i < ARRAY_SIZE(msm_iommu_common_ctx_devs); i++) |
| 1051 | platform_device_unregister(msm_iommu_common_ctx_devs[i]); |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1052 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1053 | /* Common devs. */ |
| 1054 | for (i = 0; i < ARRAY_SIZE(msm_iommu_common_devs); ++i) |
| 1055 | platform_device_unregister(msm_iommu_common_devs[i]); |
| 1056 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1057 | if (cpu_is_msm8x60() || cpu_is_msm8960()) { |
| 1058 | for (i = 0; i < ARRAY_SIZE(msm_iommu_gfx2d_ctx_devs); i++) |
| 1059 | platform_device_unregister(msm_iommu_gfx2d_ctx_devs[i]); |
| 1060 | |
| 1061 | for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_ctx_devs); i++) |
| 1062 | platform_device_unregister(msm_iommu_jpegd_ctx_devs[i]); |
| 1063 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1064 | for (i = 0; i < ARRAY_SIZE(msm_iommu_gfx2d_devs); i++) |
| 1065 | platform_device_unregister(msm_iommu_gfx2d_devs[i]); |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1066 | |
| 1067 | for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_devs); i++) |
| 1068 | platform_device_unregister(msm_iommu_jpegd_devs[i]); |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1069 | } |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1070 | |
Stepan Moskovchenko | 04f7d05 | 2012-03-22 13:33:48 -0700 | [diff] [blame] | 1071 | if (cpu_is_apq8064()) { |
| 1072 | for (i = 0; i < ARRAY_SIZE(msm_iommu_8064_ctx_devs); i++) |
| 1073 | platform_device_unregister(msm_iommu_8064_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 | |
| 1078 | for (i = 0; i < ARRAY_SIZE(msm_iommu_8064_devs); i++) |
| 1079 | platform_device_unregister(msm_iommu_8064_devs[i]); |
| 1080 | |
Stepan Moskovchenko | 0951b8c | 2012-03-13 19:02:04 -0700 | [diff] [blame] | 1081 | for (i = 0; i < ARRAY_SIZE(msm_iommu_jpegd_devs); i++) |
| 1082 | platform_device_unregister(msm_iommu_jpegd_devs[i]); |
| 1083 | } |
| 1084 | |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1085 | platform_device_unregister(&msm_root_iommu_dev); |
| 1086 | } |
| 1087 | |
Joel King | 41d594e | 2011-10-14 13:18:20 -0700 | [diff] [blame] | 1088 | subsys_initcall(iommu_init); |
| 1089 | module_exit(iommu_exit); |
Stepan Moskovchenko | d9c8279 | 2010-08-24 19:51:15 -0700 | [diff] [blame] | 1090 | |
| 1091 | MODULE_LICENSE("GPL v2"); |
| 1092 | MODULE_AUTHOR("Stepan Moskovchenko <stepanm@codeaurora.org>"); |