@@ -811,7 +811,7 @@ static int q6v5_start(struct rproc *rproc)
static int q6v5_stop(struct rproc *rproc)
{
struct q6v5 *qproc = (struct q6v5 *)rproc->priv;
- int ret;
+ int ret, val;
qproc->running = false;
@@ -829,6 +829,23 @@ static int q6v5_stop(struct rproc *rproc)
q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_modem);
q6v5proc_halt_axi_port(qproc, qproc->halt_map, qproc->halt_nc);
+ if (qproc->qdsp6v56_1_5) {
+ /*
+ * Assert QDSP6 I/O clamp, memory wordline clamp, and compiler
+ * memory clamp as a software workaround to avoid high MX
+ * current during LPASS/MSS restart.
+ */
+ ret = clk_prepare_enable(devm_clk_get(qproc->dev, "iface"));
+ if (!ret) {
+ val = readl_relaxed(
+ qproc->reg_base + QDSP6SS_PWR_CTL_REG);
+ val |= (Q6SS_CLAMP_IO | QDSP6v56_CLAMP_WL |
+ QDSP6v56_CLAMP_QMC_MEM);
+ writel_relaxed(val,
+ qproc->reg_base + QDSP6SS_PWR_CTL_REG);
+ }
+ }
+
if (qproc->qdsp6v56_1_5)
pil_mss_restart_reg(qproc, 1);
else {
for q6v56 compatible mss chip, certain version of hexagon chip require to limit high MX current during restart, so this additional step. Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org> --- drivers/remoteproc/qcom_q6v5_pil.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)