Skip to content

Commit 0bde883

Browse files
lumaggregkh
authored andcommitted
remoteproc: qcom_q6v5_mss: support loading MBN file on msm8974
[ Upstream commit 581e3de ] On MSM8974 / APQ8074, MSM8226 and MSM8926 the MSS requires loading raw MBA image instead of the ELF file. Skip the ELF headers if mba.mbn was specified as the firmware image. Fixes: a5a4e02 ("remoteproc: qcom: Add support for parsing fw dt bindings") Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Tested-by: Luca Weiss <[email protected]> # msm8974pro-fairphone-fp2 Link: https://lore.kernel.org/r/[email protected] [bjorn: Unwrapped the long memcpy line, to taste] Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 579f4ea commit 0bde883

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/remoteproc/qcom_q6v5_mss.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ static void q6v5_debug_policy_load(struct q6v5 *qproc, void *mba_region)
498498
release_firmware(dp_fw);
499499
}
500500

501+
#define MSM8974_B00_OFFSET 0x1000
502+
501503
static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
502504
{
503505
struct q6v5 *qproc = rproc->priv;
@@ -516,7 +518,14 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
516518
return -EBUSY;
517519
}
518520

519-
memcpy(mba_region, fw->data, fw->size);
521+
if ((qproc->version == MSS_MSM8974 ||
522+
qproc->version == MSS_MSM8226 ||
523+
qproc->version == MSS_MSM8926) &&
524+
fw->size > MSM8974_B00_OFFSET &&
525+
!memcmp(fw->data, ELFMAG, SELFMAG))
526+
memcpy(mba_region, fw->data + MSM8974_B00_OFFSET, fw->size - MSM8974_B00_OFFSET);
527+
else
528+
memcpy(mba_region, fw->data, fw->size);
520529
q6v5_debug_policy_load(qproc, mba_region);
521530
memunmap(mba_region);
522531

0 commit comments

Comments
 (0)