Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2066266ybl; Thu, 19 Dec 2019 07:32:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzK7DPy9FwkMWK7px4tGAABHdoWTDgW0QDsvuLnNrtPHIcm+S5FkjnP1nEAgw3yK5rWXVKw X-Received: by 2002:a9d:7cd0:: with SMTP id r16mr9765532otn.50.1576769548937; Thu, 19 Dec 2019 07:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576769548; cv=none; d=google.com; s=arc-20160816; b=0w/F8Vk0uC/nqfKRWC59x01aURBNwQ89/hJhaqyb4mo4rCTdcV2hSNdjSbCMUlsgeA 5O1hskQHngPUzXoQvodY1V7tT1ihusi19YQ9IZ5YCg91tEtuMvsk3sRSFiMgVSb+wr8w FXS0Pfb0qV345NgJndFNiG5onC9XqbVf6E6mNHSDg6rngd0T5fJXxniII89sJm4ZKpot xn/j8jGU64Fs76OGtsY9Q+pdEr2ql8OFGT65R2XzbPyVQklllDN9xeSdqfOPeQ7lFAoj uTsMo+5YPvKEduPf9tZij74MwIATXdmL+dpGIMmk+ORMF7y1j5mP5dtil0uAQy8SnJS6 wNhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DVVdjtKv58x1Uc55az3ApF8gHKz/ZX1W12cqDT6rODs=; b=VQXiQfOFV9Vnc7+Ta7mvynZXJT7aXJtnClAC7+kCp2jwRudzNiibvG97VQpTm0clSr AVzQcdRkmbaWg0g5aEd+g/2WW5bkkx8L4UA8498U3EWfVauGDKRWytf/wP7aPwm63aQK Jd8Q7rm3jq5I22HGOEedwfla0bxS1QnnmKZjfHi/JVVRuvtkb7u/DBLRsi0AFWvDzk2K s7HRAuWIKnCTG2Eh3Lzlg7prvD4KHY16TBrcFGL5bc6L8O2UMdqHLGHCr4ZH/qcOVOwK Kx2uvrNDNZrYN+Z0jY4MYEAS7WCB0a5moe99L8cvtFyAT49kg6DALg0gQvm3O/jpjNwe z+cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JvT9zp0E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 194si3284921oii.2.2019.12.19.07.32.17; Thu, 19 Dec 2019 07:32:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JvT9zp0E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbfLSPbP (ORCPT + 99 others); Thu, 19 Dec 2019 10:31:15 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:45245 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbfLSPbP (ORCPT ); Thu, 19 Dec 2019 10:31:15 -0500 Received: by mail-il1-f193.google.com with SMTP id p8so5183246iln.12; Thu, 19 Dec 2019 07:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DVVdjtKv58x1Uc55az3ApF8gHKz/ZX1W12cqDT6rODs=; b=JvT9zp0EpA5eXF3hdg5MJ34MDzA+56QpVQBg2UKGdtLFpGPxwriFh2JNeb5+8GCUUR 3FVZmZYkoygMpEeVdWhi+LE5dH6aPhNfKjJiY7Ff48bUcuLSCYO7QA5CEItHQ9dNkhCa iZfQiR9+gKBigCx3Lllt5e07K7eHwUm1mVswmm8osg75KEQU7ptlwDA8b7RxcFh14OYD PjyWrLlMmI0Gcz0dbMBMk5AFiBnFhIokefAuuaiDe5kjeuc6f8nb8TTQW/PGGMPJfPo4 8jrLLZQ0eY+xcDrCFidMz7XSIDV95ytpBSwO9pAltXnBOlp7Hv+aGzF62gSGaRgSi9oM 0EQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DVVdjtKv58x1Uc55az3ApF8gHKz/ZX1W12cqDT6rODs=; b=iCjC96KGf51HJM5X8vqi4xgPT5cEQFvgWqxrBLtcXXs5fHDKJGP8SlOkvRtvfsdYHr h5aOuZ66lMm3SFezuuGCWlOtJlezaWzKWG/upFO3AjV7yvCMwhp8jCHMyuxDdpOP3fFF HgA78KrqKQjly7jnstjlXOn/nvTmFa4Th36DL7ERnFDqnFqiiRYzfP8wG+FD2UEsgPtJ WfsGvc1IK6AeQu5Od+IoXaBgBwuSge7lDR7Zc47rFpnNLj9gbJ0x3KO4bt16TRQ6dPJH bVPbf1ZCQKr69p3zArfaGKnxjUnZZM4M1kGRB+O7tkCy8lJ5ZVzA4x4mEKg2sfspRhh7 BXig== X-Gm-Message-State: APjAAAXnyHY3UFo9thJjrrDZdb36BNZLhXryMXgYCBbsuPCVAZqnqQyz OohfnhJcWFwoxVEeFzFup10aSEw8Xwe48ONR/U8= X-Received: by 2002:a92:465c:: with SMTP id t89mr7929451ila.263.1576769474440; Thu, 19 Dec 2019 07:31:14 -0800 (PST) MIME-Version: 1.0 References: <20191219150433.2785427-1-vkoul@kernel.org> <20191219150433.2785427-4-vkoul@kernel.org> In-Reply-To: <20191219150433.2785427-4-vkoul@kernel.org> From: Jeffrey Hugo Date: Thu, 19 Dec 2019 08:31:03 -0700 Message-ID: Subject: Re: [PATCH 3/4] phy: qcom-qmp: Add optional SW reset To: Vinod Koul Cc: Kishon Vijay Abraham I , MSM , Bjorn Andersson , Andy Gross , Can Guo , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 19, 2019 at 8:05 AM Vinod Koul wrote: > > For V4 QMP UFS Phy, we need to assert reset bits, configure the phy and > then deassert it, so add optional has_sw_reset flag and use that to > configure the QPHY_SW_RESET register. > > Signed-off-by: Vinod Koul Reviewed-by: Jeffrey Hugo > --- > drivers/phy/qualcomm/phy-qcom-qmp.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c > index 06f971ca518e..80304b7cd895 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qmp.c > +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c > @@ -1023,6 +1023,9 @@ struct qmp_phy_cfg { > > /* true, if PCS block has no separate SW_RESET register */ > bool no_pcs_sw_reset; > + > + /* true if sw reset needs to be invoked */ > + bool has_sw_reset; > }; > > /** > @@ -1391,6 +1394,7 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { > > .is_dual_lane_phy = true, > .no_pcs_sw_reset = true, > + .has_sw_reset = true, > }; > > static void qcom_qmp_phy_configure(void __iomem *base, > @@ -1475,6 +1479,9 @@ static int qcom_qmp_phy_com_init(struct qmp_phy *qphy) > SW_USB3PHY_RESET_MUX | SW_USB3PHY_RESET); > } > > + if (cfg->has_sw_reset) > + qphy_setbits(serdes, cfg->regs[QPHY_SW_RESET], SW_RESET); > + > if (cfg->has_phy_com_ctrl) > qphy_setbits(serdes, cfg->regs[QPHY_COM_POWER_DOWN_CONTROL], > SW_PWRDN); > @@ -1651,6 +1658,9 @@ static int qcom_qmp_phy_enable(struct phy *phy) > if (cfg->has_phy_dp_com_ctrl) > qphy_clrbits(dp_com, QPHY_V3_DP_COM_SW_RESET, SW_RESET); > > + if (cfg->has_sw_reset) > + qphy_clrbits(pcs, cfg->regs[QPHY_SW_RESET], SW_RESET); > + > /* start SerDes and Phy-Coding-Sublayer */ > qphy_setbits(pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl); > > -- > 2.23.0 >