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

Commit c544f44c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Enable SMMU stage 1 for Slimbus driver on atoll"

parents 04bf08e5 b9f41de1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ Optional property:
		 can be resumed after subsytem restart. By default slimbus driver
		 register with ADSP subsystem.
 - qcom,iommu-s1-bypass: Boolean flag to bypass IOMMU stage 1 translation.
 - qcom,iommu-atomic-ctx: Boolean flag to enable IOMMU in atomic context

Optional subnodes:
qcom,iommu_slim_ctrl_cb : Child node representing the Slimbus controller
+1 −1
Original line number Diff line number Diff line
@@ -3056,7 +3056,7 @@
		interrupt-names = "slimbus_irq", "slimbus_bam_irq";
		qcom,apps-ch-pipes = <0x700000>;
		qcom,ea-pc = <0x340>;
		qcom,iommu-s1-bypass;
		qcom,iommu-atomic-ctx;
		status = "ok";

		iommu_slim_aud_ctrl_cb: qcom,iommu_slim_ctrl_cb {
+3 −0
Original line number Diff line number Diff line
@@ -1881,6 +1881,9 @@ static int ngd_slim_probe(struct platform_device *pdev)
		dev->iommu_desc.s1_bypass = of_property_read_bool(
							pdev->dev.of_node,
							"qcom,iommu-s1-bypass");
		dev->iommu_desc.atomic_ctx = of_property_read_bool(
							pdev->dev.of_node,
							"qcom,iommu-atomic-ctx");
		ret = of_platform_populate(pdev->dev.of_node, ngd_slim_dt_match,
					   NULL, &pdev->dev);
		if (ret) {
+12 −10
Original line number Diff line number Diff line
/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -173,7 +173,7 @@ static int msm_slim_iommu_attach(struct msm_slim_ctrl *ctrl_dev)
	struct dma_iommu_mapping *iommu_map;
	dma_addr_t va_start = MSM_SLIM_VA_START;
	size_t va_size = MSM_SLIM_VA_SIZE;
	int bypass = 1;
	int bypass = 1, atomic_ctx = 1;
	struct device *dev;

	if (unlikely(!ctrl_dev))
@@ -197,15 +197,17 @@ static int msm_slim_iommu_attach(struct msm_slim_ctrl *ctrl_dev)
		return PTR_ERR(iommu_map);
	}

	if (ctrl_dev->iommu_desc.s1_bypass) {
		if (iommu_domain_set_attr(iommu_map->domain,
					DOMAIN_ATTR_S1_BYPASS, &bypass)) {
			dev_err(dev, "%s Can't bypass s1 translation\n",
	if ((ctrl_dev->iommu_desc.s1_bypass &&
			iommu_domain_set_attr(iommu_map->domain,
				DOMAIN_ATTR_S1_BYPASS, &bypass)) ||
		(ctrl_dev->iommu_desc.atomic_ctx &&
			iommu_domain_set_attr(iommu_map->domain,
				DOMAIN_ATTR_ATOMIC, &atomic_ctx))) {
		dev_err(dev, "%s Can't set IOMMU attribute\n",
			__func__);
		arm_iommu_release_mapping(iommu_map);
		return -EIO;
	}
	}

	if (arm_iommu_attach_device(dev, iommu_map)) {
		dev_err(dev, "%s can't arm_iommu_attach_device\n", __func__);
+1 −0
Original line number Diff line number Diff line
@@ -266,6 +266,7 @@ struct msm_slim_iommu {
	struct device			*cb_dev;
	struct dma_iommu_mapping	*iommu_map;
	bool				s1_bypass;
	bool				atomic_ctx;
};

struct msm_slim_ctrl {