qcacld-3.0: Add support for IPA SMMU on CNSS

For now IPA SMMU can only work on ICNSS platform.
Add support for IPA SMMU feature on CNSS platform.

CRs-Fixed: 2286287
Change-Id: I6515d6ec764659f1aeefa50d9fd0b120c47b36bf
This commit is contained in:
Frank Liu 2018-07-27 14:43:26 +08:00 • committed by nshrivas
commit d462d9c62b
2 changed files with 26 additions and 3 deletions

View file

@ -1408,7 +1408,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(dev);
break;
default:
pr_err("Invalid device type %d\n", type);
@ -1439,8 +1439,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(dev, paddr, iova_addr, size);
break;
default:
pr_err("Invalid device type %d\n", type);

View file

@ -127,6 +127,18 @@ static inline int pld_pcie_wlan_pm_control(struct device *dev, bool vote)
#endif
#ifndef CONFIG_PLD_PCIE_CNSS
static inline void *pld_pcie_smmu_get_mapping(struct device *dev)
{
return NULL;
}
static inline int
pld_pcie_smmu_map(struct device *dev,
phys_addr_t paddr, 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,
@ -308,6 +320,18 @@ void pld_pcie_schedule_recovery_work(struct device *dev,
void pld_pcie_device_self_recovery(struct device *dev,
enum pld_recovery_reason reason);
static inline void *pld_pcie_smmu_get_mapping(struct device *dev)
{
return cnss_smmu_get_mapping(dev);
}
static inline int
pld_pcie_smmu_map(struct device *dev,
phys_addr_t paddr, uint32_t *iova_addr, size_t size)
{
return cnss_smmu_map(dev, paddr, iova_addr, size);
}
static inline void pld_pcie_link_down(struct device *dev)
{
cnss_pci_link_down(dev);