Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52680ec8 authored by Maya Erez's avatar Maya Erez
Browse files

msm_11ad: set geometry attr when SMMU stage1 is enabled



When SMMU stage1 is enabled, set IOVA base and end in geometry
attr to allow PCIe driver to map the GIC MSI address.

Change-Id: I7826a941823a6204143ea077a45c71b22316699b
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent 42ce0aa2
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -643,6 +643,9 @@ static int msm_11ad_smmu_init(struct msm11ad_ctx *ctx)
	int rc;
	int force_pt_coherent = 1;
	int smmu_bypass = !ctx->smmu_s1_en;
	dma_addr_t iova_base = 0;
	dma_addr_t iova_end =  ctx->smmu_base + ctx->smmu_size - 1;
	struct iommu_domain_geometry geometry;

	if (!ctx->use_smmu)
		return 0;
@@ -700,6 +703,17 @@ static int msm_11ad_smmu_init(struct msm11ad_ctx *ctx)
					rc);
				goto release_mapping;
			}
			memset(&geometry, 0, sizeof(geometry));
			geometry.aperture_start = iova_base;
			geometry.aperture_end = iova_end;
			rc = iommu_domain_set_attr(ctx->mapping->domain,
						   DOMAIN_ATTR_GEOMETRY,
						   &geometry);
			if (rc) {
				dev_err(ctx->dev, "Set geometry attribute to SMMU failed (%d)\n",
					rc);
				goto release_mapping;
			}
		}
	}