qcacld-3.0: add pld_smmu_unmap support for BENGAL

Add support for pld_smmu_unmap and enable it for
BENGAL target.

Change-Id: I7f6d6f965b7664342bca29b49f05f8eb62737a0c
CRs-Fixed: 2642663
This commit is contained in:
Vevek Venkatesan 2020-03-16 14:25:51 +05:30 • committed by nshrivas
commit 02f5dfc5d7
6 changed files with 100 additions and 0 deletions

2
Kbuild
View file

@ -3265,6 +3265,8 @@ cppflags-$(CONFIG_WDI3_STATS_UPDATE) += -DWDI3_STATS_UPDATE
cppflags-$(CONFIG_WLAN_CUSTOM_DSCP_UP_MAP) += -DWLAN_CUSTOM_DSCP_UP_MAP
cppflags-$(CONFIG_WLAN_SEND_DSCP_UP_MAP_TO_FW) += -DWLAN_SEND_DSCP_UP_MAP_TO_FW
cppflags-$(CONFIG_SMMU_S1_UNMAP) += -DCONFIG_SMMU_S1_UNMAP
KBUILD_CPPFLAGS += $(cppflags-y)
# Currently, for versions of gcc which support it, the kernel Makefile

View file

@ -613,6 +613,10 @@ ifeq ($(CONFIG_LITHIUM), y)
CONFIG_WLAN_CUSTOM_DSCP_UP_MAP := y
endif
ifeq ($(CONFIG_ARCH_BENGAL), y)
CONFIG_SMMU_S1_UNMAP := y
endif
ifeq ($(CONFIG_ROME_IF), sdio)
CONFIG_PKTLOG_LEGACY := y
endif

View file

@ -714,6 +714,31 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
QDF_STATUS ol_txrx_ipa_cleanup(uint32_t tx_pipe_handle, uint32_t rx_pipe_handle)
{
int ret;
struct ol_txrx_ipa_resources *ipa_res;
struct ol_txrx_soc_t *soc = cds_get_context(QDF_MODULE_ID_SOC);
qdf_device_t osdev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
ol_txrx_pdev_handle pdev =
ol_txrx_get_pdev_from_pdev_id(soc, OL_TXRX_PDEV_ID);
if (!pdev) {
ol_txrx_err("%s invalid instance", __func__);
return QDF_STATUS_E_FAILURE;
}
ipa_res = &pdev->ipa_resource;
if (osdev->smmu_s1_enabled) {
ret = pld_smmu_unmap(osdev->dev,
ipa_res->rx_ready_doorbell_dmaaddr,
sizeof(uint32_t));
if (ret)
ol_txrx_err("%s rx_ready, smmu unmap failed", __func__);
ret = pld_smmu_unmap(osdev->dev,
ipa_res->tx_comp_doorbell_dmaaddr,
sizeof(uint32_t));
if (ret)
ol_txrx_err("%s tx_comp, smmu unmap failed", __func__);
}
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
"%s: Disconnect IPA pipe", __func__);

View file

@ -661,6 +661,16 @@ void *pld_smmu_get_mapping(struct device *dev);
#endif
int pld_smmu_map(struct device *dev, phys_addr_t paddr,
uint32_t *iova_addr, size_t size);
#ifdef CONFIG_SMMU_S1_UNMAP
int pld_smmu_unmap(struct device *dev,
uint32_t iova_addr, size_t size);
#else
static inline int pld_smmu_unmap(struct device *dev,
uint32_t iova_addr, size_t size)
{
return 0;
}
#endif
int pld_get_user_msi_assignment(struct device *dev, char *user_name,
int *num_vectors, uint32_t *user_base_data,
uint32_t *base_vector);

View file

@ -1828,6 +1828,42 @@ int pld_smmu_map(struct device *dev, phys_addr_t paddr,
return ret;
}
#ifdef CONFIG_SMMU_S1_UNMAP
/**
* pld_smmu_unmap() - Unmap SMMU
* @dev: device
* @iova_addr: IOVA address to be unmapped
* @size: size to be unmapped
*
* Return: 0 for success
* Non zero failure code for errors
*/
int pld_smmu_unmap(struct device *dev,
uint32_t iova_addr, size_t size)
{
int ret = 0;
enum pld_bus_type type = pld_get_bus_type(dev);
switch (type) {
case PLD_BUS_TYPE_SNOC:
ret = pld_snoc_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:
pr_err("Invalid device type %d\n", type);
ret = -EINVAL;
break;
}
return ret;
}
#endif
/**
* pld_get_user_msi_assignment() - Get MSI assignment information
* @dev: device structure

View file

@ -114,6 +114,13 @@ static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr,
{
return 0;
}
static inline int pld_snoc_smmu_unmap(struct device *dev,
uint32_t iova_addr, size_t size)
{
return 0;
}
static inline
unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev)
{
@ -281,6 +288,22 @@ static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr,
{
return icnss_smmu_map(dev, paddr, iova_addr, size);
}
#ifdef CONFIG_SMMU_S1_UNMAP
static inline int pld_snoc_smmu_unmap(struct device *dev,
uint32_t iova_addr, size_t size)
{
return icnss_smmu_unmap(dev, iova_addr, size);
}
#else
static inline int pld_snoc_smmu_unmap(struct device *dev,
uint32_t iova_addr, size_t size)
{
return 0;
}
#endif
static inline
unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev)
{