Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp646893ybe; Wed, 11 Sep 2019 02:29:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzE8x3qztR7eE2iKQ6mWKyq4u/Dre7o/fDqVf0GinfuiDCeTZmN+rzhixLGksFLdsrJ+fHl X-Received: by 2002:a50:d903:: with SMTP id t3mr34498091edj.117.1568194173433; Wed, 11 Sep 2019 02:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568194173; cv=none; d=google.com; s=arc-20160816; b=MAf6IcLUDX8M1kWCh6hg6GtXBKOeVUEB8vYZEL0j2IOvf2LUyIJyEOkMnxFjSZLJFK Lz4Qx6p8XLr86l0glAoXqzjsSW12CdzkAHMmMJukqPU1ZsBgc1L/ofnHFEC/UkWrzS0q 57RnfLIp/wCrk8+AZheOT8cNTqz44WpCpVo9DJcvxYQfU656w1hrltWsT7/W9IxQvZEM Pj9tCgKXy4KJ0j+VOGOseRcbsEdW5iHIFcLL6I6D6nV37G4Sxf4kkg3VMqBj8Ku9U2eW MtQVlYXVCu4Gr/vNJVA4pSjHMsjf4xeHEtxff2tjNPOdeOVZvNqO92mw5DoIeJTjH+u2 j6Vg== 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=YtVvtDxR5qF/ivkzx/c++rPYq4VvknmxJgRcCNTcMNU=; b=BdvtuBmwsAUea9Q/yCEGXgMwVBKdD+ai41fiCVa6VOnKjQQuYmDc678vjxZXgYGVl7 LNEDUYv2Gre+pKhNW5mser0/PJURhcX/ygtMcrRVAl3CFb28gKRxUSuVuBxnwMSBLsUZ WjWpjv0ZKW0lycozzzwSEULndKk6Q9oUD1gWTw6mLs0dyeY1vqzksPqs0Ck5hLQW693C TW3e/A30uLRVmI8SmGqetNq7t0t2Eru3tzU5RY1w/iNMnDky/cwYsBOip26iOnyzbZPY N1CAVP8I8ryhIq4xz/fxECc7PrcROPokPsgi8rB0Mo+VRd23Lpbmsqo3PYLxZvLrNBn/ 6sHw== 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 c6si2691366edv.210.2019.09.11.02.29.09; Wed, 11 Sep 2019 02:29:33 -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 S1727439AbfIKJ1N (ORCPT + 99 others); Wed, 11 Sep 2019 05:27:13 -0400 Received: from foss.arm.com ([217.140.110.172]:44278 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727420AbfIKJ1N (ORCPT ); Wed, 11 Sep 2019 05:27:13 -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 064E0337; Wed, 11 Sep 2019 02:27:13 -0700 (PDT) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 723133F71F; Wed, 11 Sep 2019 02:27:12 -0700 (PDT) Date: Wed, 11 Sep 2019 10:27:10 +0100 From: Andrew Murray To: Pankaj Dubey Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Jingoo Han , gustavo.pimentel@synopsys.com, lorenzo.pieralisi@arm.com, Bjorn Helgaas , Anvesh Salveru Subject: Re: [PATCH 2/2] PCI: dwc: Add support to disable equalization phase 2 and 3 Message-ID: <20190911092710.GO9720@e119886-lin.cambridge.arm.com> References: <1568118302-10505-1-git-send-email-pankaj.dubey@samsung.com> <1568118302-10505-2-git-send-email-pankaj.dubey@samsung.com> <20190910140502.GL9720@e119886-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Sep 10, 2019 at 09:51:41PM +0530, Pankaj Dubey wrote: > On Tue, 10 Sep 2019 at 19:59, Andrew Murray wrote: > > > > On Tue, Sep 10, 2019 at 05:55:02PM +0530, Pankaj Dubey wrote: > > > From: Anvesh Salveru > > > > > > In some platforms, PCIe PHY may have issues which will prevent linkup > > > to happen in GEN3 or high speed. In case equalization fails, link will > > > fallback to GEN1. > > > > > > Designware controller gives flexibility to disable GEN3 equalization > > > completely or only phase 2 and 3. > > > > Do some platforms have issues conducting phase 2 and 3 when they successfully > > conduct phase 0 and 1? > > > > Yes, it is possible. > > > > > > > Platform drivers can disable equalization phase 2 and 3, by setting > > > dwc_pci_quirk flag DWC_EQUALIZATION_DISABLE. > > > > > > Signed-off-by: Anvesh Salveru > > > Signed-off-by: Pankaj Dubey > > > --- > > > drivers/pci/controller/dwc/pcie-designware.c | 3 +++ > > > drivers/pci/controller/dwc/pcie-designware.h | 2 ++ > > > 2 files changed, 5 insertions(+) > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c > > > index bf82091..97a8268 100644 > > > --- a/drivers/pci/controller/dwc/pcie-designware.c > > > +++ b/drivers/pci/controller/dwc/pcie-designware.c > > > @@ -472,5 +472,8 @@ void dw_pcie_setup(struct dw_pcie *pci) > > > if (pci->dwc_pci_quirk & DWC_EQUALIZATION_DISABLE) > > > val |= PORT_LOGIC_GEN3_EQ_DISABLE; > > > > > > + if (pci->dwc_pci_quirk & DWC_EQ_PHASE_2_3_DISABLE) > > > + val |= PORT_LOGIC_GEN3_EQ_PHASE_2_3_DISABLE; > > > + Also is it harmless to set both DWC_EQUALIZATION_DISABLE and DWC_EQ_PHASE_2_3_DISABLE? (Which is permitted here). Thanks, Andrew Murray > > > dw_pcie_writel_dbi(pci, PCIE_PORT_GEN3_RELATED, val); > > > } > > > diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h > > > index a1453c5..b541508 100644 > > > --- a/drivers/pci/controller/dwc/pcie-designware.h > > > +++ b/drivers/pci/controller/dwc/pcie-designware.h > > > @@ -31,6 +31,7 @@ > > > > > > /* Parameters for PCIe Quirks */ > > > #define DWC_EQUALIZATION_DISABLE 0x1 > > > +#define DWC_EQ_PHASE_2_3_DISABLE 0x2 > > > > It only makes sense for either DWC_EQUALIZATION_DISABLE or DWC_EQ_PHASE_2_3_DISABLE > > to be specified, though if dwc_pci_quirk intends to hold other quirks should these > > be numbers and not bit fields? > > > Yes, you are right in a given platform it will be either > DWC_EQUALIZATION_DISABLE or DWC_EQ_PHASE_2_3_DISABLE. > > Intention behind making it bit-field was to add other quirks in future. > > > Thanks, > > > > Andrew Murray > > > > > > > > /* Synopsys-specific PCIe configuration registers */ > > > #define PCIE_PORT_LINK_CONTROL 0x710 > > > @@ -65,6 +66,7 @@ > > > > > > #define PCIE_PORT_GEN3_RELATED 0x890 > > > #define PORT_LOGIC_GEN3_EQ_DISABLE BIT(16) > > > +#define PORT_LOGIC_GEN3_EQ_PHASE_2_3_DISABLE BIT(9) > > > > > > #define PCIE_ATU_VIEWPORT 0x900 > > > #define PCIE_ATU_REGION_INBOUND BIT(31) > > > -- > > > 2.7.4 > > >