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