msm: ipa: Enable GSI Channel almost empty Feature
Enable GSI Channel almost empty Feature for MHI DL channel. Change-Id: I9e27044f30bf61b91c0dcd7b7f109404b303bb62
This commit is contained in:
@@ -5145,6 +5145,13 @@ int gsi_get_fw_version(struct gsi_fw_version *ver)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gsi_update_almst_empty_thrshold(unsigned long chan_hdl, unsigned short threshold)
|
||||||
|
{
|
||||||
|
gsihal_write_reg_nk(GSI_EE_n_CH_k_CH_ALMST_EMPTY_THRSHOLD,
|
||||||
|
gsi_ctx->per.ee, chan_hdl, threshold);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(gsi_update_almst_empty_thrshold);
|
||||||
|
|
||||||
static int msm_gsi_probe(struct platform_device *pdev)
|
static int msm_gsi_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
|
@@ -2316,6 +2316,15 @@ int gsi_enable_flow_control_ee(unsigned int chan_idx, unsigned int ee,
|
|||||||
*/
|
*/
|
||||||
int gsi_query_msi_addr(unsigned long chan_hdl, phys_addr_t *addr);
|
int gsi_query_msi_addr(unsigned long chan_hdl, phys_addr_t *addr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gsi_update_almst_empty_thrshold - update almst_empty_thrshold
|
||||||
|
*
|
||||||
|
* @chan_id: channel id
|
||||||
|
* @threshold: Threshold value for channel almost empty indication to MCS.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void gsi_update_almst_empty_thrshold(unsigned long chan_hdl, unsigned short threshold);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gsi_dump_ch_info - channel information.
|
* gsi_dump_ch_info - channel information.
|
||||||
*
|
*
|
||||||
|
@@ -171,6 +171,7 @@ static const char *gsireg_name_to_str[GSI_REG_MAX] = {
|
|||||||
__stringify(GSI_GSI_MCS_PROFILING_MCS_BUSY_CNT_MSB),
|
__stringify(GSI_GSI_MCS_PROFILING_MCS_BUSY_CNT_MSB),
|
||||||
__stringify(GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_LSB),
|
__stringify(GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_LSB),
|
||||||
__stringify(GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_MSB),
|
__stringify(GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_MSB),
|
||||||
|
__stringify(GSI_EE_n_CH_k_CH_ALMST_EMPTY_THRSHOLD),
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1757,7 +1758,10 @@ static struct gsihal_reg_obj gsihal_reg_objs[GSI_VER_MAX][GSI_REG_MAX] = {
|
|||||||
0x0001401c, 0x12000, 0x80 },
|
0x0001401c, 0x12000, 0x80 },
|
||||||
[GSI_VER_3_0][GSI_EE_n_GSI_CH_k_CNTXT_8] = {
|
[GSI_VER_3_0][GSI_EE_n_GSI_CH_k_CNTXT_8] = {
|
||||||
gsireg_construct_dummy, gsireg_parse_dummy,
|
gsireg_construct_dummy, gsireg_parse_dummy,
|
||||||
0x00014020 , 0x12000, 0x80 },
|
0x00014020, 0x12000, 0x80 },
|
||||||
|
[GSI_VER_3_0][GSI_EE_n_CH_k_CH_ALMST_EMPTY_THRSHOLD] = {
|
||||||
|
gsireg_construct_dummy, gsireg_parse_dummy,
|
||||||
|
0x00014028, 0x12000, 0x80 },
|
||||||
[GSI_VER_3_0][GSI_EE_n_GSI_CH_k_RE_FETCH_READ_PTR] = {
|
[GSI_VER_3_0][GSI_EE_n_GSI_CH_k_RE_FETCH_READ_PTR] = {
|
||||||
gsireg_construct_dummy, gsireg_parse_dummy,
|
gsireg_construct_dummy, gsireg_parse_dummy,
|
||||||
0x00014040, 0x12000, 0x80 },
|
0x00014040, 0x12000, 0x80 },
|
||||||
|
@@ -161,6 +161,7 @@ enum gsihal_reg_name {
|
|||||||
GSI_GSI_MCS_PROFILING_MCS_BUSY_CNT_MSB,
|
GSI_GSI_MCS_PROFILING_MCS_BUSY_CNT_MSB,
|
||||||
GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_LSB,
|
GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_LSB,
|
||||||
GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_MSB,
|
GSI_GSI_MCS_PROFILING_MCS_IDLE_CNT_MSB,
|
||||||
|
GSI_EE_n_CH_k_CH_ALMST_EMPTY_THRSHOLD,
|
||||||
GSI_REG_MAX
|
GSI_REG_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -180,7 +180,11 @@ static int ipa3_mhi_get_ch_poll_cfg(enum ipa_client_type client,
|
|||||||
if (IPA_CLIENT_IS_PROD(client))
|
if (IPA_CLIENT_IS_PROD(client))
|
||||||
return 7;
|
return 7;
|
||||||
else
|
else
|
||||||
return (ring_size/2)/8;
|
/* IPA5.0 use almst empty register */
|
||||||
|
if (ipa3_ctx->ipa_hw_type >= IPA_HW_v5_0)
|
||||||
|
return (ring_size/2);
|
||||||
|
else
|
||||||
|
return (ring_size/2)/8;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return ch_ctx_host->pollcfg;
|
return ch_ctx_host->pollcfg;
|
||||||
@@ -350,8 +354,14 @@ static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
|
|||||||
ch_scratch1.mhi_v2.mhi_host_wp_addr_hi =
|
ch_scratch1.mhi_v2.mhi_host_wp_addr_hi =
|
||||||
(ch_scratch.mhi.mhi_host_wp_addr & 0x1FF00000000ll) >>
|
(ch_scratch.mhi.mhi_host_wp_addr & 0x1FF00000000ll) >>
|
||||||
32;
|
32;
|
||||||
ch_scratch1.mhi_v2.polling_configuration =
|
if (ipa3_ctx->ipa_hw_type >= IPA_HW_v5_0 &&
|
||||||
ch_scratch.mhi.polling_configuration;
|
client == IPA_CLIENT_MHI_CONS) {
|
||||||
|
gsi_update_almst_empty_thrshold(ep->gsi_chan_hdl,
|
||||||
|
ch_scratch.mhi.polling_configuration);
|
||||||
|
} else {
|
||||||
|
ch_scratch1.mhi_v2.polling_configuration =
|
||||||
|
ch_scratch.mhi.polling_configuration;
|
||||||
|
}
|
||||||
ch_scratch1.mhi_v2.assert_bit40 = ch_scratch.mhi.assert_bit40;
|
ch_scratch1.mhi_v2.assert_bit40 = ch_scratch.mhi.assert_bit40;
|
||||||
ch_scratch1.mhi_v2.burst_mode_enabled =
|
ch_scratch1.mhi_v2.burst_mode_enabled =
|
||||||
ch_scratch.mhi.burst_mode_enabled;
|
ch_scratch.mhi.burst_mode_enabled;
|
||||||
|
Reference in New Issue
Block a user