Loading Documentation/devicetree/bindings/slimbus/slim-msm-ctrl.txt +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading arch/arm64/boot/dts/qcom/atoll.dtsi +1 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading drivers/slimbus/slim-msm-ngd.c +3 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading drivers/slimbus/slim-msm.c +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 Loading Loading @@ -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)) Loading @@ -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__); Loading drivers/slimbus/slim-msm.h +1 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading
Documentation/devicetree/bindings/slimbus/slim-msm-ctrl.txt +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
arch/arm64/boot/dts/qcom/atoll.dtsi +1 −1 Original line number Diff line number Diff line Loading @@ -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 { Loading
drivers/slimbus/slim-msm-ngd.c +3 −0 Original line number Diff line number Diff line Loading @@ -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) { Loading
drivers/slimbus/slim-msm.c +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 Loading Loading @@ -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)) Loading @@ -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__); Loading
drivers/slimbus/slim-msm.h +1 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading