summaryrefslogtreecommitdiff
path: root/drivers/bus/mhi/core/pm.c
diff options
context:
space:
mode:
authorCarl Yin <carl.yin@quectel.com>2021-03-29 18:28:21 -0700
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2021-03-31 16:50:49 +0530
commit66ac7985b2af310aaca14869d6e43b0290e98c07 (patch)
treea77756476f5daa2e80f46df881238d3a377aea07 /drivers/bus/mhi/core/pm.c
parentad416db9fabe43b53a80deb4444d2a2e246b1cf1 (diff)
bus: mhi: core: Add support for Flash Programmer execution environment
MHI WWAN modems support downloading firmware to NAND or eMMC using Firehose protocol with process as follows: 1. Modem boots up, enters AMSS execution environment and the device later enters EDL (Emergency Download) mode through any mechanism host can use such as a diag command. 2. Modem enters SYS_ERROR, MHI host handles SYS_ERROR transition. 3. EDL image for device to enter 'Flash Programmer' execution environment is then flashed via BHI interface from host. 4. Modem enters MHI READY -> M0 and sends the Flash Programmer execution environment change to host. 5. Following that, EDL/FIREHOSE channels (34, 35) are made available from the host. 6. User space tool for downloading firmware image to modem over the EDL channels using Firehose protocol. Link to USB flashing tool: https://git.linaro.org/landing-teams/working/qualcomm/qdl.git/ Make the necessary changes to allow for this sequence to occur and allow using the Flash Programmer execution environment. Signed-off-by: Carl Yin <carl.yin@quectel.com> Co-developed-by: Bhaumik Bhatt <bbhatt@codeaurora.org> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org> Reviewed-by: Loic Poulain <loic.poulain@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/1617067704-28850-5-git-send-email-bbhatt@codeaurora.org Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Diffstat (limited to 'drivers/bus/mhi/core/pm.c')
-rw-r--r--drivers/bus/mhi/core/pm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
index b65222eda5e6..7ac9dfe54895 100644
--- a/drivers/bus/mhi/core/pm.c
+++ b/drivers/bus/mhi/core/pm.c
@@ -782,6 +782,12 @@ void mhi_pm_st_worker(struct work_struct *work)
case DEV_ST_TRANSITION_MISSION_MODE:
mhi_pm_mission_mode_transition(mhi_cntrl);
break;
+ case DEV_ST_TRANSITION_FP:
+ write_lock_irq(&mhi_cntrl->pm_lock);
+ mhi_cntrl->ee = MHI_EE_FP;
+ write_unlock_irq(&mhi_cntrl->pm_lock);
+ mhi_create_devices(mhi_cntrl);
+ break;
case DEV_ST_TRANSITION_READY:
mhi_ready_state_transition(mhi_cntrl);
break;