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

Commit d04e6d6b authored by Michael Adisumarta's avatar Michael Adisumarta
Browse files

msm: ipa: Add API support for getting IPA SMMU status


for WLAN

This is an API for getting IPA SMMU status, this API
will currently report if IPA SMMU is enabled or not
for WLAN Context Bank.

Change-Id: I9dec309c74043e259aa01ba9a49d9537e9d92208
Acked-by: default avatarJyothi Jayanthi <jyothij@qti.qualcomm.com>
Signed-off-by: default avatarMichael Adisumarta <madisuma@codeaurora.org>
parent fc9ce0e0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3135,6 +3135,17 @@ void ipa_ntn_uc_dereg_rdyCB(void)
}
EXPORT_SYMBOL(ipa_ntn_uc_dereg_rdyCB);

int ipa_get_smmu_params(struct ipa_smmu_in_params *in,
	struct ipa_smmu_out_params *out)
{
	int ret;

	IPA_API_DISPATCH_RETURN(ipa_get_smmu_params, in, out);

	return ret;
}
EXPORT_SYMBOL(ipa_get_smmu_params);

/**
 * ipa_conn_wdi3_pipes() - connect wdi3 pipes
 */
+3 −0
Original line number Diff line number Diff line
@@ -417,6 +417,9 @@ struct ipa_api_controller {

	int (*ipa_tz_unlock_reg)(struct ipa_tz_unlock_reg_info *reg_info,
		u16 num_regs);

	int (*ipa_get_smmu_params)(struct ipa_smmu_in_params *in,
		struct ipa_smmu_out_params *out);
};

#ifdef CONFIG_IPA
+34 −0
Original line number Diff line number Diff line
@@ -6403,5 +6403,39 @@ int ipa3_iommu_map(struct iommu_domain *domain,
	return iommu_map(domain, iova, paddr, size, prot);
}

/**
 * ipa3_get_smmu_params()- Return the ipa3 smmu related params.
 */
int ipa3_get_smmu_params(struct ipa_smmu_in_params *in,
	struct ipa_smmu_out_params *out)
{
	bool is_smmu_enable = 0;

	if (out == NULL || in == NULL) {
		IPAERR("bad parms for Client SMMU out params\n");
		return -EINVAL;
	}

	if (!ipa3_ctx) {
		IPAERR("IPA not yet initialized\n");
		return -EINVAL;
	}

	switch (in->smmu_client) {
	case IPA_SMMU_WLAN_CLIENT:
		is_smmu_enable = !(ipa3_ctx->s1_bypass_arr[IPA_SMMU_CB_UC] |
			ipa3_ctx->s1_bypass_arr[IPA_SMMU_CB_WLAN]);
		break;
	default:
		is_smmu_enable = 0;
		IPAERR("Trying to get illegal clients SMMU status");
		return -EINVAL;
	}

	out->smmu_enable = is_smmu_enable;

	return 0;
}

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("IPA HW device driver");
+3 −0
Original line number Diff line number Diff line
@@ -2020,6 +2020,9 @@ bool ipa3_get_modem_cfg_emb_pipe_flt(void);

u8 ipa3_get_qmb_master_sel(enum ipa_client_type client);

int ipa3_get_smmu_params(struct ipa_smmu_in_params *in,
	struct ipa_smmu_out_params *out);

/* internal functions */

int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
+1 −0
Original line number Diff line number Diff line
@@ -4505,6 +4505,7 @@ int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type,
	api_ctrl->ipa_enable_wdi3_pipes = ipa3_enable_wdi3_pipes;
	api_ctrl->ipa_disable_wdi3_pipes = ipa3_disable_wdi3_pipes;
	api_ctrl->ipa_tz_unlock_reg = ipa3_tz_unlock_reg;
	api_ctrl->ipa_get_smmu_params = ipa3_get_smmu_params;

	return 0;
}
Loading