OSDN Git Service

qcacld-3.0: Add support for IPA SMMU on CNSS
authorTang Yingying <yintang@codeaurora.org>
Wed, 7 Mar 2018 09:54:27 +0000 (17:54 +0800)
committernshrivas <nshrivas@codeaurora.org>
Mon, 6 Aug 2018 10:30:41 +0000 (03:30 -0700)
For now IPA SMMU can only work on ICNSS platform.
Add support for IPA SMMU feature on CNSS platform.

CRs-Fixed: 2266893
Change-Id: I6515d6ec764659f1aeefa50d9fd0b120c47b36bf

Kbuild
core/pld/src/pld_common.c
core/pld/src/pld_pcie.h

diff --git a/Kbuild b/Kbuild
index 8e319d2..26fc0ed 100644 (file)
--- a/Kbuild
+++ b/Kbuild
@@ -1884,6 +1884,12 @@ ifeq ($(CONFIG_ARCH_SDM670), y)
 CDEFINES += -DENABLE_SMMU_S1_TRANSLATION
 endif
 
+ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y)
+ifeq ($(CONFIG_ROME_IF),pci)
+CDEFINES += -DENABLE_SMMU_S1_TRANSLATION
+endif
+endif
+
 ifeq ($(CONFIG_DYNAMIC_DEBUG),y)
 CDEFINES += -DFEATURE_MULTICAST_HOST_FW_MSGS
 endif
index b6ba521..cecd9ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -1305,7 +1305,7 @@ void *pld_smmu_get_mapping(struct device *dev)
                ptr = pld_snoc_smmu_get_mapping(dev);
                break;
        case PLD_BUS_TYPE_PCIE:
-               pr_err("Not supported on type %d\n", type);
+               ptr = pld_pcie_smmu_get_mapping();
                break;
        default:
                pr_err("Invalid device type %d\n", type);
@@ -1336,8 +1336,7 @@ int pld_smmu_map(struct device *dev, phys_addr_t paddr,
                ret = pld_snoc_smmu_map(dev, paddr, iova_addr, size);
                break;
        case PLD_BUS_TYPE_PCIE:
-               pr_err("Not supported on type %d\n", type);
-               ret = -ENODEV;
+               ret = pld_pcie_smmu_map(paddr, iova_addr, size);
                break;
        default:
                pr_err("Invalid device type %d\n", type);
index be56561..8127584 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -110,6 +110,15 @@ static inline int pld_pcie_wlan_pm_control(bool vote)
 #endif
 
 #ifndef CONFIG_PLD_PCIE_CNSS
+static inline void *pld_pcie_smmu_get_mapping(void)
+{
+       return NULL;
+}
+static inline int pld_pcie_smmu_map(phys_addr_t paddr,
+                                   uint32_t *iova_addr, size_t size)
+{
+       return 0;
+}
 static inline int
 pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
                                 u32 target_type, u32 target_version)
@@ -177,6 +186,15 @@ static inline int pld_pcie_power_off(struct device *dev)
        return 0;
 }
 #else
+static inline void *pld_pcie_smmu_get_mapping(void)
+{
+       return cnss_smmu_get_mapping();
+}
+static inline int pld_pcie_smmu_map(phys_addr_t paddr,
+                                   uint32_t *iova_addr, size_t size)
+{
+       return cnss_smmu_map(paddr, iova_addr, size);
+}
 int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
                                     u32 target_type, u32 target_version);
 int pld_pcie_get_platform_cap(struct pld_platform_cap *cap);