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

Commit e4c3f82c authored by Bhaumik Bhatt's avatar Bhaumik Bhatt
Browse files

mhi: core: Use appropriate names for BHI/BHIe firmware load functions



mhi_fw_load_sbl() function is currently used to transfer SBL or EDL
images over BHI (Boot Host Interface). Same goes with mhi_fw_load_amss()
which uses BHIe. However, the contents do not indicate support for a
specific set of images. Since these can be used for any image download
over BHI or BHIe, we should rename them based on the protocol used.

Change-Id: I108aec270c0ae915cae5e08710402962a723cf0f
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 5e803bd9
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -300,7 +300,7 @@ int mhi_download_rddm_img(struct mhi_controller *mhi_cntrl, bool in_panic)
}
EXPORT_SYMBOL(mhi_download_rddm_img);

static int mhi_fw_load_amss(struct mhi_controller *mhi_cntrl,
static int mhi_fw_load_bhie(struct mhi_controller *mhi_cntrl,
			    const struct mhi_buf *mhi_buf)
{
	void __iomem *base = mhi_cntrl->bhie;
@@ -355,7 +355,7 @@ static int mhi_fw_load_amss(struct mhi_controller *mhi_cntrl,
	return (tx_status == BHIE_TXVECSTATUS_STATUS_XFER_COMPL) ? 0 : -EIO;
}

static int mhi_fw_load_sbl(struct mhi_controller *mhi_cntrl,
static int mhi_fw_load_bhi(struct mhi_controller *mhi_cntrl,
			   dma_addr_t dma_addr,
			   size_t size)
{
@@ -601,16 +601,21 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)
		return;
	}

	/* load sbl image */
	/* load sbl or edl image via BHI */
	memcpy(buf, firmware->data, size);
	ret = mhi_fw_load_sbl(mhi_cntrl, dma_addr, size);
	ret = mhi_fw_load_bhi(mhi_cntrl, dma_addr, size);
	mhi_free_coherent(mhi_cntrl, size, buf, dma_addr);

	if (!mhi_cntrl->fbc_download || ret || mhi_cntrl->ee == MHI_EE_EDL)
		release_firmware(firmware);

	/* error or in edl, we're done */
	if (ret || mhi_cntrl->ee == MHI_EE_EDL)
	if (ret) {
		MHI_CNTRL_ERR("MHI did not load SBL/EDL image, ret:%d\n", ret);
		return;
	}

	/* we are done with FW load is EE is EDL */
	if (mhi_cntrl->ee == MHI_EE_EDL)
		return;

	write_lock_irq(&mhi_cntrl->pm_lock);
@@ -665,7 +670,7 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl)

	/* start full firmware image download */
	image_info = mhi_cntrl->fbc_image;
	ret = mhi_fw_load_amss(mhi_cntrl,
	ret = mhi_fw_load_bhie(mhi_cntrl,
			       /* last entry is vec table */
			       &image_info->mhi_buf[image_info->entries - 1]);