Loading Documentation/devicetree/bindings/cnss/cnss-wlan.txt +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ Optional properties: always on regulator in VDDmin. - vdd-wlan-core-supply: phandle to the 1.3V CORE regulator for QCA6174 - vdd-wlan-sp2t-supply: phandle to the 2.7V SP2T regulator for QCA6174 - qcom,smmu-s1-enable: Boolean property to decide whether to enable SMMU S1 stage or not - qcom,wlan-smmu-iova-address: I/O virtual address range as <start length> format to be used for allocations associated between WLAN/PCIe and SMMU Loading drivers/net/wireless/cnss2/pci.c +37 −17 Original line number Diff line number Diff line /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2018, 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 @@ -223,10 +223,13 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) struct dma_iommu_mapping *mapping; int atomic_ctx = 1; int s1_bypass = 1; int fast = 1; cnss_pr_dbg("Initializing SMMU\n"); dev = &pci_priv->pci_dev->dev; mapping = arm_iommu_create_mapping(&platform_bus_type, mapping = arm_iommu_create_mapping(dev->bus, pci_priv->smmu_iova_start, pci_priv->smmu_iova_len); if (IS_ERR(mapping)) { Loading @@ -235,6 +238,9 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) goto out; } if (pci_priv->smmu_s1_enable) { cnss_pr_dbg("Enabling SMMU S1 stage\n"); ret = iommu_domain_set_attr(mapping->domain, DOMAIN_ATTR_ATOMIC, &atomic_ctx); Loading @@ -244,6 +250,15 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) goto release_mapping; } ret = iommu_domain_set_attr(mapping->domain, DOMAIN_ATTR_FAST, &fast); if (ret) { pr_err("Failed to set SMMU fast attribute, err = %d\n", ret); goto release_mapping; } } else { ret = iommu_domain_set_attr(mapping->domain, DOMAIN_ATTR_S1_BYPASS, &s1_bypass); Loading @@ -252,6 +267,7 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) ret); goto release_mapping; } } ret = arm_iommu_attach_device(dev, mapping); if (ret) { Loading Loading @@ -1443,6 +1459,10 @@ static int cnss_pci_probe(struct pci_dev *pci_dev, res = platform_get_resource_byname(plat_priv->plat_dev, IORESOURCE_MEM, "smmu_iova_base"); if (res) { if (of_property_read_bool(plat_priv->plat_dev->dev.of_node, "qcom,smmu-s1-enable")) pci_priv->smmu_s1_enable = true; pci_priv->smmu_iova_start = res->start; pci_priv->smmu_iova_len = resource_size(res); cnss_pr_dbg("smmu_iova_start: %pa, smmu_iova_len: %zu\n", Loading drivers/net/wireless/cnss2/pci.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2018, 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 @@ -70,6 +70,7 @@ struct cnss_pci_data { atomic_t auto_suspended; bool monitor_wake_intr; struct dma_iommu_mapping *smmu_mapping; bool smmu_s1_enable; dma_addr_t smmu_iova_start; size_t smmu_iova_len; void __iomem *bar; Loading Loading
Documentation/devicetree/bindings/cnss/cnss-wlan.txt +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ Optional properties: always on regulator in VDDmin. - vdd-wlan-core-supply: phandle to the 1.3V CORE regulator for QCA6174 - vdd-wlan-sp2t-supply: phandle to the 2.7V SP2T regulator for QCA6174 - qcom,smmu-s1-enable: Boolean property to decide whether to enable SMMU S1 stage or not - qcom,wlan-smmu-iova-address: I/O virtual address range as <start length> format to be used for allocations associated between WLAN/PCIe and SMMU Loading
drivers/net/wireless/cnss2/pci.c +37 −17 Original line number Diff line number Diff line /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2018, 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 @@ -223,10 +223,13 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) struct dma_iommu_mapping *mapping; int atomic_ctx = 1; int s1_bypass = 1; int fast = 1; cnss_pr_dbg("Initializing SMMU\n"); dev = &pci_priv->pci_dev->dev; mapping = arm_iommu_create_mapping(&platform_bus_type, mapping = arm_iommu_create_mapping(dev->bus, pci_priv->smmu_iova_start, pci_priv->smmu_iova_len); if (IS_ERR(mapping)) { Loading @@ -235,6 +238,9 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) goto out; } if (pci_priv->smmu_s1_enable) { cnss_pr_dbg("Enabling SMMU S1 stage\n"); ret = iommu_domain_set_attr(mapping->domain, DOMAIN_ATTR_ATOMIC, &atomic_ctx); Loading @@ -244,6 +250,15 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) goto release_mapping; } ret = iommu_domain_set_attr(mapping->domain, DOMAIN_ATTR_FAST, &fast); if (ret) { pr_err("Failed to set SMMU fast attribute, err = %d\n", ret); goto release_mapping; } } else { ret = iommu_domain_set_attr(mapping->domain, DOMAIN_ATTR_S1_BYPASS, &s1_bypass); Loading @@ -252,6 +267,7 @@ static int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv) ret); goto release_mapping; } } ret = arm_iommu_attach_device(dev, mapping); if (ret) { Loading Loading @@ -1443,6 +1459,10 @@ static int cnss_pci_probe(struct pci_dev *pci_dev, res = platform_get_resource_byname(plat_priv->plat_dev, IORESOURCE_MEM, "smmu_iova_base"); if (res) { if (of_property_read_bool(plat_priv->plat_dev->dev.of_node, "qcom,smmu-s1-enable")) pci_priv->smmu_s1_enable = true; pci_priv->smmu_iova_start = res->start; pci_priv->smmu_iova_len = resource_size(res); cnss_pr_dbg("smmu_iova_start: %pa, smmu_iova_len: %zu\n", Loading
drivers/net/wireless/cnss2/pci.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2018, 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 @@ -70,6 +70,7 @@ struct cnss_pci_data { atomic_t auto_suspended; bool monitor_wake_intr; struct dma_iommu_mapping *smmu_mapping; bool smmu_s1_enable; dma_addr_t smmu_iova_start; size_t smmu_iova_len; void __iomem *bar; Loading