diff options
-rw-r--r-- | drivers/remoteproc/qcom_q6v5_mss.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 325a3f2c35bd..a839b07a58b1 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -149,6 +149,7 @@ struct q6v5 { u32 halt_nc; struct reset_control *mss_restart; + struct reset_control *pdc_reset; struct qcom_q6v5 q6v5; @@ -347,10 +348,17 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw) static int q6v5_reset_assert(struct q6v5 *qproc) { - if (qproc->has_alt_reset) - return reset_control_reset(qproc->mss_restart); - else - return reset_control_assert(qproc->mss_restart); + int ret; + + if (qproc->has_alt_reset) { + reset_control_assert(qproc->pdc_reset); + ret = reset_control_reset(qproc->mss_restart); + reset_control_deassert(qproc->pdc_reset); + } else { + ret = reset_control_assert(qproc->mss_restart); + } + + return ret; } static int q6v5_reset_deassert(struct q6v5 *qproc) @@ -358,9 +366,11 @@ static int q6v5_reset_deassert(struct q6v5 *qproc) int ret; if (qproc->has_alt_reset) { + reset_control_assert(qproc->pdc_reset); writel(1, qproc->rmb_base + RMB_MBA_ALT_RESET); ret = reset_control_reset(qproc->mss_restart); writel(0, qproc->rmb_base + RMB_MBA_ALT_RESET); + reset_control_deassert(qproc->pdc_reset); } else { ret = reset_control_deassert(qproc->mss_restart); } @@ -1072,6 +1082,15 @@ static int q6v5_init_reset(struct q6v5 *qproc) return PTR_ERR(qproc->mss_restart); } + if (qproc->has_alt_reset) { + qproc->pdc_reset = devm_reset_control_get_exclusive(qproc->dev, + "pdc_reset"); + if (IS_ERR(qproc->pdc_reset)) { + dev_err(qproc->dev, "failed to acquire pdc reset\n"); + return PTR_ERR(qproc->pdc_reset); + } + } + return 0; } @@ -1192,12 +1211,12 @@ static int q6v5_probe(struct platform_device *pdev) } qproc->active_reg_count = ret; + qproc->has_alt_reset = desc->has_alt_reset; ret = q6v5_init_reset(qproc); if (ret) goto free_rproc; qproc->version = desc->version; - qproc->has_alt_reset = desc->has_alt_reset; qproc->need_mem_protection = desc->need_mem_protection; ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM, |