remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA boot
Subsystems (2)
PATCH v2 1/1 remoteproc: qcom_q6v5: Assign mpss region to Q6 before MBA boot
On secure devices which support warm reset, the MBA firmware requires access to the modem region to clear them out. Hence provide Q6 access to this region before MBA boot. This will be a nop during a modem SSR.
---
V2:
* Fixup comments as suggested by Bjorn.
drivers/remoteproc/qcom_q6v5_mss.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/remoteproc/qcom_q6v5_mss.c +11 -2
@@ -931,6 +931,16 @@ static int q6v5_mba_load(struct q6v5 *qproc) goto assert_reset; } +/* Some versions of the MBA firmware will upon boot wipe the MPSS region as well, so provide +* the Q6 access to this region. +*/ + ret =q6v5_xfer_mem_ownership (qproc, &qproc->mpss_perm, false, true, + qproc->mpss_phys, qproc->mpss_size); +if (ret) { +dev_err (qproc->dev,"assigning Q6 access to mpss memory failed: %d\n" , ret); + goto disable_active_clks; + } +/* Assign MBA image access in DDR to q6 */ ret =q6v5_xfer_mem_ownership (qproc, &qproc->mba_perm, false, true, qproc->mba_phys, qproc->mba_size);
@@ -1137,8 +1147,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)/** * In case of a modem subsystem restart on secure devices, the modem -* memory can be reclaimed only after MBA is loaded. For modem cold -* boot this will be a nop +* memory can be reclaimed only after MBA is loaded. */ q6v5_xfer_mem_ownership (qproc, &qproc->mpss_perm, true, false, qproc->mpss_phys, qproc->mpss_size);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Quoting Sibi Sankar (2020-09-16 07:52:52)
Quoted 4 lines
On secure devices which support warm reset, the MBA firmware requires access to the modem region to clear them out. Hence provide Q6 access to this region before MBA boot. This will be a nop during a modem SSR.
Does it need a Fixes: tag? Probably.
Quoted 3 lines
Signed-off-by Sibi Sankar <[email protected]>---
Trivia time!
drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_mba_load(struct q6v5 *qproc) · line 934
Quoted 10 lines
drivers/remoteproc/qcom_q6v5_mss.c +1
-0@@ -931,6 +931,16 @@ static int q6v5_mba_load(struct q6v5 *qproc) goto assert_reset; } +/* Some versions of the MBA firmware will upon boot wipe the MPSS region as well, so provide
Should have /* on a line by itself.
Quoted 13 lines
drivers/remoteproc/qcom_q6v5_mss.c +9
-0+* the Q6 access to this region. +*/ + ret =q6v5_xfer_mem_ownership (qproc, &qproc->mpss_perm, false, true, + qproc->mpss_phys, qproc->mpss_size); +if (ret) { +dev_err (qproc->dev,"assigning Q6 access to mpss memory failed: %d\n" , ret); + goto disable_active_clks; + } +/* Assign MBA image access in DDR to q6 */ ret =q6v5_xfer_mem_ownership (qproc, &qproc->mba_perm, false, true, qproc->mba_phys, qproc->mba_size);
drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_mpss_load(struct q6v5 *qproc) · line 1148
Quoted 2 lines
drivers/remoteproc/qcom_q6v5_mss.c +0
-0@@ -1137,8 +1147,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)/**
Should be /* instead of /**, the latter is for kernel-doc which this is not.
Quoted 7 lines
drivers/remoteproc/qcom_q6v5_mss.c +1
-2* In case of a modem subsystem restart on secure devices, the modem -* memory can be reclaimed only after MBA is loaded. For modem cold -* boot this will be a nop +* memory can be reclaimed only after MBA is loaded. */ q6v5_xfer_mem_ownership (qproc, &qproc->mpss_perm, true, false, qproc->mpss_phys, qproc->mpss_size);
Stephen,
Thanks for taking time to review the
series.
Quoted 7 lines · Stephen Boyd
Quoting Sibi Sankar (2020-09-16 07:52:52)
Quoted 4 lines
On secure devices which support warm reset, the MBA firmware requires access to the modem region to clear them out. Hence provide Q6 access to this region before MBA boot. This will be a nop during a modem SSR.
Does it need a Fixes: tag? Probably.
it doesn't really fix anything previously
committed. When SC7180 support was added,
mss driver still lacked secure boot support
and when Bjorn added secure boot support,
none of the secure devices necessarily
supported warm reset. So I'll skip adding
fixes tag.
Quoted 40 lines
Quoted 4 lines
Signed-off-by Sibi Sankar <[email protected]>---
Trivia time!
Quoted 11 lines
drivers/remoteproc/qcom_q6v5_mss.c +1
-0@@ -931,6 +931,16 @@ static int q6v5_mba_load(struct q6v5 *qproc) goto assert_reset; } +/* Some versions of the MBA firmware will upon boot wipe the MPSS region as well, so provide
Should have /* on a line by itself.
Quoted 19 lines
drivers/remoteproc/qcom_q6v5_mss.c +3
-0+* the Q6 access to this region. +*/ + ret = q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, false,true,
+qproc->mpss_phys,qproc->mpss_size);drivers/remoteproc/qcom_q6v5_mss.c +2
-0+if (ret) { + dev_err(qproc->dev, "assigning Q6 access to mpssmemory failed: %d\n", ret);
drivers/remoteproc/qcom_q6v5_mss.c +3
-0+ goto disable_active_clks; + } +/* Assign MBA image access in DDR to q6 */ ret = q6v5_xfer_mem_ownership(qproc, &qproc->mba_perm, false,true,
qproc->mba_phys,
qproc->mba_size);drivers/remoteproc/qcom_q6v5_mss.c +0
-0@@ -1137,8 +1147,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
Quoted 4 lines
drivers/remoteproc/qcom_q6v5_mss.c static int q6v5_mpss_load(struct q6v5 *qproc) · line 1148
Quoted 1 line
drivers/remoteproc/qcom_q6v5_mss.c +0
-0/** Should be /* instead of /**, the latter is for kernel-doc which this is not.
sure I'll get ^^ done in the next
re-spin.
Quoted 10 lines
Quoted 10 lines
drivers/remoteproc/qcom_q6v5_mss.c +0
-0* In case of a modem subsystem restart on secure devices, the modem
- * memory can be reclaimed only after MBA is loaded. For modem
colddrivers/remoteproc/qcom_q6v5_mss.c +1
-1-* boot this will be a nop +* memory can be reclaimed only after MBA is loaded. */ q6v5_xfer_mem_ownership (qproc, &qproc->mpss_perm, true, false, qproc->mpss_phys, qproc->mpss_size);
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.