Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6005043ybe; Tue, 10 Sep 2019 12:02:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOnpTjRPCkFgBKIeyezdgB+Ug1fEaw8EYqojWNWgS0dM7M+KNIN+SwONyaxQ4i3ICWBora X-Received: by 2002:aa7:c80e:: with SMTP id a14mr14629936edt.205.1568142178323; Tue, 10 Sep 2019 12:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568142178; cv=none; d=google.com; s=arc-20160816; b=bGnbE8vDmMaFUJMg/91Kh9MV3IkXVgPFp20L3D+D66sbZJbZxxCJV/Gy5CEs2FeBwA HX9pW9zFCHRXtnXmQcNGhz2WWeny2sznwGRkgHggSkTFQ4kbjzKK4j48UkcXkCg2i2gG wq7QzWqJF3FtHBUCbsRXC46shIV76AsmR3IpTkpCu5x8ZOggBwygHuO2BdO0iDpIlJok SckQR5xgLcL7ft1erO9GI3KJoNnKW3tYg0Dhzqe8sN41kYAEUoX4a/jBZLENh5pJj24X yq/NMOesTs31e7vAUgaSRmDTwJSWbzmFXQaWjRfXhv2gvoZlO7LHRC82EaW5es/VQLuE /1gw== 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=gjMD2OvenYXr3cfN13h2bvt0rkEPXweXaOPXDDekQb0=; b=VbgkZQ9JHkT9D98+k555p9ZvIEjA1C8N9OBwfgzysVbaZfoec9fJTYtEY5pSBIzyRm UJZN5zvEgruOmODe4eRQEUrkbXEZDTVquKq4ym0Riykd0x6UlTh22KDjH5TOqWXC96a0 0GYI/+FnUOiq8fbaaN8et0eu/3RUyJfk0JsPZuSAg7h22T0nfs02Vz/iVbTZlrXRcMsG uUpbqE1TDshY2CHEW2UXlgAJPL/brEpEUm3MAkdzrk+2cD0a18d4bIWmdRaDS7BaphEh htlkszlFCxWhOFJETyxMjkWUsThmfqHMalJgv+JEunEuQmUJETLIcohTN6eum4R2s5so Mw3w== 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 o4si9625683ejj.27.2019.09.10.12.02.28; Tue, 10 Sep 2019 12:02:58 -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 S2387790AbfIJOFG (ORCPT + 99 others); Tue, 10 Sep 2019 10:05:06 -0400 Received: from foss.arm.com ([217.140.110.172]:35856 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727289AbfIJOFF (ORCPT ); Tue, 10 Sep 2019 10:05:05 -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 DA23928; Tue, 10 Sep 2019 07:05:04 -0700 (PDT) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4FF9E3F59C; Tue, 10 Sep 2019 07:05:04 -0700 (PDT) Date: Tue, 10 Sep 2019 15:05:02 +0100 From: Andrew Murray To: Pankaj Dubey Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com, Anvesh Salveru Subject: Re: [PATCH 2/2] PCI: dwc: Add support to disable equalization phase 2 and 3 Message-ID: <20190910140502.GL9720@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1568118302-10505-2-git-send-email-pankaj.dubey@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 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? > > 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; > + > 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? 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 >