18 #include <linux/kernel.h>
21 #include <linux/module.h>
22 #include <mach/irqs.h>
25 static struct resource msm_iommu_jpegd_resources[] = {
28 .end = 0x07300000 +
SZ_1M - 1,
33 .name =
"nonsecure_irq",
46 static struct resource msm_iommu_vpe_resources[] = {
49 .end = 0x07400000 +
SZ_1M - 1,
54 .name =
"nonsecure_irq",
67 static struct resource msm_iommu_mdp0_resources[] = {
70 .end = 0x07500000 +
SZ_1M - 1,
75 .name =
"nonsecure_irq",
88 static struct resource msm_iommu_mdp1_resources[] = {
91 .end = 0x07600000 +
SZ_1M - 1,
96 .name =
"nonsecure_irq",
102 .name =
"secure_irq",
109 static struct resource msm_iommu_rot_resources[] = {
112 .end = 0x07700000 +
SZ_1M - 1,
117 .name =
"nonsecure_irq",
123 .name =
"secure_irq",
130 static struct resource msm_iommu_ijpeg_resources[] = {
133 .end = 0x07800000 +
SZ_1M - 1,
138 .name =
"nonsecure_irq",
144 .name =
"secure_irq",
151 static struct resource msm_iommu_vfe_resources[] = {
154 .end = 0x07900000 +
SZ_1M - 1,
159 .name =
"nonsecure_irq",
165 .name =
"secure_irq",
172 static struct resource msm_iommu_vcodec_a_resources[] = {
175 .end = 0x07A00000 +
SZ_1M - 1,
180 .name =
"nonsecure_irq",
186 .name =
"secure_irq",
193 static struct resource msm_iommu_vcodec_b_resources[] = {
196 .end = 0x07B00000 +
SZ_1M - 1,
201 .name =
"nonsecure_irq",
207 .name =
"secure_irq",
214 static struct resource msm_iommu_gfx3d_resources[] = {
217 .end = 0x07C00000 +
SZ_1M - 1,
222 .name =
"nonsecure_irq",
228 .name =
"secure_irq",
235 static struct resource msm_iommu_gfx2d0_resources[] = {
238 .end = 0x07D00000 +
SZ_1M - 1,
243 .name =
"nonsecure_irq",
249 .name =
"secure_irq",
256 static struct resource msm_iommu_gfx2d1_resources[] = {
259 .end = 0x07E00000 +
SZ_1M - 1,
264 .name =
"nonsecure_irq",
270 .name =
"secure_irq",
346 .parent = &msm_root_iommu_dev.
dev,
348 .num_resources =
ARRAY_SIZE(msm_iommu_jpegd_resources),
349 .resource = msm_iommu_jpegd_resources,
356 .parent = &msm_root_iommu_dev.
dev,
358 .num_resources =
ARRAY_SIZE(msm_iommu_vpe_resources),
359 .resource = msm_iommu_vpe_resources,
366 .parent = &msm_root_iommu_dev.
dev,
368 .num_resources =
ARRAY_SIZE(msm_iommu_mdp0_resources),
369 .resource = msm_iommu_mdp0_resources,
376 .parent = &msm_root_iommu_dev.
dev,
378 .num_resources =
ARRAY_SIZE(msm_iommu_mdp1_resources),
379 .resource = msm_iommu_mdp1_resources,
386 .parent = &msm_root_iommu_dev.
dev,
388 .num_resources =
ARRAY_SIZE(msm_iommu_rot_resources),
389 .resource = msm_iommu_rot_resources,
396 .parent = &msm_root_iommu_dev.
dev,
398 .num_resources =
ARRAY_SIZE(msm_iommu_ijpeg_resources),
399 .resource = msm_iommu_ijpeg_resources,
406 .parent = &msm_root_iommu_dev.
dev,
408 .num_resources =
ARRAY_SIZE(msm_iommu_vfe_resources),
409 .resource = msm_iommu_vfe_resources,
416 .parent = &msm_root_iommu_dev.
dev,
418 .num_resources =
ARRAY_SIZE(msm_iommu_vcodec_a_resources),
419 .resource = msm_iommu_vcodec_a_resources,
426 .parent = &msm_root_iommu_dev.
dev,
428 .num_resources =
ARRAY_SIZE(msm_iommu_vcodec_b_resources),
429 .resource = msm_iommu_vcodec_b_resources,
436 .parent = &msm_root_iommu_dev.
dev,
438 .num_resources =
ARRAY_SIZE(msm_iommu_gfx3d_resources),
439 .resource = msm_iommu_gfx3d_resources,
446 .parent = &msm_root_iommu_dev.
dev,
448 .num_resources =
ARRAY_SIZE(msm_iommu_gfx2d0_resources),
449 .resource = msm_iommu_gfx2d0_resources,
456 .parent = &msm_root_iommu_dev.
dev,
458 .num_resources =
ARRAY_SIZE(msm_iommu_gfx2d1_resources),
459 .resource = msm_iommu_gfx2d1_resources,
495 .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1}
507 .mids = {1, 3, 4, 5, 6, 7, 8, 9, 10, -1}
537 .mids = {2, 3, 4, 5, 6, 7, 8, -1}
543 .mids = {0, 1, 9, -1}
547 .name =
"vcodec_a_stream",
553 .name =
"vcodec_a_mm1",
555 .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}
559 .name =
"vcodec_b_mm2",
561 .mids = {0, 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}
565 .name =
"gfx3d_user",
567 .mids = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}
571 .name =
"gfx3d_priv",
573 .mids = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
578 .name =
"gfx2d0_2d0",
580 .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1}
584 .name =
"gfx2d1_2d1",
586 .mids = {0, 1, 2, 3, 4, 5, 6, 7, -1}
590 .name =
"msm_iommu_ctx",
593 .parent = &msm_device_iommu_jpegd.
dev,
598 .name =
"msm_iommu_ctx",
601 .parent = &msm_device_iommu_jpegd.
dev,
606 .name =
"msm_iommu_ctx",
609 .parent = &msm_device_iommu_vpe.
dev,
614 .name =
"msm_iommu_ctx",
617 .parent = &msm_device_iommu_vpe.
dev,
622 .name =
"msm_iommu_ctx",
625 .parent = &msm_device_iommu_mdp0.
dev,
630 .name =
"msm_iommu_ctx",
633 .parent = &msm_device_iommu_mdp0.
dev,
638 .name =
"msm_iommu_ctx",
641 .parent = &msm_device_iommu_mdp1.
dev,
646 .name =
"msm_iommu_ctx",
649 .parent = &msm_device_iommu_mdp1.
dev,
654 .name =
"msm_iommu_ctx",
657 .parent = &msm_device_iommu_rot.
dev,
662 .name =
"msm_iommu_ctx",
665 .parent = &msm_device_iommu_rot.
dev,
670 .name =
"msm_iommu_ctx",
673 .parent = &msm_device_iommu_ijpeg.
dev,
678 .name =
"msm_iommu_ctx",
681 .parent = &msm_device_iommu_ijpeg.
dev,
686 .name =
"msm_iommu_ctx",
689 .parent = &msm_device_iommu_vfe.
dev,
694 .name =
"msm_iommu_ctx",
697 .parent = &msm_device_iommu_vfe.
dev,
702 .name =
"msm_iommu_ctx",
705 .parent = &msm_device_iommu_vcodec_a.
dev,
710 .name =
"msm_iommu_ctx",
713 .parent = &msm_device_iommu_vcodec_a.
dev,
718 .name =
"msm_iommu_ctx",
721 .parent = &msm_device_iommu_vcodec_b.
dev,
726 .name =
"msm_iommu_ctx",
729 .parent = &msm_device_iommu_gfx3d.
dev,
734 .name =
"msm_iommu_ctx",
737 .parent = &msm_device_iommu_gfx3d.
dev,
742 .name =
"msm_iommu_ctx",
745 .parent = &msm_device_iommu_gfx2d0.
dev,
750 .name =
"msm_iommu_ctx",
753 .parent = &msm_device_iommu_gfx2d1.
dev,
758 &msm_device_iommu_jpegd,
759 &msm_device_iommu_vpe,
760 &msm_device_iommu_mdp0,
761 &msm_device_iommu_mdp1,
762 &msm_device_iommu_rot,
763 &msm_device_iommu_ijpeg,
764 &msm_device_iommu_vfe,
765 &msm_device_iommu_vcodec_a,
766 &msm_device_iommu_vcodec_b,
767 &msm_device_iommu_gfx3d,
768 &msm_device_iommu_gfx2d0,
788 &msm_device_jpegd_src_ctx,
789 &msm_device_jpegd_dst_ctx,
790 &msm_device_vpe_src_ctx,
791 &msm_device_vpe_dst_ctx,
792 &msm_device_mdp_vg1_ctx,
793 &msm_device_mdp_rgb1_ctx,
794 &msm_device_mdp_vg2_ctx,
795 &msm_device_mdp_rgb2_ctx,
796 &msm_device_rot_src_ctx,
797 &msm_device_rot_dst_ctx,
798 &msm_device_ijpeg_src_ctx,
799 &msm_device_ijpeg_dst_ctx,
800 &msm_device_vfe_imgwr_ctx,
801 &msm_device_vfe_misc_ctx,
802 &msm_device_vcodec_a_stream_ctx,
803 &msm_device_vcodec_a_mm1_ctx,
804 &msm_device_vcodec_b_mm2_ctx,
805 &msm_device_gfx3d_user_ctx,
806 &msm_device_gfx3d_priv_ctx,
807 &msm_device_gfx2d0_2d0_ctx,
808 &msm_device_gfx2d1_2d1_ctx,
826 &vcodec_a_stream_ctx,
835 static int __init msm8x60_iommu_init(
void)
841 pr_err(
"Failed to register root IOMMU device!\n");
845 for (i = 0; i <
ARRAY_SIZE(msm_iommu_devs); i++) {
850 pr_err(
"platform_device_add_data failed, "
858 pr_err(
"platform_device_register iommu failed, "
864 for (i = 0; i <
ARRAY_SIZE(msm_iommu_ctx_devs); i++) {
866 msm_iommu_ctx_data[i],
867 sizeof(*msm_iommu_ctx_devs[i]));
869 pr_err(
"platform_device_add_data iommu failed, "
871 goto failure_unwind2;
876 pr_err(
"platform_device_register ctx failed, "
878 goto failure_unwind2;
895 static void __exit msm8x60_iommu_exit(
void)
899 for (i = 0; i <
ARRAY_SIZE(msm_iommu_ctx_devs); i++)