From patchwork Wed Nov 16 17:01:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dwivedi, Avaneesh Kumar (avani)" X-Patchwork-Id: 9432219 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 133FD60476 for ; Wed, 16 Nov 2016 17:02:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0241428F6C for ; Wed, 16 Nov 2016 17:02:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB58628FB3; Wed, 16 Nov 2016 17:02:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F6E128F6C for ; Wed, 16 Nov 2016 17:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753509AbcKPRCR (ORCPT ); Wed, 16 Nov 2016 12:02:17 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57948 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270AbcKPRCP (ORCPT ); Wed, 16 Nov 2016 12:02:15 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E5B6B6151E; Wed, 16 Nov 2016 17:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479315735; bh=0Oa+fl0JKgUvUv7Fd+eafrWfNYzkqhqpCB926C0jt+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LHXh+KOywBC9w2oSk6fDUcVzl2Q5wempWy+DRO6md0mKIWy/HHS6CpV/9XId6go8I ZJPdiZ2ps6x0uFGAhptkPhfWapbNLFgr7nr3+hVB0dC6PMVuvdg2DjHKUNckNkQS04 cPAiiY7EQ44YYR3UM1I0IRMmtqG4dSyXXaKf8lfI= Received: from akdwived-linux.qualcomm.com (unknown [202.46.23.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akdwived@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A20A3614FB; Wed, 16 Nov 2016 17:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479315731; bh=0Oa+fl0JKgUvUv7Fd+eafrWfNYzkqhqpCB926C0jt+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gk2nw8XW1hU4Chz09x9qgfiWwBZqlDKNa4wYw6R3O10QOxsG0bTLSHNgzfLrYTSdF wcAfynKohDVWHAFCiG160qIuZDroeHHodll6n1XR+3/CtAkzmEgrpIJncKmrFsQRgq CIf27GYk+9b6SZc7L2YDWD+JZsZUB1Q2qo4zJHrc= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org A20A3614FB Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=akdwived@codeaurora.org From: Avaneesh Kumar Dwivedi To: bjorn.andersson@linaro.org Cc: sboyd@codeaurora.org, agross@codeaurora.org, linux-arm-msm@vger.kernel.org, Avaneesh Kumar Dwivedi Subject: [PATCH v4 09/10] remoteproc: qcom: Modify stop routine for q6v56 specific step Date: Wed, 16 Nov 2016 22:31:35 +0530 Message-Id: <1479315696-15490-10-git-send-email-akdwived@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1479315696-15490-1-git-send-email-akdwived@codeaurora.org> References: <1479315696-15490-1-git-send-email-akdwived@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/remoteproc/qcom_q6v5_pil.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 3fccde4..3135832 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -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 {