mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
Merge "msm: gsi: gsi channel QoS register update"
This commit is contained in:
commit
ffa1b3486d
9 changed files with 154 additions and 3 deletions
|
|
@ -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) |
|
||||
((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_BMSK));
|
||||
GSI_EE_n_GSI_CH_k_QOS_USE_DB_ENG_BMSK));
|
||||
if (gsi_ctx->per.ver >= GSI_VER_2_0)
|
||||
val |= ((props->prefetch_mode <<
|
||||
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));
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -3439,6 +3439,103 @@ static struct ipa3_mem_partition ipa_4_7_mem_part = {
|
|||
.end_ofst = 0x3000,
|
||||
};
|
||||
|
||||
static struct ipa3_mem_partition ipa_4_9_mem_part = {
|
||||
.uc_info_ofst = 0x80,
|
||||
.uc_info_size = 0x200,
|
||||
.ofst_start = 0x280,
|
||||
.v4_flt_hash_ofst = 0x288,
|
||||
.v4_flt_hash_size = 0x78,
|
||||
.v4_flt_hash_size_ddr = 0x4000,
|
||||
.v4_flt_nhash_ofst = 0x308,
|
||||
.v4_flt_nhash_size = 0x78,
|
||||
.v4_flt_nhash_size_ddr = 0x4000,
|
||||
.v6_flt_hash_ofst = 0x388,
|
||||
.v6_flt_hash_size = 0x78,
|
||||
.v6_flt_hash_size_ddr = 0x4000,
|
||||
.v6_flt_nhash_ofst = 0x408,
|
||||
.v6_flt_nhash_size = 0x78,
|
||||
.v6_flt_nhash_size_ddr = 0x4000,
|
||||
.v4_rt_num_index = 0xf,
|
||||
.v4_modem_rt_index_lo = 0x0,
|
||||
.v4_modem_rt_index_hi = 0x7,
|
||||
.v4_apps_rt_index_lo = 0x8,
|
||||
.v4_apps_rt_index_hi = 0xe,
|
||||
.v4_rt_hash_ofst = 0x488,
|
||||
.v4_rt_hash_size = 0x78,
|
||||
.v4_rt_hash_size_ddr = 0x4000,
|
||||
.v4_rt_nhash_ofst = 0x508,
|
||||
.v4_rt_nhash_size = 0x78,
|
||||
.v4_rt_nhash_size_ddr = 0x4000,
|
||||
.v6_rt_num_index = 0xf,
|
||||
.v6_modem_rt_index_lo = 0x0,
|
||||
.v6_modem_rt_index_hi = 0x7,
|
||||
.v6_apps_rt_index_lo = 0x8,
|
||||
.v6_apps_rt_index_hi = 0xe,
|
||||
.v6_rt_hash_ofst = 0x588,
|
||||
.v6_rt_hash_size = 0x78,
|
||||
.v6_rt_hash_size_ddr = 0x4000,
|
||||
.v6_rt_nhash_ofst = 0x608,
|
||||
.v6_rt_nhash_size = 0x78,
|
||||
.v6_rt_nhash_size_ddr = 0x4000,
|
||||
.modem_hdr_ofst = 0x688,
|
||||
.modem_hdr_size = 0x240,
|
||||
.apps_hdr_ofst = 0x8c8,
|
||||
.apps_hdr_size = 0x200,
|
||||
.apps_hdr_size_ddr = 0x800,
|
||||
.modem_hdr_proc_ctx_ofst = 0xad0,
|
||||
.modem_hdr_proc_ctx_size = 0xb20,
|
||||
.apps_hdr_proc_ctx_ofst = 0x15f0,
|
||||
.apps_hdr_proc_ctx_size = 0x200,
|
||||
.apps_hdr_proc_ctx_size_ddr = 0x0,
|
||||
.nat_tbl_ofst = 0x1800,
|
||||
.nat_tbl_size = 0x800,
|
||||
.nat_index_tbl_ofst = 0x2000,
|
||||
.nat_index_tbl_size = 0x100,
|
||||
.nat_exp_tbl_ofst = 0x2100,
|
||||
.nat_exp_tbl_size = 0x400,
|
||||
.stats_quota_ofst = 0x2510,
|
||||
.stats_quota_size = 0x78,
|
||||
.stats_tethering_ofst = 0x2588,
|
||||
.stats_tethering_size = 0x238,
|
||||
.stats_flt_v4_ofst = 0,
|
||||
.stats_flt_v4_size = 0,
|
||||
.stats_flt_v6_ofst = 0,
|
||||
.stats_flt_v6_size = 0,
|
||||
.stats_rt_v4_ofst = 0,
|
||||
.stats_rt_v4_size = 0,
|
||||
.stats_rt_v6_ofst = 0,
|
||||
.stats_rt_v6_size = 0,
|
||||
.stats_fnr_ofst = 0x27c0,
|
||||
.stats_fnr_size = 0x800,
|
||||
.stats_drop_ofst = 0x2fc0,
|
||||
.stats_drop_size = 0x20,
|
||||
.modem_comp_decomp_ofst = 0x0,
|
||||
.modem_comp_decomp_size = 0x0,
|
||||
.modem_ofst = 0x2fe8,
|
||||
.modem_size = 0x800,
|
||||
.apps_v4_flt_hash_ofst = 0x2718,
|
||||
.apps_v4_flt_hash_size = 0x0,
|
||||
.apps_v4_flt_nhash_ofst = 0x2718,
|
||||
.apps_v4_flt_nhash_size = 0x0,
|
||||
.apps_v6_flt_hash_ofst = 0x2718,
|
||||
.apps_v6_flt_hash_size = 0x0,
|
||||
.apps_v6_flt_nhash_ofst = 0x2718,
|
||||
.apps_v6_flt_nhash_size = 0x0,
|
||||
.apps_v4_rt_hash_ofst = 0x2718,
|
||||
.apps_v4_rt_hash_size = 0x0,
|
||||
.apps_v4_rt_nhash_ofst = 0x2718,
|
||||
.apps_v4_rt_nhash_size = 0x0,
|
||||
.apps_v6_rt_hash_ofst = 0x2718,
|
||||
.apps_v6_rt_hash_size = 0x0,
|
||||
.apps_v6_rt_nhash_ofst = 0x2718,
|
||||
.apps_v6_rt_nhash_size = 0x0,
|
||||
.uc_descriptor_ram_ofst = 0x3800,
|
||||
.uc_descriptor_ram_size = 0x1000,
|
||||
.pdn_config_ofst = 0x4800,
|
||||
.pdn_config_size = 0x50,
|
||||
.end_ofst = 0x4850,
|
||||
};
|
||||
|
||||
/**
|
||||
* ipa3_get_clients_from_rm_resource() - get IPA clients which are related to an
|
||||
* IPA_RM resource
|
||||
|
|
@ -5796,9 +5893,11 @@ int ipa3_init_mem_partition(enum ipa_hw_type type)
|
|||
ipa3_ctx->ctrl->mem_partition = &ipa_4_5_mem_part;
|
||||
break;
|
||||
case IPA_HW_v4_7:
|
||||
case IPA_HW_v4_9:
|
||||
ipa3_ctx->ctrl->mem_partition = &ipa_4_7_mem_part;
|
||||
break;
|
||||
case IPA_HW_v4_9:
|
||||
ipa3_ctx->ctrl->mem_partition = &ipa_4_9_mem_part;
|
||||
break;
|
||||
case IPA_HW_None:
|
||||
case IPA_HW_v1_0:
|
||||
case IPA_HW_v1_1:
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ static int ipa3_setup_wdi3_gsi_channel(u8 is_smmu_enabled,
|
|||
} else
|
||||
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.re_size = GSI_CHAN_RE_SIZE_16B;
|
||||
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.xfer_cb = NULL;
|
||||
|
||||
channel_props.db_in_bytes = 0;
|
||||
channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
||||
channel_props.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
||||
channel_props.prefetch_mode = ep_gsi->prefetch_mode;
|
||||
|
|
|
|||
|
|
@ -418,6 +418,7 @@ struct gsi_chan_props {
|
|||
uint16_t ring_len;
|
||||
uint16_t max_re_expected;
|
||||
uint64_t ring_base_addr;
|
||||
uint8_t db_in_bytes;
|
||||
void *ring_base_vaddr;
|
||||
enum gsi_chan_use_db_eng use_db_eng;
|
||||
enum gsi_max_prefetch max_prefetch;
|
||||
|
|
|
|||
Loading…
Reference in a new issue