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

Commit 8350c46b authored by Chaitanya Pratapa's avatar Chaitanya Pratapa
Browse files

msm: ipa: Add mechanism to check if FW is already loaded via XBL



Add changes to runtime detect if IPA FW is loaded via XBL
instead of relying just using DT. This is to ensure even
if DT entry is present we proceed only if FW is really loaded.

Change-Id: Ie06f2c5df5c63e6b466f054262011d1148677806
Signed-off-by: default avatarChaitanya Pratapa <cpratapa@codeaurora.org>
parent c67cb625
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -1012,6 +1012,29 @@ int gsi_unmap_base(void)
}
EXPORT_SYMBOL(gsi_unmap_base);

int gsi_is_mcs_enabled(void)
{
	uint32_t mcs_enable = 0;

	if (!gsi_ctx) {
		pr_err("%s:%d gsi context not allocated\n", __func__, __LINE__);
		return GSI_STATUS_NODEV;
	}

	if (!gsi_ctx->base) {
		GSIERR("GSI base is not mapped\n");
		return -GSI_STATUS_NODEV;
	}

	mcs_enable = gsi_readl(gsi_ctx->base + GSI_GSI_MCS_CFG_OFFS);

	pr_info("%s:%d MCS enabled:%x\n", __func__, __LINE__, mcs_enable);

	return (mcs_enable & GSI_GSI_MCS_CFG_MCS_ENABLE_BMSK);
}
EXPORT_SYMBOL(gsi_is_mcs_enabled);


int gsi_register_device(struct gsi_per_props *props, unsigned long *dev_hdl)
{
	int res;
+1 −1
Original line number Diff line number Diff line
@@ -8406,7 +8406,7 @@ int ipa3_plat_drv_probe(struct platform_device *pdev_p,
		cb->dev = dev;
		smmu_info.present[IPA_SMMU_CB_UC] = true;

		if (ipa3_ctx->use_xbl_boot) {
		if (ipa3_ctx->use_xbl_boot && (gsi_is_mcs_enabled() == 1)) {
			/* Ensure uC probe is the last. */
			if (!smmu_info.present[IPA_SMMU_CB_AP] ||
				!smmu_info.present[IPA_SMMU_CB_WLAN]) {
+14 −0
Original line number Diff line number Diff line
@@ -1168,6 +1168,15 @@ struct gsi_chan_info {
 */
int gsi_register_device(struct gsi_per_props *props, unsigned long *dev_hdl);

/**
 * gsi_is_mcs_enabled - Peripheral should call this function to
 * check if MCS is already loaded.
 *
 * @Return -GSI_STATUS_NODEV if node is already created.
 *	   other error codes for failure
 */
int gsi_is_mcs_enabled(void);

/**
 * gsi_complete_clk_grant - Peripheral should call this function to
 * grant the clock resource requested by GSI previously that could not
@@ -1822,6 +1831,11 @@ static inline int gsi_register_device(struct gsi_per_props *props,
	return -GSI_STATUS_UNSUPPORTED_OP;
}

static inline int gsi_is_mcs_enabled(void)
{
	return -GSI_STATUS_UNSUPPORTED_OP;
}

static inline int gsi_complete_clk_grant(unsigned long dev_hdl)
{
	return -GSI_STATUS_UNSUPPORTED_OP;