Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 972e33ea authored by Michael Adisumarta's avatar Michael Adisumarta
Browse files

msm: ipa: Fix to set or bypass UC/WLAN SMMU S1 from flags in dtsi



This change is to set or bypass SMMU S1 for UC and WLAN Context
Banks in IPA based on the respective SMMU bypass flags in dtsi
file. This change is to make sure SMMU is enabled only when
SMMU S1 is enabled from other clients too like WLAN.

Change-Id: I50494ce8735dcc831eafb4616525f32792b1a671
CRs-Fixed: 2129476
Acked-by: default avatarJyothi Jayanthi <jyothij@qti.qualcomm.com>
Signed-off-by: default avatarMichael Adisumarta <madisuma@codeaurora.org>
parent 3fafba6f
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -4646,8 +4646,8 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
		for (i = 0; i < IPA_SMMU_CB_MAX; i++)
			ipa3_ctx->s1_bypass_arr[i] = true;
	} else {
		for (i = 0; i < IPA_SMMU_CB_MAX; i++)
			ipa3_ctx->s1_bypass_arr[i] = smmu_info.s1_bypass_arr[i];
		ipa3_ctx->s1_bypass_arr[IPA_SMMU_CB_AP] =
			smmu_info.s1_bypass_arr[IPA_SMMU_CB_AP];
	}

	ipa3_ctx->ipa_wrapper_base = resource_p->ipa_mem_base;
@@ -5506,6 +5506,8 @@ static int ipa_smmu_wlan_cb_probe(struct device *dev)

	if (of_property_read_bool(dev->of_node, "qcom,smmu-s1-bypass")) {
		smmu_info.s1_bypass_arr[IPA_SMMU_CB_WLAN] = true;
		ipa3_ctx->s1_bypass_arr[IPA_SMMU_CB_WLAN] = true;

		if (iommu_domain_set_attr(cb->iommu,
					DOMAIN_ATTR_S1_BYPASS,
					&bypass)) {
@@ -5516,6 +5518,8 @@ static int ipa_smmu_wlan_cb_probe(struct device *dev)
		IPADBG("WLAN SMMU S1 BYPASS\n");
	} else {
		smmu_info.s1_bypass_arr[IPA_SMMU_CB_WLAN] = false;
		ipa3_ctx->s1_bypass_arr[IPA_SMMU_CB_WLAN] = false;

		if (iommu_domain_set_attr(cb->iommu,
					DOMAIN_ATTR_ATOMIC,
					&atomic_ctx)) {
@@ -5630,6 +5634,8 @@ static int ipa_smmu_uc_cb_probe(struct device *dev)

	if (of_property_read_bool(dev->of_node, "qcom,smmu-s1-bypass")) {
		smmu_info.s1_bypass_arr[IPA_SMMU_CB_UC] = true;
		ipa3_ctx->s1_bypass_arr[IPA_SMMU_CB_UC] = true;

		if (iommu_domain_set_attr(cb->mapping->domain,
			DOMAIN_ATTR_S1_BYPASS,
			&bypass)) {
@@ -5641,6 +5647,8 @@ static int ipa_smmu_uc_cb_probe(struct device *dev)
		IPADBG("UC SMMU S1 BYPASS\n");
	} else {
		smmu_info.s1_bypass_arr[IPA_SMMU_CB_UC] = false;
		ipa3_ctx->s1_bypass_arr[IPA_SMMU_CB_UC] = false;

		if (iommu_domain_set_attr(cb->mapping->domain,
			DOMAIN_ATTR_ATOMIC,
			&atomic_ctx)) {