From patchwork Thu Nov 24 10:00:37 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: 9445089 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 71454606DB for ; Thu, 24 Nov 2016 10:01:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54C0A27D0E for ; Thu, 24 Nov 2016 10:01:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4772027CAF; Thu, 24 Nov 2016 10:01:20 +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 E53A027CAF for ; Thu, 24 Nov 2016 10:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935627AbcKXKBS (ORCPT ); Thu, 24 Nov 2016 05:01:18 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:45796 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936356AbcKXKBP (ORCPT ); Thu, 24 Nov 2016 05:01:15 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id ADFE56156C; Thu, 24 Nov 2016 10:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479981664; bh=1wk9WVfw0JcQDhBvkThKjLf84RJmhHXbo43CRv5/FWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bMzCKwtQVmHfiQ/le3yRHMJHQx3HJWBpUmSpJbgzeXJPWm5pUH9BNXcpnfPgAvFjF TP2+6Rvv2p6nka3YTQ6OJIoIlNH2GOSCzpxA/LW25uGMpRxUm0SRRo738z+xNY8XGE kp9oxFXHIaSRAxGav51BByYCbkVyTDSbsA7l3n1s= 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 EE12C61443; Thu, 24 Nov 2016 10:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1479981663; bh=1wk9WVfw0JcQDhBvkThKjLf84RJmhHXbo43CRv5/FWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZynXem2AS3R+Ktc81kyGFNQosFNeXrWnDCXwfZF7CH0QxFIqqCfp0DYopQRjsKPpB r6+8UnGFGVFKrL06HPVD552O+1RHsWZ2ZVMMqaLBvtFTLH7WC54vlQ7FxoC/WCHzGD 8kMx/KRk/Z/d6hgOZthECuVwRolZ9ROttQBXBt8g= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org EE12C61443 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: [RESEND PATCH v4 6/7] remoteproc: qcom: Modify stop routine to limit MX current for v56 1.5 Date: Thu, 24 Nov 2016 15:30:37 +0530 Message-Id: <1479981638-32069-7-git-send-email-akdwived@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1479981638-32069-1-git-send-email-akdwived@codeaurora.org> References: <1479981638-32069-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 v56 1.5.0 Mx current need to be limited during restart. Signed-off-by: Avaneesh Kumar Dwivedi --- drivers/remoteproc/qcom_q6v5_pil.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 7ea2f53..3e3ed09 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c @@ -785,7 +785,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; @@ -803,6 +803,22 @@ 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->hexagon_ver & 0x2) { + /* + * 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); + } + } reset_control_assert(qproc->mss_restart); q6v5_clk_disable(qproc); q6v5_regulator_disable(qproc);