Browse Source

qcacld-3.0: Support pld_smmu_unmap for PCIe platform

Add pld_pcie_smmu_unmap API to support SMMU unmap of
addresses mapped in smmu_iova_ipa bank.

Change-Id: Idcb76a4f9d6573fb3f2c1fe22f6fbbe1728fa079
CRs-Fixed: 2768112
Jia Ding 4 years ago
parent
commit
7f57d1c40f
2 changed files with 23 additions and 1 deletions
  1. 3 1
      core/pld/src/pld_common.c
  2. 20 0
      core/pld/src/pld_pcie.h

+ 3 - 1
core/pld/src/pld_common.c

@@ -1946,10 +1946,12 @@ int pld_smmu_unmap(struct device *dev,
 	case PLD_BUS_TYPE_SNOC:
 		ret = pld_snoc_smmu_unmap(dev, iova_addr, size);
 		break;
+	case PLD_BUS_TYPE_PCIE:
+		ret = pld_pcie_smmu_unmap(dev, iova_addr, size);
+		break;
 	case PLD_BUS_TYPE_PCIE_FW_SIM:
 	case PLD_BUS_TYPE_SNOC_FW_SIM:
 	case PLD_BUS_TYPE_IPCI:
-	case PLD_BUS_TYPE_PCIE:
 		pr_err("Not supported on type %d\n", type);
 		break;
 	default:

+ 20 - 0
core/pld/src/pld_pcie.h

@@ -153,6 +153,12 @@ pld_pcie_smmu_map(struct device *dev,
 	return 0;
 }
 
+static inline int
+pld_pcie_smmu_unmap(struct device *dev, uint32_t iova_addr, size_t size)
+{
+	return 0;
+}
+
 static inline int
 pld_pcie_get_fw_files_for_target(struct device *dev,
 				 struct pld_fw_files *pfw_files,
@@ -444,6 +450,20 @@ pld_pcie_smmu_map(struct device *dev,
 	return cnss_smmu_map(dev, paddr, iova_addr, size);
 }
 
+#ifdef CONFIG_SMMU_S1_UNMAP
+static inline int
+pld_pcie_smmu_unmap(struct device *dev, uint32_t iova_addr, size_t size)
+{
+	return cnss_smmu_unmap(dev, iova_addr, size);
+}
+#else /* !CONFIG_SMMU_S1_UNMAP */
+static inline int
+pld_pcie_smmu_unmap(struct device *dev, uint32_t iova_addr, size_t size)
+{
+	return 0;
+}
+#endif /* CONFIG_SMMU_S1_UNMAP */
+
 static inline int pld_pcie_prevent_l1(struct device *dev)
 {
 	return cnss_pci_prevent_l1(dev);