From patchwork Fri Jan 17 13:51:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 11339209 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9678F1820 for ; Fri, 17 Jan 2020 13:52:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 754252192A for ; Fri, 17 Jan 2020 13:52:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="c7prnGGM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728911AbgAQNv4 (ORCPT ); Fri, 17 Jan 2020 08:51:56 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:33336 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728739AbgAQNvw (ORCPT ); Fri, 17 Jan 2020 08:51:52 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579269111; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=jOQ2AiNK0PTdImO2J+Y0U8b21UxBofdNZ88zGFoed5o=; b=c7prnGGMzHTwzEEq92erFZv06uWq0K9JFs77NOcpT0DARRz+27Byq8GIBqnlwpDgWxUuss1E QpHqqXnf+6eWPPt0lEBWo7QHYLOtUGq6xsJOzPXJYW6AVVYfIc1zMGzn9Zs9gSjiQzDv6A7m /TLxtInRwZQs/0MhEA//5cZVeZs= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e21bbf4.7efc141cc5a8-smtp-out-n01; Fri, 17 Jan 2020 13:51:48 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AAC46C447B8; Fri, 17 Jan 2020 13:51:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1A311C43383; Fri, 17 Jan 2020 13:51:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1A311C43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, evgreen@chromium.org, p.zabel@pengutronix.de Cc: ohad@wizery.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, agross@kernel.org, Sibi Sankar Subject: [PATCH 1/4] remoteproc: qcom: q6v5-mss: Use regmap_read_poll_timeout Date: Fri, 17 Jan 2020 19:21:27 +0530 Message-Id: <20200117135130.3605-2-sibis@codeaurora.org> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20200117135130.3605-1-sibis@codeaurora.org> References: <20200117135130.3605-1-sibis@codeaurora.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Replace the loop for HALT_ACK detection with regmap_read_poll_timeout. Signed-off-by: Sibi Sankar Reviewed-by: Philipp Zabel --- drivers/remoteproc/qcom_q6v5_mss.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 51f451311f5fc..f20b39c6ff0ed 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -73,6 +73,7 @@ #define NAV_AXI_IDLE_BIT BIT(2) #define HALT_ACK_TIMEOUT_MS 100 +#define NAV_HALT_ACK_TIMEOUT_US 200 /* QDSP6SS_RESET */ #define Q6SS_STOP_CORE BIT(0) @@ -746,7 +747,6 @@ static void q6v5proc_halt_nav_axi_port(struct q6v5 *qproc, struct regmap *halt_map, u32 offset) { - unsigned long timeout; unsigned int val; int ret; @@ -760,15 +760,11 @@ static void q6v5proc_halt_nav_axi_port(struct q6v5 *qproc, NAV_AXI_HALTREQ_BIT); /* Wait for halt ack*/ - timeout = jiffies + msecs_to_jiffies(HALT_ACK_TIMEOUT_MS); - for (;;) { - ret = regmap_read(halt_map, offset, &val); - if (ret || (val & NAV_AXI_HALTACK_BIT) || - time_after(jiffies, timeout)) - break; - - udelay(5); - } + ret = regmap_read_poll_timeout(halt_map, offset, val, + (val & NAV_AXI_HALTACK_BIT), + 5, NAV_HALT_ACK_TIMEOUT_US); + if (ret) + dev_err(qproc->dev, "nav halt ack timeout\n"); ret = regmap_read(halt_map, offset, &val); if (ret || !(val & NAV_AXI_IDLE_BIT)) From patchwork Fri Jan 17 13:51:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 11339199 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC0416C1 for ; Fri, 17 Jan 2020 13:51:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A182A2082F for ; Fri, 17 Jan 2020 13:51:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="GHbmoo+L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbgAQNvz (ORCPT ); Fri, 17 Jan 2020 08:51:55 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:47190 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728913AbgAQNvz (ORCPT ); Fri, 17 Jan 2020 08:51:55 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579269114; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=AxuWgrzG90ZthftQ+DLM+LUe/P9hM/saP5os2D5mfEY=; b=GHbmoo+LvWIBgSIMPZYyVlFE/HfIf3l6KinEiYBC99CdTgx4gNljJLIkKvn/2nEuYpppn4Cd I8Sr9nXg7HDujpXzSJojMM/9qakqNRmy00BchmW2HYqUiPYMASEh8hKfGChgmvy+yHFLvUkc AhrbAGIq7iu9HkATgsLKLI13kXI= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e21bbf8.7fd2fc92a458-smtp-out-n01; Fri, 17 Jan 2020 13:51:52 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A0969C447AD; Fri, 17 Jan 2020 13:51:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id 81D7FC447A5; Fri, 17 Jan 2020 13:51:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 81D7FC447A5 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, evgreen@chromium.org, p.zabel@pengutronix.de Cc: ohad@wizery.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, agross@kernel.org, Sibi Sankar Subject: [PATCH 2/4] remoteproc: qcom: q6v5-mss: Improve readability across clk handling Date: Fri, 17 Jan 2020 19:21:28 +0530 Message-Id: <20200117135130.3605-3-sibis@codeaurora.org> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20200117135130.3605-1-sibis@codeaurora.org> References: <20200117135130.3605-1-sibis@codeaurora.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Define CLKEN and CLKOFF for improving readability of Q6SS clock handling. Signed-off-by: Sibi Sankar Reviewed-by: Evan Green --- drivers/remoteproc/qcom_q6v5_mss.c | 32 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index f20b39c6ff0ed..e1784446d3da3 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -80,6 +80,11 @@ #define Q6SS_CORE_ARES BIT(1) #define Q6SS_BUS_ARES_ENABLE BIT(2) +/* QDSP6SS CBCR */ +#define Q6SS_CBCR_CLKEN BIT(0) +#define Q6SS_CBCR_CLKOFF BIT(31) +#define Q6SS_CBCR_TIMEOUT_US 200 + /* QDSP6SS_GFMUX_CTL */ #define Q6SS_CLK_ENABLE BIT(1) @@ -100,7 +105,6 @@ #define QDSP6v56_BHS_ON BIT(24) #define QDSP6v56_CLAMP_WL BIT(21) #define QDSP6v56_CLAMP_QMC_MEM BIT(22) -#define HALT_CHECK_MAX_LOOPS 200 #define QDSP6SS_XO_CBCR 0x0038 #define QDSP6SS_ACC_OVERRIDE_VAL 0x20 @@ -502,12 +506,12 @@ static int q6v5proc_reset(struct q6v5 *qproc) if (qproc->version == MSS_SDM845) { val = readl(qproc->reg_base + QDSP6SS_SLEEP); - val |= 0x1; + val |= Q6SS_CBCR_CLKEN; writel(val, qproc->reg_base + QDSP6SS_SLEEP); ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_SLEEP, - val, !(val & BIT(31)), 1, - SLEEP_CHECK_MAX_LOOPS); + val, !(val & Q6SS_CBCR_CLKOFF), 1, + Q6SS_CBCR_TIMEOUT_US); if (ret) { dev_err(qproc->dev, "QDSP6SS Sleep clock timed out\n"); return -ETIMEDOUT; @@ -530,12 +534,12 @@ static int q6v5proc_reset(struct q6v5 *qproc) goto pbl_wait; } else if (qproc->version == MSS_SC7180) { val = readl(qproc->reg_base + QDSP6SS_SLEEP); - val |= 0x1; + val |= Q6SS_CBCR_CLKEN; writel(val, qproc->reg_base + QDSP6SS_SLEEP); ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_SLEEP, - val, !(val & BIT(31)), 1, - SLEEP_CHECK_MAX_LOOPS); + val, !(val & Q6SS_CBCR_CLKOFF), 1, + Q6SS_CBCR_TIMEOUT_US); if (ret) { dev_err(qproc->dev, "QDSP6SS Sleep clock timed out\n"); return -ETIMEDOUT; @@ -543,12 +547,12 @@ static int q6v5proc_reset(struct q6v5 *qproc) /* Turn on the XO clock needed for PLL setup */ val = readl(qproc->reg_base + QDSP6SS_XO_CBCR); - val |= 0x1; + val |= Q6SS_CBCR_CLKEN; writel(val, qproc->reg_base + QDSP6SS_XO_CBCR); ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_XO_CBCR, - val, !(val & BIT(31)), 1, - SLEEP_CHECK_MAX_LOOPS); + val, !(val & Q6SS_CBCR_CLKOFF), 1, + Q6SS_CBCR_TIMEOUT_US); if (ret) { dev_err(qproc->dev, "QDSP6SS XO clock timed out\n"); return -ETIMEDOUT; @@ -556,7 +560,7 @@ static int q6v5proc_reset(struct q6v5 *qproc) /* Configure Q6 core CBCR to auto-enable after reset sequence */ val = readl(qproc->reg_base + QDSP6SS_CORE_CBCR); - val |= 0x1; + val |= Q6SS_CBCR_CLKEN; writel(val, qproc->reg_base + QDSP6SS_CORE_CBCR); /* De-assert the Q6 stop core signal */ @@ -591,13 +595,13 @@ static int q6v5proc_reset(struct q6v5 *qproc) /* BHS require xo cbcr to be enabled */ val = readl(qproc->reg_base + QDSP6SS_XO_CBCR); - val |= 0x1; + val |= Q6SS_CBCR_CLKEN; writel(val, qproc->reg_base + QDSP6SS_XO_CBCR); /* Read CLKOFF bit to go low indicating CLK is enabled */ ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_XO_CBCR, - val, !(val & BIT(31)), 1, - HALT_CHECK_MAX_LOOPS); + val, !(val & Q6SS_CBCR_CLKOFF), 1, + Q6SS_CBCR_TIMEOUT_US); if (ret) { dev_err(qproc->dev, "xo cbcr enabling timed out (rc:%d)\n", ret); From patchwork Fri Jan 17 13:51:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 11339207 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B1FA1398 for ; Fri, 17 Jan 2020 13:52:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A1AC217F4 for ; Fri, 17 Jan 2020 13:52:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="KqZbFyxl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729162AbgAQNwC (ORCPT ); Fri, 17 Jan 2020 08:52:02 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:42929 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729021AbgAQNv7 (ORCPT ); Fri, 17 Jan 2020 08:51:59 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579269118; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=ovyWJ6zpbSqDDSSxMWZyo+IzmXMYbJbI7rlM+Da3DcE=; b=KqZbFyxlXZTcAJTMJ/jY1Edp7rYL7CO1aodvZuaJqtGm/iBTFnCcLQC+huwReaMAuQORQdHY hK4RlC2CkbssPAjgqfx9beDOBQS6WT100bLEASsM17PNVj15Wf3fqhxYuFP+YpyUgoM6Jyd4 u8FC62f5f/qWO3XXOH3IKIiDAeE= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e21bbfb.7f20f41ded50-smtp-out-n01; Fri, 17 Jan 2020 13:51:55 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8C2A6C447B0; Fri, 17 Jan 2020 13:51:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id EF909C447A3; Fri, 17 Jan 2020 13:51:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EF909C447A3 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, evgreen@chromium.org, p.zabel@pengutronix.de Cc: ohad@wizery.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, agross@kernel.org, Sibi Sankar Subject: [PATCH 3/4] remoteproc: qcom: q6v5-mss: Rename boot status timeout Date: Fri, 17 Jan 2020 19:21:29 +0530 Message-Id: <20200117135130.3605-4-sibis@codeaurora.org> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20200117135130.3605-1-sibis@codeaurora.org> References: <20200117135130.3605-1-sibis@codeaurora.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Rename the FSM timeout on SC7180 to BOOT_STATUS_TIMEOUT_US. Signed-off-by: Sibi Sankar Reviewed-by: Evan Green --- drivers/remoteproc/qcom_q6v5_mss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index e1784446d3da3..6a98e9029c70b 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -114,7 +114,7 @@ #define QDSP6SS_BOOT_CORE_START 0x400 #define QDSP6SS_BOOT_CMD 0x404 #define QDSP6SS_BOOT_STATUS 0x408 -#define SLEEP_CHECK_MAX_LOOPS 200 +#define BOOT_STATUS_TIMEOUT_US 200 #define BOOT_FSM_TIMEOUT 10000 struct reg_info { @@ -572,7 +572,7 @@ static int q6v5proc_reset(struct q6v5 *qproc) /* Poll the QDSP6SS_BOOT_STATUS for FSM completion */ ret = readl_poll_timeout(qproc->reg_base + QDSP6SS_BOOT_STATUS, val, (val & BIT(0)) != 0, 1, - SLEEP_CHECK_MAX_LOOPS); + BOOT_STATUS_TIMEOUT_US); if (ret) { dev_err(qproc->dev, "Boot FSM failed to complete.\n"); /* Reset the modem so that boot FSM is in reset state */ From patchwork Fri Jan 17 13:51:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 11339205 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4E8A6C1 for ; Fri, 17 Jan 2020 13:52:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3CEE2082F for ; Fri, 17 Jan 2020 13:52:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="S6Fp/xqh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729186AbgAQNwB (ORCPT ); Fri, 17 Jan 2020 08:52:01 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:58236 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729017AbgAQNwB (ORCPT ); Fri, 17 Jan 2020 08:52:01 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579269120; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=USlJdlKMx5yIrdTVykTKpAm9eip0V27f956uFncn3rE=; b=S6Fp/xqhe5gjFvnFdsRoYWvRjXi2gyRLGavGfFibjxfY0TXo22UHskhShCLMrrnR99MvLkgt h0JquNvlQ4iUPVRy7U4iHFfBq9ww8JzERNcNDT83FWUmfVbxH3/dsroNzJ5XpCD9uP02fuPm uVDFy1M06hBxi2moHt8IBPwo/dA= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e21bbff.7fc55b16ace0-smtp-out-n02; Fri, 17 Jan 2020 13:51:59 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id E2283C447A5; Fri, 17 Jan 2020 13:51:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6CA3AC447AA; Fri, 17 Jan 2020 13:51:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6CA3AC447AA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, evgreen@chromium.org, p.zabel@pengutronix.de Cc: ohad@wizery.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, agross@kernel.org, Sibi Sankar Subject: [PATCH 4/4] remoteproc: qcom: q6v5-mss: Improve readability of reset_assert Date: Fri, 17 Jan 2020 19:21:30 +0530 Message-Id: <20200117135130.3605-5-sibis@codeaurora.org> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20200117135130.3605-1-sibis@codeaurora.org> References: <20200117135130.3605-1-sibis@codeaurora.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Define CONN_BOX_SPARE_0_EN and fixup comments to improve readability of Q6 modem reset_assert sequence on SC7180 SoCs. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_mss.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 6a98e9029c70b..8c9cfc213d5ff 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -71,6 +71,7 @@ #define NAV_AXI_HALTREQ_BIT BIT(0) #define NAV_AXI_HALTACK_BIT BIT(1) #define NAV_AXI_IDLE_BIT BIT(2) +#define CONN_BOX_SPARE_0_EN BIT(0) #define HALT_ACK_TIMEOUT_MS 100 #define NAV_HALT_ACK_TIMEOUT_US 200 @@ -415,16 +416,26 @@ static int q6v5_reset_assert(struct q6v5 *qproc) ret = reset_control_reset(qproc->mss_restart); reset_control_deassert(qproc->pdc_reset); } else if (qproc->has_halt_nav) { - /* SWAR using CONN_BOX_SPARE_0 for pipeline glitch issue */ + /* + * SWWA for the pipeline glitch issue seen while + * putting the Q6 modem on SC7180 into reset: + * 1 - Assert PDC reset + * 2 - Set CONN_BOX_SPARE_0_EN + * 3 - Withdraw the halt requests + * 4 - Assert MSS reset + * 5 - Deassert PDC reset + * 6 - Clear CONN_BOX_SPARE_0_EN + * 7 - Deassert MSS reset + */ reset_control_assert(qproc->pdc_reset); regmap_update_bits(qproc->conn_map, qproc->conn_box, - BIT(0), BIT(0)); + CONN_BOX_SPARE_0_EN, 1); regmap_update_bits(qproc->halt_nav_map, qproc->halt_nav, NAV_AXI_HALTREQ_BIT, 0); reset_control_assert(qproc->mss_restart); reset_control_deassert(qproc->pdc_reset); regmap_update_bits(qproc->conn_map, qproc->conn_box, - BIT(0), 0); + CONN_BOX_SPARE_0_EN, 0); ret = reset_control_deassert(qproc->mss_restart); } else { ret = reset_control_assert(qproc->mss_restart);