cnss2: Add support to check if IPA and WLAN share common dma pool

Add support to check if IPA and WLAN share a common dma pool
and based on that take descision to map the rx buffers or not
in IPA use case scenarios

Change-Id: I5d684db1cffc9f04b962cf7bdf0305b7d5e1df23
CRs-Fixed: 3878739
This commit is contained in:
Anuj Khera
2024-07-15 16:02:14 +05:30
committed by Ravindra Konda
父節點 bbf4e9cd00
當前提交 acef017b76
共有 3 個文件被更改,包括 56 次插入0 次删除

查看文件

@@ -700,6 +700,60 @@ bool cnss_audio_is_direct_link_supported(struct device *dev)
}
EXPORT_SYMBOL(cnss_audio_is_direct_link_supported);
/**
* cnss_ipa_wlan_shared_smmu_supported: Check whether shared SMMU context bank
* can be used between IPA and WLAN.
* @dev: Device
*
* Return: TRUE if supported, FALSE on failure or if not supported
*/
bool cnss_ipa_wlan_shared_smmu_supported(struct device *dev)
{
struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(dev);
struct device_node *ipa_wlan_smmu_node;
struct device_node *cnss_iommu_group_node;
struct device_node *ipa_iommu_group_node;
if (!plat_priv) {
cnss_pr_err("plat_priv not available for IPA Shared CB cap\n");
return false;
}
ipa_wlan_smmu_node = of_find_compatible_node(NULL, NULL,
"qcom,ipa-smmu-wlan-cb");
if (!ipa_wlan_smmu_node) {
cnss_pr_err("ipa-smmu-wlan-cb not enabled");
return false;
}
ipa_iommu_group_node = of_parse_phandle(ipa_wlan_smmu_node,
"qcom,iommu-group", 0);
of_node_put(ipa_wlan_smmu_node);
if (!ipa_iommu_group_node) {
cnss_pr_err("Unable to get ipa iommu group phandle");
return false;
}
of_node_put(ipa_iommu_group_node);
cnss_iommu_group_node = of_parse_phandle(dev->of_node,
"qcom,iommu-group", 0);
if (!cnss_iommu_group_node) {
cnss_pr_err("Unable to get cnss iommu group phandle");
return false;
}
of_node_put(cnss_iommu_group_node);
if (cnss_iommu_group_node == ipa_iommu_group_node) {
plat_priv->ipa_shared_cb_enable = true;
cnss_pr_info("CNSS and IPA share IOMMU group");
} else {
cnss_pr_info("CNSS and IPA do not share IOMMU group");
}
return plat_priv->ipa_shared_cb_enable;
}
EXPORT_SYMBOL(cnss_ipa_wlan_shared_smmu_supported);
void cnss_request_pm_qos(struct device *dev, u32 qos_val)
{

查看文件

@@ -649,6 +649,7 @@ struct cnss_plat_data {
bool no_bwscale;
bool sleep_clk;
struct wlchip_serial_id_v01 serial_id;
bool ipa_shared_cb_enable;
};
#if IS_ENABLED(CONFIG_ARCH_QCOM)

查看文件

@@ -452,6 +452,7 @@ extern int cnss_send_buffer_to_afcmem(struct device *dev, const uint8_t *afcdb,
extern int cnss_reset_afcmem(struct device *dev, uint8_t slotid);
extern bool cnss_get_fw_cap(struct device *dev, enum cnss_fw_caps fw_cap);
extern bool cnss_audio_is_direct_link_supported(struct device *dev);
extern bool cnss_ipa_wlan_shared_smmu_supported(struct device *dev);
extern int cnss_set_wfc_mode(struct device *dev, struct cnss_wfc_cfg cfg);
extern int cnss_thermal_cdev_register(struct device *dev,
unsigned long max_state,