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

Commit 9037544b authored by Nadine Toledano's avatar Nadine Toledano
Browse files

msm: ipa3: Add the ability to set dynamically HPS/DPS seq type



HPS/DPS sequencer type is configured statically for PROD EPs
according to ipa3_ep_mapping table. This change adds the ability
to set a different HPS/DPS sequencer configuration for PRODs,
which mainly be used in testing

CRs-Fixed: 986167
Change-Id: I47dec10e757694596385f5118486603c702fe302
Signed-off-by: default avatarNadine Toledano <nadinet@codeaurora.org>
parent 2f2a03e6
Loading
Loading
Loading
Loading
+19 −13
Original line number Diff line number Diff line
@@ -2505,7 +2505,7 @@ int ipa3_generate_flt_eq(enum ipa_ip_type ip,
 *
 * Note:	Should not be called from atomic context
 */
int ipa3_cfg_ep_seq(u32 clnt_hdl)
int ipa3_cfg_ep_seq(u32 clnt_hdl, const struct ipa_ep_cfg_seq *seq_cfg)
{
	int type;
	u8 hw_type_index;
@@ -2530,19 +2530,25 @@ int ipa3_cfg_ep_seq(u32 clnt_hdl)
		return 0;
	}

	if (seq_cfg->set_dynamic) {
		type = seq_cfg->seq_type;
	} else {
		switch (ipa3_ctx->ipa_hw_type) {
		case IPA_HW_v3_0:
		case IPA_HW_v3_1:
			hw_type_index = IPA_3_0;
			break;
		default:
		IPAERR("Incorrect IPA version %d\n", ipa3_ctx->ipa_hw_type);
			IPAERR("Incorrect IPA version %d\n",
				ipa3_ctx->ipa_hw_type);
			hw_type_index = IPA_3_0;
			break;
		}

	type = ipa3_ep_mapping[hw_type_index][ipa3_ctx->ep[clnt_hdl].client]
						.sequencer_type;
		type = ipa3_ep_mapping[hw_type_index][ipa3_ctx->ep[clnt_hdl]
					.client].sequencer_type;
	}

	if (type != IPA_DPS_HPS_SEQ_TYPE_INVALID) {
		if (ipa3_ctx->ep[clnt_hdl].cfg.mode.mode == IPA_DMA &&
			!IPA_DPS_HPS_SEQ_TYPE_IS_DMA(type)) {
@@ -2610,7 +2616,7 @@ int ipa3_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg)
		if (result)
			return result;

		result = ipa3_cfg_ep_seq(clnt_hdl);
		result = ipa3_cfg_ep_seq(clnt_hdl, &ipa_ep_cfg->seq);
		if (result)
			return result;

+13 −0
Original line number Diff line number Diff line
@@ -371,6 +371,17 @@ struct ipa_ep_cfg_metadata {
	u32 qmap_id;
};

/**
 * struct ipa_ep_cfg_seq - HPS/DPS sequencer type configuration in IPA end-point
 * @set_dynamic:  0 - HPS/DPS seq type is configured statically,
 *		   1 - HPS/DPS seq type is set to seq_type
 * @seq_type: HPS/DPS sequencer type configuration
 */
struct ipa_ep_cfg_seq {
	bool set_dynamic;
	int seq_type;
};

/**
 * struct ipa_ep_cfg - configuration of IPA end-point
 * @nat:		NAT parmeters
@@ -383,6 +394,7 @@ struct ipa_ep_cfg_metadata {
 * @cfg:		Configuration register data
 * @metadata_mask:	Hdr metadata mask
 * @meta:		Meta Data
 * @seq:		HPS/DPS sequencers configuration
 */
struct ipa_ep_cfg {
	struct ipa_ep_cfg_nat nat;
@@ -395,6 +407,7 @@ struct ipa_ep_cfg {
	struct ipa_ep_cfg_cfg cfg;
	struct ipa_ep_cfg_metadata_mask metadata_mask;
	struct ipa_ep_cfg_metadata meta;
	struct ipa_ep_cfg_seq seq;
};

/**