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

Commit f02a0729 authored by Amir Levy's avatar Amir Levy Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarEliad Ben Yishay <ebenyish@qti.qualcomm.com>
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent e348baa3
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -5693,7 +5693,7 @@ static int ipa3_gsi_pre_fw_load_init(void)


	result = gsi_configure_regs(
	result = gsi_configure_regs(
		ipa3_res.ipa_mem_base,
		ipa3_res.ipa_mem_base,
		ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
		ipa3_ctx->gsi_ver);


	if (result) {
	if (result) {
		IPAERR("Failed to configure GSI registers\n");
		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);
		ipa3_disable_prefetch(IPA_CLIENT_MHI_CONS);


	memset(&gsi_props, 0, sizeof(gsi_props));
	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.ee = resource_p->ee;
	gsi_props.intr = GSI_INTR_IRQ;
	gsi_props.intr = GSI_INTR_IRQ;
	gsi_props.phys_addr = resource_p->transport_mem_base;
	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
	/* GSI 2.2 requires to allocate all EE GSI channel
	 * during device bootup.
	 * 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();
		result = ipa3_alloc_gsi_channel();
		if (result) {
		if (result) {
			IPAERR("Failed to alloc the GSI channels\n");
			IPAERR("Failed to alloc the GSI channels\n");
@@ -6148,6 +6148,7 @@ static int ipa3_manual_load_ipa_fws(void)
	int result;
	int result;
	const struct firmware *fw;
	const struct firmware *fw;
	const char *path = IPA_FWS_PATH;
	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) {
	if (ipa3_ctx->ipa3_hw_mode == IPA_HW_MODE_EMULATION) {
		switch (ipa3_get_emulation_type()) {
		switch (ipa3_get_emulation_type()) {
@@ -6179,10 +6180,10 @@ static int ipa3_manual_load_ipa_fws(void)
		result = emulator_load_fws(fw,
		result = emulator_load_fws(fw,
			ipa3_res.transport_mem_base,
			ipa3_res.transport_mem_base,
			ipa3_res.transport_mem_size,
			ipa3_res.transport_mem_size,
			ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
			gsi_ver);
	} else {
	} else {
		result = ipa3_load_fws(fw, ipa3_res.transport_mem_base,
		result = ipa3_load_fws(fw, ipa3_res.transport_mem_base,
			ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
			gsi_ver);
	}
	}


	if (result) {
	if (result) {
@@ -6193,7 +6194,7 @@ static int ipa3_manual_load_ipa_fws(void)


	result = gsi_enable_fw(ipa3_res.transport_mem_base,
	result = gsi_enable_fw(ipa3_res.transport_mem_base,
				ipa3_res.transport_mem_size,
				ipa3_res.transport_mem_size,
				ipa3_get_gsi_ver(ipa3_res.ipa_hw_type));
				gsi_ver);
	if (result) {
	if (result) {
		IPAERR("Failed to enable GSI FW\n");
		IPAERR("Failed to enable GSI FW\n");
		release_firmware(fw);
		release_firmware(fw);
@@ -8596,6 +8597,9 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p,
		return result;
		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);
	result = ipa3_bind_api_controller(ipa3_res.ipa_hw_type, api_ctrl);
	if (result) {
	if (result) {
		IPAERR("IPA API binding failed\n");
		IPAERR("IPA API binding failed\n");
+2 −0
Original line number Original line Diff line number Diff line
@@ -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: 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')
 * @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)
 * @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
 * @use_ipa_teth_bridge: use tethering bridge driver
 * @modem_cfg_emb_pipe_flt: modem configure embedded pipe filtering rules
 * @modem_cfg_emb_pipe_flt: modem configure embedded pipe filtering rules
 * @logbuf: ipc log buffer for high priority messages
 * @logbuf: ipc log buffer for high priority messages
@@ -1988,6 +1989,7 @@ struct ipa3_context {
	enum ipa_hw_type ipa_hw_type;
	enum ipa_hw_type ipa_hw_type;
	u8 hw_type_index;
	u8 hw_type_index;
	enum ipa3_hw_mode ipa3_hw_mode;
	enum ipa3_hw_mode ipa3_hw_mode;
	enum gsi_ver gsi_ver;
	enum ipa3_platform_type platform_type;
	enum ipa3_platform_type platform_type;
	bool ipa_config_is_mhi;
	bool ipa_config_is_mhi;
	bool use_ipa_teth_bridge;
	bool use_ipa_teth_bridge;