|
@@ -1,6 +1,6 @@
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
/*
|
|
|
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
|
|
|
*/
|
|
|
|
|
|
#include <linux/dma-mapping.h>
|
|
@@ -303,8 +303,14 @@ struct ipa_mpm_dev_info {
|
|
|
bool pcie_smmu_enabled;
|
|
|
struct ipa_mpm_iova_addr ctrl;
|
|
|
struct ipa_mpm_iova_addr data;
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
|
|
|
+ phys_addr_t chdb_base;
|
|
|
+ phys_addr_t erdb_base;
|
|
|
+#else
|
|
|
u32 chdb_base;
|
|
|
u32 erdb_base;
|
|
|
+#endif
|
|
|
+
|
|
|
bool is_cache_coherent;
|
|
|
};
|
|
|
|
|
@@ -2159,6 +2165,27 @@ static int ipa_mpm_mhi_probe_cb(struct mhi_device *mhi_dev,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ /* Read the MHI CH/ER DB address from MHI Driver. */
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
|
|
|
+ ret = mhi_get_channel_db_base(mhi_dev,
|
|
|
+ &ipa_mpm_ctx->dev_info.chdb_base);
|
|
|
+ if (ret) {
|
|
|
+ IPA_MPM_ERR("Could not populate channel db base address\n");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ IPA_MPM_DBG("chdb-base=0x%x\n", ipa_mpm_ctx->dev_info.chdb_base);
|
|
|
+
|
|
|
+ ret = mhi_get_event_ring_db_base(mhi_dev,
|
|
|
+ &ipa_mpm_ctx->dev_info.erdb_base);
|
|
|
+ if (ret) {
|
|
|
+ IPA_MPM_ERR("Could not populate event ring db base address\n");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ IPA_MPM_DBG("erdb-base=0x%x\n", ipa_mpm_ctx->dev_info.erdb_base);
|
|
|
+#endif
|
|
|
+
|
|
|
IPA_MPM_DBG("Received probe for id=%d\n", probe_id);
|
|
|
|
|
|
get_ipa3_client(probe_id, &ul_prod, &dl_cons);
|
|
@@ -3119,6 +3146,8 @@ static int ipa_mpm_probe(struct platform_device *pdev)
|
|
|
|
|
|
ipa_mpm_init_mhip_channel_info();
|
|
|
|
|
|
+ /* Read the MHI CH/ER DB address from DT. */
|
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
|
|
if (of_property_read_u32(pdev->dev.of_node, "qcom,mhi-chdb-base",
|
|
|
&ipa_mpm_ctx->dev_info.chdb_base)) {
|
|
|
IPA_MPM_ERR("failed to read qcom,mhi-chdb-base\n");
|
|
@@ -3132,6 +3161,7 @@ static int ipa_mpm_probe(struct platform_device *pdev)
|
|
|
goto fail_probe;
|
|
|
}
|
|
|
IPA_MPM_DBG("erdb-base=0x%x\n", ipa_mpm_ctx->dev_info.erdb_base);
|
|
|
+#endif
|
|
|
|
|
|
ret = ipa_mpm_populate_smmu_info(pdev);
|
|
|
|