msm: ipa3: Cache gsi_ver

Caching gsi_ver in static global variable ipa3_res.
Added gsi_ver to struct ipa3_plat_drv_res.
Caching gsi_ver in function ipa3_post_init in gsi_props of type
struct gsi_per_props.

Change-Id: I63e286d907be8d6151ed3a19bb1ef3c0601b9dc7
Acked-by: Eliad Ben Yishay <ebenyish@qti.qualcomm.com>
Signed-off-by: Amir Levy <alevy@codeaurora.org>
This commit is contained in:
Amir Levy 2020-06-23 17:08:36 +03:00 • committed by Gerrit - the friendly Code Review server
commit f02a072963
2 changed files with 12 additions and 6 deletions

View file

@ -5693,7 +5693,7 @@ static int ipa3_gsi_pre_fw_load_init(void)
result = gsi_configure_regs(
ipa3_res.ipa_mem_base,
ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
ipa3_ctx->gsi_ver);
if (result) {
IPAERR("Failed to configure GSI registers\n");
@ -5996,7 +5996,7 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p,
ipa3_disable_prefetch(IPA_CLIENT_MHI_CONS);
memset(&gsi_props, 0, sizeof(gsi_props));
gsi_props.ver = ipa3_get_gsi_ver(resource_p->ipa_hw_type);
gsi_props.ver = ipa3_ctx->gsi_ver;
gsi_props.ee = resource_p->ee;
gsi_props.intr = GSI_INTR_IRQ;
gsi_props.phys_addr = resource_p->transport_mem_base;
@ -6035,7 +6035,7 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p,
/* GSI 2.2 requires to allocate all EE GSI channel
* during device bootup.
*/
if (ipa3_get_gsi_ver(resource_p->ipa_hw_type) == GSI_VER_2_2) {
if (gsi_props.ver == GSI_VER_2_2) {
result = ipa3_alloc_gsi_channel();
if (result) {
IPAERR("Failed to alloc the GSI channels\n");
@ -6148,6 +6148,7 @@ static int ipa3_manual_load_ipa_fws(void)
int result;
const struct firmware *fw;
const char *path = IPA_FWS_PATH;
enum gsi_ver gsi_ver = ipa3_ctx->gsi_ver;
if (ipa3_ctx->ipa3_hw_mode == IPA_HW_MODE_EMULATION) {
switch (ipa3_get_emulation_type()) {
@ -6179,10 +6180,10 @@ static int ipa3_manual_load_ipa_fws(void)
result = emulator_load_fws(fw,
ipa3_res.transport_mem_base,
ipa3_res.transport_mem_size,
ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
gsi_ver);
} else {
result = ipa3_load_fws(fw, ipa3_res.transport_mem_base,
ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
gsi_ver);
}
if (result) {
@ -6193,7 +6194,7 @@ static int ipa3_manual_load_ipa_fws(void)
result = gsi_enable_fw(ipa3_res.transport_mem_base,
ipa3_res.transport_mem_size,
ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
gsi_ver);
if (result) {
IPAERR("Failed to enable GSI FW\n");
release_firmware(fw);
@ -8596,6 +8597,9 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p,
return result;
}
/* Get GSI version */
ipa3_ctx->gsi_ver = ipa3_get_gsi_ver(ipa3_res.ipa_hw_type);
result = ipa3_bind_api_controller(ipa3_res.ipa_hw_type, api_ctrl);
if (result) {
IPAERR("IPA API binding failed\n");

View file

@ -1868,6 +1868,7 @@ struct ipa3_app_clock_vote {
* @ipa_hw_type: type of IPA HW type (e.g. IPA 1.0, IPA 1.1 etc')
* @ipa_hw_type_index: index of IPA HW type (e.g. IPA_4_0, IPA_4_0_MHI etc')
* @ipa3_hw_mode: mode of IPA HW mode (e.g. Normal, Virtual or over PCIe)
* @gsi_ver: version of GSI
* @use_ipa_teth_bridge: use tethering bridge driver
* @modem_cfg_emb_pipe_flt: modem configure embedded pipe filtering rules
* @logbuf: ipc log buffer for high priority messages
@ -1988,6 +1989,7 @@ struct ipa3_context {
enum ipa_hw_type ipa_hw_type;
u8 hw_type_index;
enum ipa3_hw_mode ipa3_hw_mode;
enum gsi_ver gsi_ver;
enum ipa3_platform_type platform_type;
bool ipa_config_is_mhi;
bool use_ipa_teth_bridge;