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

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

msm: ipa: fix GSI enable for GSI 1.2



GSI version is not passed correctly to GSI driver in order
to enable MCS.

Change-Id: I00f456de830c84dcf736eea5332c501bd15f4aef
CRs-Fixed: 1097871
Acked-by: default avatarAdy Abraham <adya@qti.qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent 25f739ab
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -2700,11 +2700,16 @@ int gsi_configure_regs(phys_addr_t gsi_base_addr, u32 gsi_size,
}
}
EXPORT_SYMBOL(gsi_configure_regs);
EXPORT_SYMBOL(gsi_configure_regs);


int gsi_enable_fw(phys_addr_t gsi_base_addr, u32 gsi_size)
int gsi_enable_fw(phys_addr_t gsi_base_addr, u32 gsi_size, enum gsi_ver ver)
{
{
	void __iomem *gsi_base;
	void __iomem *gsi_base;
	uint32_t value;
	uint32_t value;


	if (ver <= GSI_VER_ERR || ver >= GSI_VER_MAX) {
		GSIERR("Incorrect version %d\n", ver);
		return -GSI_STATUS_ERROR;
	}

	gsi_base = ioremap_nocache(gsi_base_addr, gsi_size);
	gsi_base = ioremap_nocache(gsi_base_addr, gsi_size);
	if (!gsi_base) {
	if (!gsi_base) {
		GSIERR("ioremap failed for 0x%pa\n", &gsi_base_addr);
		GSIERR("ioremap failed for 0x%pa\n", &gsi_base_addr);
@@ -2712,7 +2717,7 @@ int gsi_enable_fw(phys_addr_t gsi_base_addr, u32 gsi_size)
	}
	}


	/* Enable the MCS and set to x2 clocks */
	/* Enable the MCS and set to x2 clocks */
	if (gsi_ctx->per.ver >= GSI_VER_1_2) {
	if (ver >= GSI_VER_1_2) {
		value = ((1 << GSI_GSI_MCS_CFG_MCS_ENABLE_SHFT) &
		value = ((1 << GSI_GSI_MCS_CFG_MCS_ENABLE_SHFT) &
				GSI_GSI_MCS_CFG_MCS_ENABLE_BMSK);
				GSI_GSI_MCS_CFG_MCS_ENABLE_BMSK);
		gsi_writel(value, gsi_base + GSI_GSI_MCS_CFG_OFFS);
		gsi_writel(value, gsi_base + GSI_GSI_MCS_CFG_OFFS);
+2 −1
Original line number Original line Diff line number Diff line
@@ -4046,7 +4046,8 @@ static int ipa3_trigger_fw_loading_mdms(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));
	if (result) {
	if (result) {
		IPAERR("Failed to enable GSI FW\n");
		IPAERR("Failed to enable GSI FW\n");
		release_firmware(fw);
		release_firmware(fw);
+2 −1
Original line number Original line Diff line number Diff line
@@ -1035,10 +1035,11 @@ int gsi_configure_regs(phys_addr_t gsi_base_addr, u32 gsi_size,
 *
 *
 * @gsi_base_addr: Base address of GSI register space
 * @gsi_base_addr: Base address of GSI register space
 * @gsi_size: Mapping size of the GSI register space
 * @gsi_size: Mapping size of the GSI register space
 * @ver: GSI core version


 * @Return gsi_status
 * @Return gsi_status
 */
 */
int gsi_enable_fw(phys_addr_t gsi_base_addr, u32 gsi_size);
int gsi_enable_fw(phys_addr_t gsi_base_addr, u32 gsi_size, enum gsi_ver ver);


/**
/**
 * gsi_get_inst_ram_offset_and_size - Peripheral should call this function
 * gsi_get_inst_ram_offset_and_size - Peripheral should call this function