Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4343395ybg; Mon, 21 Oct 2019 07:35:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBRFtLvqZ9V2SaK/7VqM6EBLINjBggme1tzL1Z3COt2S8RgLnbTXo7tlACbU/ld60cepaq X-Received: by 2002:a05:6402:14d6:: with SMTP id f22mr25964678edx.148.1571668512670; Mon, 21 Oct 2019 07:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571668512; cv=none; d=google.com; s=arc-20160816; b=DX9ZykL4mQEHqbm8nUD9M/NlCKka3Pzp/PoXtW/9wuxQ/3+Obzy+wIhfGmSL1UjCjK o8tHGCjieYOaJcpw/m+c8q2S/Ba7Xrur0DKxCQBl5HKvr6cxSfF0gK1GA2SM3KsX5PwZ XXFgAeRSeBarTDeXR0mV/zdhTcpuBvL0CCJQHoiAqtwUP0nZF3H38e41o/nHrON88HX+ fpbLTbiYJ6azxp4/wgUzuB2CEy3gPG3j+4ZHmG1SirDIkVkWsEqTi4jKFDaEDdpfUvOO t/YqlhC4lcuyExAMOspOKWC7TinqWEyNRm3ut9d06QPu9E1sHI8QUYOj0yX91fjuNjt1 KfBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=n+1n9CmxPirQhaCGSTJ2dM8bVT99XDmLGpACeOEjKfM=; b=DTeZCSav3flg4tUObZ6PbxVnGsxZaFO39HS87ASjM0gzSMkOhZcQ4BrBGKi1mzx/dI YDQGKZ/NSBwCflmISS4hpvDu0SEUFDhakSsKwzXYcrBB0RJhOHcmv6JDK9Q7MVfsyOG2 CwrVAcMPHO3PsaXNnxmGgxsknlSaqh3xe/sTSt+RzUM8efszacezzuCJjIZfSlHG33Ud NqDtZupnvW418ZLKiANmj7Z1Tlp+vMpyQb8EcxGovDLpttf4sH2uLNUnIDdwDbR6iG+h pDdN/F901pVJ9CpQZN4Xs3x4k/JU5hHVZw93G8yZCuMGlrbpAtcStvqxfj5C3xS7GPbV bDVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si8745250eja.377.2019.10.21.07.34.48; Mon, 21 Oct 2019 07:35:12 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729099AbfJUOcP (ORCPT + 99 others); Mon, 21 Oct 2019 10:32:15 -0400 Received: from [217.140.110.172] ([217.140.110.172]:54318 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1728083AbfJUOcO (ORCPT ); Mon, 21 Oct 2019 10:32:14 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A76D51007; Mon, 21 Oct 2019 07:31:49 -0700 (PDT) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1E8703F71F; Mon, 21 Oct 2019 07:31:48 -0700 (PDT) Date: Mon, 21 Oct 2019 15:31:47 +0100 From: Andrew Murray To: Pankaj Dubey Cc: 'Anvesh Salveru' , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, gustavo.pimentel@synopsys.com, jingoohan1@gmail.com, lorenzo.pieralisi@arm.com Subject: Re: [PATCH 2/2] PCI: dwc: Add support to handle ZRX-DC Compliant PHYs Message-ID: <20191021143147.GU47056@e119886-lin.cambridge.arm.com> References: <1571660993-30329-1-git-send-email-anvesh.s@samsung.com> <20191021140424.GR47056@e119886-lin.cambridge.arm.com> <05b301d58819$d962fa00$8c28ee00$@samsung.com> <20191021141714.GT47056@e119886-lin.cambridge.arm.com> <05b801d5881b$981b2cf0$c85186d0$@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05b801d5881b$981b2cf0$c85186d0$@samsung.com> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 21, 2019 at 07:56:55PM +0530, Pankaj Dubey wrote: > > > > -----Original Message----- > > From: Andrew Murray > > Sent: Monday, October 21, 2019 7:47 PM > > To: Pankaj Dubey > > Cc: 'Anvesh Salveru' ; linux-pci@vger.kernel.org; > > linux-kernel@vger.kernel.org; bhelgaas@google.com; > > gustavo.pimentel@synopsys.com; jingoohan1@gmail.com; > > lorenzo.pieralisi@arm.com > > Subject: Re: [PATCH 2/2] PCI: dwc: Add support to handle ZRX-DC Compliant > > PHYs > > > > On Mon, Oct 21, 2019 at 07:44:25PM +0530, Pankaj Dubey wrote: > > > > > > > > > > -----Original Message----- > > > > From: Andrew Murray > > > > Sent: Monday, October 21, 2019 7:34 PM > > > > To: Anvesh Salveru > > > > Cc: linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; > > > > bhelgaas@google.com; gustavo.pimentel@synopsys.com; > > > > jingoohan1@gmail.com; lorenzo.pieralisi@arm.com; Pankaj Dubey > > > > > > > > Subject: Re: [PATCH 2/2] PCI: dwc: Add support to handle ZRX-DC > > > > Compliant PHYs > > > > > > > > On Mon, Oct 21, 2019 at 05:59:53PM +0530, Anvesh Salveru wrote: > > > > > Many platforms use DesignWare controller but the PHY can be > > > > > different in different platforms. If the PHY is compliant is to > > > > > ZRX-DC specification > > > > > > > > s/is to/to the/ > > > > > > OK > > > > > > > > > > > > it helps in low power consumption during power states. > > > > > > > > s/in low/lower/ > > > > > > > OK > > > > > > > > > > If current data rate is 8.0 GT/s or higher and PHY is not > > > > > compliant to ZRX-DC specification, then after every 100ms link > > > > > should transition to recovery state during the low power states. > > > > > > > > > > DesignWare controller provides GEN3_ZRXDC_NONCOMPL field in > > > > > GEN3_RELATED_OFF to specify about ZRX-DC compliant PHY. > > > > > > > > > > Platforms with ZRX-DC compliant PHY can set > "snps,phy-zrxdc-compliant" > > > > > property in controller DT node to specify this property to the > > > controller. > > > > > > > > > > Signed-off-by: Anvesh Salveru > > > > > Signed-off-by: Pankaj Dubey > > > > > --- > > > > > drivers/pci/controller/dwc/pcie-designware.c | 7 +++++++ > > > > > drivers/pci/controller/dwc/pcie-designware.h | 3 +++ > > > > > 2 files changed, 10 insertions(+) > > > > > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware.c > > > > > b/drivers/pci/controller/dwc/pcie-designware.c > > > > > index 820488dfeaed..6560d9f765d7 100644 > > > > > --- a/drivers/pci/controller/dwc/pcie-designware.c > > > > > +++ b/drivers/pci/controller/dwc/pcie-designware.c > > > > > @@ -556,4 +556,11 @@ void dw_pcie_setup(struct dw_pcie *pci) > > > > > PCIE_PL_CHK_REG_CHK_REG_START; > > > > > dw_pcie_writel_dbi(pci, > PCIE_PL_CHK_REG_CONTROL_STATUS, > > > > val); > > > > > } > > > > > + > > > > > + if (of_property_read_bool(np, "snps,phy-zrxdc-compliant")) { > > > > > + val = dw_pcie_readl_dbi(pci, > PCIE_PORT_GEN3_RELATED); > > > > > + val &= ~PORT_LOGIC_GEN3_ZRXDC_NONCOMPL; > > > > > + dw_pcie_writel_dbi(pci, PCIE_PORT_GEN3_RELATED, > val); > > > > > + } > > > > > + > > > > > > > > Given that this duplicates tegra_pcie_prepare_host in > > > > pcie-tegra194.c, can > > > we > > > > update that driver to adopt this new binding? > > > > > > > > > > Yes, Thanks for highlighting this. Otherwise I was worried that we > > > have one more patch without real user :) > > > > Indeed :| > > > > Though besides Tegra, is there any other reason you are adding this? > > > > Yes. We have one internal PCIe RC driver (which we can't disclose/upstream > right now) has this issue and currently we are handling it using this DT > binding. So we would like to upstream common code, so other platform's > driver can use this. Ah, I understand. Thanks, Andrew Murray > > > > We will update pcie-tegra194.c driver and post the patch to adopt this > > > binding. > > > > It's much appreciated. > > > > Andrew Murray > > > > > > > > > Thanks, > > > > > > > > Andrew Murray > > > > > > > > > } > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware.h > > > > > b/drivers/pci/controller/dwc/pcie-designware.h > > > > > index 5a18e94e52c8..427a55ec43c6 100644 > > > > > --- a/drivers/pci/controller/dwc/pcie-designware.h > > > > > +++ b/drivers/pci/controller/dwc/pcie-designware.h > > > > > @@ -60,6 +60,9 @@ > > > > > #define PCIE_MSI_INTR0_MASK 0x82C > > > > > #define PCIE_MSI_INTR0_STATUS 0x830 > > > > > > > > > > +#define PCIE_PORT_GEN3_RELATED 0x890 > > > > > +#define PORT_LOGIC_GEN3_ZRXDC_NONCOMPL BIT(0) > > > > > + > > > > > #define PCIE_ATU_VIEWPORT 0x900 > > > > > #define PCIE_ATU_REGION_INBOUND BIT(31) > > > > > #define PCIE_ATU_REGION_OUTBOUND 0 > > > > > -- > > > > > 2.17.1 > > > > > > > > >