Merge "msm: ipa3: add mapping for IPA SMEM to SMMU"
This commit is contained in:
commit
e21b49baaf
1 changed files with 24 additions and 0 deletions
|
@ -37,6 +37,7 @@
|
||||||
#include <linux/hashtable.h>
|
#include <linux/hashtable.h>
|
||||||
#include <linux/hash.h>
|
#include <linux/hash.h>
|
||||||
#include <soc/qcom/subsystem_restart.h>
|
#include <soc/qcom/subsystem_restart.h>
|
||||||
|
#include <soc/qcom/smem.h>
|
||||||
#define IPA_SUBSYSTEM_NAME "ipa_fws"
|
#define IPA_SUBSYSTEM_NAME "ipa_fws"
|
||||||
#include "ipa_i.h"
|
#include "ipa_i.h"
|
||||||
#include "../ipa_rm_i.h"
|
#include "../ipa_rm_i.h"
|
||||||
|
@ -75,6 +76,8 @@
|
||||||
#define IPA3_ACTIVE_CLIENT_LOG_TYPE_RESOURCE 2
|
#define IPA3_ACTIVE_CLIENT_LOG_TYPE_RESOURCE 2
|
||||||
#define IPA3_ACTIVE_CLIENT_LOG_TYPE_SPECIAL 3
|
#define IPA3_ACTIVE_CLIENT_LOG_TYPE_SPECIAL 3
|
||||||
|
|
||||||
|
#define IPA_SMEM_SIZE (8 * 1024)
|
||||||
|
|
||||||
/* round addresses for closes page per SMMU requirements */
|
/* round addresses for closes page per SMMU requirements */
|
||||||
#define IPA_SMMU_ROUND_TO_PAGE(iova, pa, size, iova_p, pa_p, size_p) \
|
#define IPA_SMMU_ROUND_TO_PAGE(iova, pa, size, iova_p, pa_p, size_p) \
|
||||||
do { \
|
do { \
|
||||||
|
@ -4824,6 +4827,7 @@ static int ipa_smmu_ap_cb_probe(struct device *dev)
|
||||||
u32 iova_ap_mapping[2];
|
u32 iova_ap_mapping[2];
|
||||||
u32 add_map_size;
|
u32 add_map_size;
|
||||||
const u32 *add_map;
|
const u32 *add_map;
|
||||||
|
void *smem_addr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
IPADBG("AP CB probe: sub pdev=%p\n", dev);
|
IPADBG("AP CB probe: sub pdev=%p\n", dev);
|
||||||
|
@ -4943,6 +4947,26 @@ static int ipa_smmu_ap_cb_probe(struct device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* map SMEM memory for IPA table accesses */
|
||||||
|
smem_addr = smem_alloc(SMEM_IPA_FILTER_TABLE, IPA_SMEM_SIZE,
|
||||||
|
SMEM_MODEM, 0);
|
||||||
|
if (smem_addr) {
|
||||||
|
phys_addr_t iova = smem_virt_to_phys(smem_addr);
|
||||||
|
phys_addr_t pa = iova;
|
||||||
|
unsigned long iova_p;
|
||||||
|
phys_addr_t pa_p;
|
||||||
|
u32 size_p;
|
||||||
|
|
||||||
|
IPA_SMMU_ROUND_TO_PAGE(iova, pa, IPA_SMEM_SIZE,
|
||||||
|
iova_p, pa_p, size_p);
|
||||||
|
IPADBG("mapping 0x%lx to 0x%pa size %d\n",
|
||||||
|
iova_p, &pa_p, size_p);
|
||||||
|
ipa3_iommu_map(cb->mapping->domain,
|
||||||
|
iova_p, pa_p, size_p,
|
||||||
|
IOMMU_READ | IOMMU_WRITE | IOMMU_DEVICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
smmu_info.present = true;
|
smmu_info.present = true;
|
||||||
|
|
||||||
if (!ipa3_bus_scale_table)
|
if (!ipa3_bus_scale_table)
|
||||||
|
|
Loading…
Add table
Reference in a new issue