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

Commit bc912e31 authored by Bojun Pan's avatar Bojun Pan
Browse files

msm: gsi: gsi channel QoS register update



GSI QoS register upgrade for GSI v2.9, introduce the
new field of db_in_bytes.

Change-Id: I1d0ff4381a6b6ac1f5119d0be2efea29a49a5dcc
Signed-off-by: default avatarBojun Pan <bojunp@codeaurora.org>
parent e2df375d
Loading
Loading
Loading
Loading
+33 −2
Original line number Diff line number Diff line
@@ -2141,6 +2141,35 @@ static void gsi_program_chan_ctx_qos_v2_5(struct gsi_chan_props *props,
			GSI_V2_5_EE_n_GSI_CH_k_QOS_OFFS(props->ch_id, ee));
}

static void gsi_program_chan_ctx_qos_v2_9(struct gsi_chan_props *props,
	unsigned int ee)
{
	uint32_t val;

	val =
	(((props->low_weight <<
		GSI_V2_9_EE_n_GSI_CH_k_QOS_WRR_WEIGHT_SHFT) &
		GSI_V2_9_EE_n_GSI_CH_k_QOS_WRR_WEIGHT_BMSK) |
	((props->max_prefetch <<
		 GSI_V2_9_EE_n_GSI_CH_k_QOS_MAX_PREFETCH_SHFT) &
		 GSI_V2_9_EE_n_GSI_CH_k_QOS_MAX_PREFETCH_BMSK) |
	((props->use_db_eng <<
		GSI_V2_9_EE_n_GSI_CH_k_QOS_USE_DB_ENG_SHFT) &
		GSI_V2_9_EE_n_GSI_CH_k_QOS_USE_DB_ENG_BMSK) |
	((props->prefetch_mode <<
		GSI_V2_9_EE_n_GSI_CH_k_QOS_PREFETCH_MODE_SHFT) &
		GSI_V2_9_EE_n_GSI_CH_k_QOS_PREFETCH_MODE_BMSK) |
	((props->empty_lvl_threshold <<
		GSI_V2_9_EE_n_GSI_CH_k_QOS_EMPTY_LVL_THRSHOLD_SHFT) &
		GSI_V2_9_EE_n_GSI_CH_k_QOS_EMPTY_LVL_THRSHOLD_BMSK) |
	((props->db_in_bytes <<
		GSI_V2_9_EE_n_GSI_CH_k_QOS_DB_IN_BYTES_SHFT) &
		GSI_V2_9_EE_n_GSI_CH_k_QOS_DB_IN_BYTES_BMSK));

	gsi_writel(val, gsi_ctx->base +
		GSI_V2_9_EE_n_GSI_CH_k_QOS_OFFS(props->ch_id, ee));
}

static void gsi_program_chan_ctx(struct gsi_chan_props *props, unsigned int ee,
		uint8_t erindex)
{
@@ -2205,7 +2234,9 @@ static void gsi_program_chan_ctx(struct gsi_chan_props *props, unsigned int ee,
	gsi_writel(val, gsi_ctx->base +
			GSI_EE_n_GSI_CH_k_CNTXT_3_OFFS(props->ch_id, ee));

	if (gsi_ctx->per.ver >= GSI_VER_2_5)
	if (gsi_ctx->per.ver >= GSI_VER_2_9)
		gsi_program_chan_ctx_qos_v2_9(props, ee);
	else if (gsi_ctx->per.ver >= GSI_VER_2_5)
		gsi_program_chan_ctx_qos_v2_5(props, ee);
	else
		gsi_program_chan_ctx_qos(props, ee);
+14 −0
Original line number Diff line number Diff line
@@ -550,6 +550,20 @@
#define GSI_V2_5_EE_n_GSI_CH_k_QOS_WRR_WEIGHT_BMSK 0xf
#define GSI_V2_5_EE_n_GSI_CH_k_QOS_WRR_WEIGHT_SHFT 0x0

#define GSI_V2_9_EE_n_GSI_CH_k_QOS_OFFS(k, n) \
	(GSI_GSI_REG_BASE_OFFS + 0x0000f05c + 0x4000 * (n) + 0x80 * (k))
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_DB_IN_BYTES_BMSK 0x1000000
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_DB_IN_BYTES_SHFT 0x18
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_EMPTY_LVL_THRSHOLD_BMSK 0xff0000
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_EMPTY_LVL_THRSHOLD_SHFT 0x10
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_PREFETCH_MODE_BMSK 0x3c00
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_PREFETCH_MODE_SHFT 0xa
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_USE_DB_ENG_BMSK 0x200
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_USE_DB_ENG_SHFT 0x9
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_MAX_PREFETCH_BMSK 0x100
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_MAX_PREFETCH_SHFT 0x8
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_WRR_WEIGHT_BMSK 0xf
#define GSI_V2_9_EE_n_GSI_CH_k_QOS_WRR_WEIGHT_SHFT 0x0

#define GSI_EE_n_GSI_CH_k_SCRATCH_0_OFFS(k, n) \
	(GSI_GSI_REG_BASE_OFFS + 0x0000f060 + 0x4000 * (n) + 0x80 * (k))
+1 −0
Original line number Diff line number Diff line
@@ -1192,6 +1192,7 @@ static int ipa3_usb_request_xdci_channel(
		chan_params.chan_params.use_db_eng = GSI_CHAN_DIRECT_MODE;
	else
		chan_params.chan_params.use_db_eng = GSI_CHAN_DB_MODE;
	chan_params.chan_params.db_in_bytes = 1;
	chan_params.chan_params.max_prefetch = GSI_ONE_PREFETCH_SEG;
	if (params->dir == GSI_CHAN_DIR_FROM_GSI)
		chan_params.chan_params.low_weight =
+2 −0
Original line number Diff line number Diff line
@@ -4481,6 +4481,7 @@ static int ipa_gsi_setup_transfer_ring(struct ipa3_ep_context *ep,
		gsi_channel_props.low_weight = IPA_GSI_MAX_CH_LOW_WEIGHT;
	else
		gsi_channel_props.low_weight = 1;
	gsi_channel_props.db_in_bytes = 1;
	gsi_channel_props.prefetch_mode = gsi_ep_info->prefetch_mode;
	gsi_channel_props.empty_lvl_threshold = gsi_ep_info->prefetch_threshold;
	gsi_channel_props.chan_user_data = user_data;
@@ -4805,6 +4806,7 @@ int ipa_gsi_ch20_wa(void)
	else
		gsi_channel_props.use_db_eng = GSI_CHAN_DB_MODE;

	gsi_channel_props.db_in_bytes = 1;
	gsi_channel_props.max_prefetch = GSI_ONE_PREFETCH_SEG;
	gsi_channel_props.low_weight = 1;
	gsi_channel_props.err_cb = ipa_gsi_chan_err_cb;
+1 −0
Original line number Diff line number Diff line
@@ -289,6 +289,7 @@ static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
	else
		ch_props.use_db_eng = GSI_CHAN_DB_MODE;

	ch_props.db_in_bytes = 1;
	ch_props.max_prefetch = GSI_ONE_PREFETCH_SEG;
	ch_props.low_weight = 1;
	ch_props.prefetch_mode = ep_cfg->prefetch_mode;
Loading