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

Commit 57ca3ba3 authored by Mohammed Javid's avatar Mohammed Javid Committed by Akshay Pandit
Browse files

msm: ipa: Add support in ipa-mhi driver for cv2x



Only one pair of MHI ep's are supported till now.
With respect to auto-pcie use case requirement
we need to support one more MHI ep pair for cv2x.
Modify ipa-mhi driver to support additional mhi ep pair.

Change-Id: I301dc7c46c6bfcc995db5a6a56c677481588d20b
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent dbe84031
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -63,8 +63,8 @@
#define IPA_MHI_SUSPEND_SLEEP_MIN 900
#define IPA_MHI_SUSPEND_SLEEP_MAX 1100

#define IPA_MHI_MAX_UL_CHANNELS 1
#define IPA_MHI_MAX_DL_CHANNELS 2
#define IPA_MHI_MAX_UL_CHANNELS 2
#define IPA_MHI_MAX_DL_CHANNELS 3

/* bit #40 in address should be asserted for MHI transfers over pcie */
#define IPA_MHI_CLIENT_HOST_ADDR_COND(addr) \
+15 −4
Original line number Diff line number Diff line
@@ -3802,9 +3802,14 @@ void ipa3_q6_pre_shutdown_cleanup(void)
	if (!ipa3_ctx->ipa_endp_delay_wa)
		ipa3_q6_pipe_delay(true);
	ipa3_q6_avoid_holb();
	if (ipa3_ctx->ipa_config_is_mhi)
	if (ipa3_ctx->ipa_config_is_mhi) {
		ipa3_set_reset_client_cons_pipe_sus_holb(true,
		IPA_CLIENT_MHI_CONS);
		if (ipa3_ctx->ipa_config_is_auto)
			ipa3_set_reset_client_cons_pipe_sus_holb(true,
				IPA_CLIENT_MHI2_CONS);
	}

	if (ipa3_q6_clean_q6_tables()) {
		IPAERR("Failed to clean Q6 tables\n");
		/*
@@ -3914,9 +3919,15 @@ void ipa3_q6_pre_powerup_cleanup(void)

	IPA_ACTIVE_CLIENTS_INC_SIMPLE();

	if (ipa3_ctx->ipa_config_is_mhi)
	if (ipa3_ctx->ipa_config_is_mhi) {
		if (!ipa3_ctx->ipa_endp_delay_wa) {
			ipa3_set_reset_client_prod_pipe_delay(true,
				IPA_CLIENT_MHI_PROD);
			if (ipa3_ctx->ipa_config_is_auto)
				ipa3_set_reset_client_prod_pipe_delay(true,
					IPA_CLIENT_MHI2_PROD);
		}
	}

	IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
	IPADBG_LOW("Exit with success\n");
+11 −1
Original line number Diff line number Diff line
@@ -388,6 +388,7 @@ int ipa3_mhi_init_engine(struct ipa_mhi_init_engine *params)
	int res;
	struct gsi_device_scratch gsi_scratch;
	const struct ipa_gsi_ep_config *gsi_ep_info;
	u32 ipa_mhi_max_ul_channels, ipa_mhi_max_dl_channels;

	IPA_MHI_FUNC_ENTRY();

@@ -396,7 +397,16 @@ int ipa3_mhi_init_engine(struct ipa_mhi_init_engine *params)
		return -EINVAL;
	}

	if ((IPA_MHI_MAX_UL_CHANNELS + IPA_MHI_MAX_DL_CHANNELS) >
	ipa_mhi_max_ul_channels = IPA_MHI_MAX_UL_CHANNELS;
	ipa_mhi_max_dl_channels = IPA_MHI_MAX_DL_CHANNELS;

	/* In case of Auto-pcie config, MHI2_PROD and MHI2_CONS is used */
	if (ipa3_ctx->ipa_config_is_auto == true) {
		ipa_mhi_max_ul_channels++;
		ipa_mhi_max_dl_channels++;
	}

	if ((ipa_mhi_max_ul_channels + ipa_mhi_max_dl_channels) >
		((ipa3_ctx->mhi_evid_limits[1] -
		ipa3_ctx->mhi_evid_limits[0]) + 1)) {
		IPAERR("Not enough event rings for MHI\n");
+2 −4
Original line number Diff line number Diff line
@@ -506,13 +506,11 @@ enum ipa_client_type {
	((client) == IPA_CLIENT_MEMCPY_DMA_SYNC_PROD || \
	(client) == IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD)

#define IPA_CLIENT_IS_MHI_CONS(client) \
	((client) == IPA_CLIENT_MHI_CONS || \
	(client) == IPA_CLIENT_MHI_DPL_CONS)

#define IPA_CLIENT_IS_MHI(client) \
	((client) == IPA_CLIENT_MHI_CONS || \
	(client) == IPA_CLIENT_MHI_PROD || \
	(client) == IPA_CLIENT_MHI2_PROD || \
	(client) == IPA_CLIENT_MHI2_CONS || \
	(client) == IPA_CLIENT_MHI_DPL_CONS)

#define IPA_CLIENT_IS_TEST_PROD(client) \