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: Bojun Pan <bojunp@codeaurora.org>
This commit is contained in:
@@ -2105,7 +2105,7 @@ static void gsi_program_chan_ctx_qos(struct gsi_chan_props *props,
|
|||||||
GSI_EE_n_GSI_CH_k_QOS_MAX_PREFETCH_BMSK) |
|
GSI_EE_n_GSI_CH_k_QOS_MAX_PREFETCH_BMSK) |
|
||||||
((props->use_db_eng <<
|
((props->use_db_eng <<
|
||||||
GSI_EE_n_GSI_CH_k_QOS_USE_DB_ENG_SHFT) &
|
GSI_EE_n_GSI_CH_k_QOS_USE_DB_ENG_SHFT) &
|
||||||
GSI_EE_n_GSI_CH_k_QOS_USE_DB_ENG_BMSK));
|
GSI_EE_n_GSI_CH_k_QOS_USE_DB_ENG_BMSK));
|
||||||
if (gsi_ctx->per.ver >= GSI_VER_2_0)
|
if (gsi_ctx->per.ver >= GSI_VER_2_0)
|
||||||
val |= ((props->prefetch_mode <<
|
val |= ((props->prefetch_mode <<
|
||||||
GSI_EE_n_GSI_CH_k_QOS_USE_ESCAPE_BUF_ONLY_SHFT)
|
GSI_EE_n_GSI_CH_k_QOS_USE_ESCAPE_BUF_ONLY_SHFT)
|
||||||
@@ -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));
|
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,
|
static void gsi_program_chan_ctx(struct gsi_chan_props *props, unsigned int ee,
|
||||||
uint8_t erindex)
|
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_writel(val, gsi_ctx->base +
|
||||||
GSI_EE_n_GSI_CH_k_CNTXT_3_OFFS(props->ch_id, ee));
|
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);
|
gsi_program_chan_ctx_qos_v2_5(props, ee);
|
||||||
else
|
else
|
||||||
gsi_program_chan_ctx_qos(props, ee);
|
gsi_program_chan_ctx_qos(props, ee);
|
||||||
|
@@ -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_BMSK 0xf
|
||||||
#define GSI_V2_5_EE_n_GSI_CH_k_QOS_WRR_WEIGHT_SHFT 0x0
|
#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) \
|
#define GSI_EE_n_GSI_CH_k_SCRATCH_0_OFFS(k, n) \
|
||||||
(GSI_GSI_REG_BASE_OFFS + 0x0000f060 + 0x4000 * (n) + 0x80 * (k))
|
(GSI_GSI_REG_BASE_OFFS + 0x0000f060 + 0x4000 * (n) + 0x80 * (k))
|
||||||
|
@@ -1192,6 +1192,7 @@ static int ipa3_usb_request_xdci_channel(
|
|||||||
chan_params.chan_params.use_db_eng = GSI_CHAN_DIRECT_MODE;
|
chan_params.chan_params.use_db_eng = GSI_CHAN_DIRECT_MODE;
|
||||||
else
|
else
|
||||||
chan_params.chan_params.use_db_eng = GSI_CHAN_DB_MODE;
|
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;
|
chan_params.chan_params.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
||||||
if (params->dir == GSI_CHAN_DIR_FROM_GSI)
|
if (params->dir == GSI_CHAN_DIR_FROM_GSI)
|
||||||
chan_params.chan_params.low_weight =
|
chan_params.chan_params.low_weight =
|
||||||
|
@@ -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;
|
gsi_channel_props.low_weight = IPA_GSI_MAX_CH_LOW_WEIGHT;
|
||||||
else
|
else
|
||||||
gsi_channel_props.low_weight = 1;
|
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.prefetch_mode = gsi_ep_info->prefetch_mode;
|
||||||
gsi_channel_props.empty_lvl_threshold = gsi_ep_info->prefetch_threshold;
|
gsi_channel_props.empty_lvl_threshold = gsi_ep_info->prefetch_threshold;
|
||||||
gsi_channel_props.chan_user_data = user_data;
|
gsi_channel_props.chan_user_data = user_data;
|
||||||
@@ -4805,6 +4806,7 @@ int ipa_gsi_ch20_wa(void)
|
|||||||
else
|
else
|
||||||
gsi_channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
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.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
||||||
gsi_channel_props.low_weight = 1;
|
gsi_channel_props.low_weight = 1;
|
||||||
gsi_channel_props.err_cb = ipa_gsi_chan_err_cb;
|
gsi_channel_props.err_cb = ipa_gsi_chan_err_cb;
|
||||||
|
@@ -289,6 +289,7 @@ static int ipa_mhi_start_gsi_channel(enum ipa_client_type client,
|
|||||||
else
|
else
|
||||||
ch_props.use_db_eng = GSI_CHAN_DB_MODE;
|
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.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
||||||
ch_props.low_weight = 1;
|
ch_props.low_weight = 1;
|
||||||
ch_props.prefetch_mode = ep_cfg->prefetch_mode;
|
ch_props.prefetch_mode = ep_cfg->prefetch_mode;
|
||||||
|
@@ -151,6 +151,7 @@ static int ipa3_setup_wdi3_gsi_channel(u8 is_smmu_enabled,
|
|||||||
} else
|
} else
|
||||||
gsi_channel_props.ch_id = gsi_ep_info->ipa_gsi_chan_num;
|
gsi_channel_props.ch_id = gsi_ep_info->ipa_gsi_chan_num;
|
||||||
|
|
||||||
|
gsi_channel_props.db_in_bytes = 0;
|
||||||
gsi_channel_props.evt_ring_hdl = ep->gsi_evt_ring_hdl;
|
gsi_channel_props.evt_ring_hdl = ep->gsi_evt_ring_hdl;
|
||||||
gsi_channel_props.re_size = GSI_CHAN_RE_SIZE_16B;
|
gsi_channel_props.re_size = GSI_CHAN_RE_SIZE_16B;
|
||||||
gsi_channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
gsi_channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
||||||
|
@@ -683,6 +683,7 @@ static int ipa3_wigig_config_gsi(bool Rx,
|
|||||||
channel_props.evt_ring_hdl = ep->gsi_evt_ring_hdl;
|
channel_props.evt_ring_hdl = ep->gsi_evt_ring_hdl;
|
||||||
channel_props.xfer_cb = NULL;
|
channel_props.xfer_cb = NULL;
|
||||||
|
|
||||||
|
channel_props.db_in_bytes = 0;
|
||||||
channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
||||||
channel_props.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
channel_props.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
||||||
channel_props.prefetch_mode = ep_gsi->prefetch_mode;
|
channel_props.prefetch_mode = ep_gsi->prefetch_mode;
|
||||||
|
@@ -418,6 +418,7 @@ struct gsi_chan_props {
|
|||||||
uint16_t ring_len;
|
uint16_t ring_len;
|
||||||
uint16_t max_re_expected;
|
uint16_t max_re_expected;
|
||||||
uint64_t ring_base_addr;
|
uint64_t ring_base_addr;
|
||||||
|
uint8_t db_in_bytes;
|
||||||
void *ring_base_vaddr;
|
void *ring_base_vaddr;
|
||||||
enum gsi_chan_use_db_eng use_db_eng;
|
enum gsi_chan_use_db_eng use_db_eng;
|
||||||
enum gsi_max_prefetch max_prefetch;
|
enum gsi_max_prefetch max_prefetch;
|
||||||
|
Reference in New Issue
Block a user