Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5626727ybe; Tue, 10 Sep 2019 06:38:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7QfvW7Wg0KIEXV4Z+dYKLH6SXKV3wW3Ia3j+KtA5og5wH6jYVnmttlHDIECHE+35nBg6U X-Received: by 2002:a17:907:10c2:: with SMTP id rv2mr24155633ejb.305.1568122697174; Tue, 10 Sep 2019 06:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568122697; cv=none; d=google.com; s=arc-20160816; b=CJhuOJaffOR2lpM0BOlRub8uQONSMQmQFJwIZ6PZSpgSE2LxLCwLaYnzPXLpcG5byF pV7hFGEpHx7VpKF5F0J5JHSPnRFcXDqXijdyJQleGkxuWyGYuPMcZpWFb3DiaHonrLCA 2L2ca8UA/UE4DP4OvWyLwONiYIdR5+nghKaeV0BCaXMOKBKr0iDwq142IZVYfzAI7Bwi XAizfWyUBtX8ChnaOCW0Vdl/nEMDedsG12sZq2BacJ+7ZL7dxDcVyBV63MtvV7gZZqCw oJoBKoTiL1+qjsCvw5ootXTnhdyE2Rw1WqK0bPrLmRdqnDKszZ5bilEXxxSepBHsHtPH 08WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=ENoo0m1X18Vj3JVZ1WPFeFwISs1ZdRMWK1NqeYShs1Y=; b=lxOnjY+RvHibzORO39/GqKXqnN9p/LjNRi0IR5MMTcVSp7OEWVuRHnhwL6GRTM/Q5z kEgfaqrXvKpkHYYCRxl8+C6TjG9CmC6DcWH5sX6YaKYvZVYsaVRokzUwIHHbD3Qiu9mB g7PQmCUd/TCU/3B1Iys3VV/OaeQTbWCSqeJ3VU+Fi4W1ZhQlNGaaJQWv9PyLtv9nAvDG P9oM5c1fYAvwcykSK06mwWRIvuCP66APtthjRadEWa/4Z2V93XnEusamedMkUlY93RlG EDK4mlWdlmaiUIFB7GqdRxv9AXKeKeAWkglkv6/uoY+Drjy7VFHkbiisnX6myXlPuciC CZiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Hdbv8mQZ; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j35si11361150eda.144.2019.09.10.06.37.52; Tue, 10 Sep 2019 06:38:17 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Hdbv8mQZ; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392159AbfIJMZY (ORCPT + 99 others); Tue, 10 Sep 2019 08:25:24 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:55188 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbfIJMZY (ORCPT ); Tue, 10 Sep 2019 08:25:24 -0400 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190910122521epoutp0438edfa0ba8442bcbfc3ec88c3bc01784~DE04jc-MD1736317363epoutp049 for ; Tue, 10 Sep 2019 12:25:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190910122521epoutp0438edfa0ba8442bcbfc3ec88c3bc01784~DE04jc-MD1736317363epoutp049 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1568118321; bh=ENoo0m1X18Vj3JVZ1WPFeFwISs1ZdRMWK1NqeYShs1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hdbv8mQZewKHtrfUSvdwPTVbEoWDAH3Q5kCYR1Ksrae4+FK8MzLzt9SjoY7zEL2gw qXC6Kt1fKJeEEjr3trm+Pne9haJi4Qua6ysPoJIomh8OCl+bW3F9O5+OVo86awg+UB bQhut3JE5Z8qbsJ/Mfl5OCGj+zpnnA+YDAnL80i0= Received: from epsmges5p2new.samsung.com (unknown [182.195.42.74]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20190910122520epcas5p21ab5a5698efbca737be7aa7d1ef56c58~DE03zYg_r0710407104epcas5p2E; Tue, 10 Sep 2019 12:25:20 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 2C.F1.04429.036977D5; Tue, 10 Sep 2019 21:25:20 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20190910122520epcas5p1faeb16f7c38ee057ce93783a637e6bf4~DE03f-C7J2157221572epcas5p1-; Tue, 10 Sep 2019 12:25:20 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190910122520epsmtrp1ccbdaeaf3162eac4489becab9e07f17c~DE03fVSwY1251612516epsmtrp1O; Tue, 10 Sep 2019 12:25:20 +0000 (GMT) X-AuditID: b6c32a4a-63dff7000000114d-f8-5d7796302ede Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 55.97.03638.036977D5; Tue, 10 Sep 2019 21:25:20 +0900 (KST) Received: from ubuntu.sa.corp.samsungelectronics.net (unknown [107.108.83.125]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190910122518epsmtip286b1af9ec46a93801941d17c73064c35~DE016fcL60912709127epsmtip2K; Tue, 10 Sep 2019 12:25:18 +0000 (GMT) From: Pankaj Dubey To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com, Anvesh Salveru , Pankaj Dubey Subject: [PATCH 2/2] PCI: dwc: Add support to disable equalization phase 2 and 3 Date: Tue, 10 Sep 2019 17:55:02 +0530 Message-Id: <1568118302-10505-2-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568118302-10505-1-git-send-email-pankaj.dubey@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0hTYRjm2znbOQ6Xh6n4tkpilKTgLQoOFBUkeLqIFUGQrVp5cNI2x+ac BoKlzAtmpikoU7wra2pNE51athrDcjPUsAhLyW4miimtEGftIv17nve5vC8fH4kJl3ERma7M ZNVKqVzM4+N9zyMjo+OqdZK4ktl9tMPSyKVbbstoy0wRQXes1RD0pMXAox31dh69uP6NoJse rxHHSMZUb0LMQO0MwTSYtUxZrxExvU9XEbNqDj/Du8g/nMrK07NYdeyRq3yZ+345rrIHZTeY J4k81CMoQQEkUAegaqUGlSA+KaQGEVQNuzg+8hNB69Ic4SO/EEw79MRWxOlwcn3CMII/lRP+ fAEH8h/ZMI+LR0XD/HKdF4dQhyBvwehNYJ4l7nuT/whJBlPnYNN42ePBqb2gr57hebCAYuDh s3r/tnB45yz29gRQJ2CtoxDz9ABl4sHYdJPflAA9rw1+HAwL9l4/FsH3u1tnZ8Dv5gp/uABB pb2O6xOOwsiUAfcchFGR0G2J9YwxahvcWZ/neMZACaBIL/S5I8D1dQzz4Z0wl9/K8WEG2tsm /M9lQNDjLuWWo121/1sbEDKi7axKo0hjNQdV+5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UnAgAvZpz20ACAAA= X-CMS-MailID: 20190910122520epcas5p1faeb16f7c38ee057ce93783a637e6bf4 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P X-CMS-RootMailID: 20190910122520epcas5p1faeb16f7c38ee057ce93783a637e6bf4 References: <1568118302-10505-1-git-send-email-pankaj.dubey@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 /* 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