mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 23:46:14 +01:00
remoteproc: qcom_q6v5_mss: support loading MBN file on msm8974
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: a5a4e02d08 ("remoteproc: qcom: Add support for parsing fw dt bindings")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tested-by: Luca Weiss <luca@lucaweiss.eu> # msm8974pro-fairphone-fp2
Link: https://lore.kernel.org/r/20250706-msm8974-fix-mss-v4-1-630907dbd898@oss.qualcomm.com
[bjorn: Unwrapped the long memcpy line, to taste]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
parent
e65a9ed4c3
commit
581e3dea0e
1 changed files with 10 additions and 1 deletions
|
|
@ -498,6 +498,8 @@ static void q6v5_debug_policy_load(struct q6v5 *qproc, void *mba_region)
|
|||
release_firmware(dp_fw);
|
||||
}
|
||||
|
||||
#define MSM8974_B00_OFFSET 0x1000
|
||||
|
||||
static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
|
||||
{
|
||||
struct q6v5 *qproc = rproc->priv;
|
||||
|
|
@ -516,7 +518,14 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
|
|||
return -EBUSY;
|
||||
}
|
||||
|
||||
memcpy(mba_region, fw->data, fw->size);
|
||||
if ((qproc->version == MSS_MSM8974 ||
|
||||
qproc->version == MSS_MSM8226 ||
|
||||
qproc->version == MSS_MSM8926) &&
|
||||
fw->size > MSM8974_B00_OFFSET &&
|
||||
!memcmp(fw->data, ELFMAG, SELFMAG))
|
||||
memcpy(mba_region, fw->data + MSM8974_B00_OFFSET, fw->size - MSM8974_B00_OFFSET);
|
||||
else
|
||||
memcpy(mba_region, fw->data, fw->size);
|
||||
q6v5_debug_policy_load(qproc, mba_region);
|
||||
memunmap(mba_region);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue