Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp418609pxu; Thu, 7 Jan 2021 08:12:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzY9Xp0SkRf0Q00gu9z4e+vhcsAVy8g7NSeVIpdSxNfjwrI8LTfQL32BwTAw9YXWxXcXYd X-Received: by 2002:aa7:db59:: with SMTP id n25mr2100263edt.203.1610035970615; Thu, 07 Jan 2021 08:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610035970; cv=none; d=google.com; s=arc-20160816; b=B3S0B4oqQ2gidf99QSMSzefnetfnbnkMcKHh0YZDbRxaHWbfypmxbq+TrPBYIy3rPI dlGOn72z81NpNmUfJKEtDPONBza2wFQeIxmSxcTeAHj0TyPcM2k67WdTnjSxqUEwJdRg tKN0QLQECgYk2PPMpQiuNikI72Ffty4XXBWU0Qo/6FE4KDTN2Io5F2pNXaMVBizT03Xb 5AD8WY17vGL+dBgxMl6MEzZ6y7TWGxRDvyZ/b0tllqBBfCI1yFk5vTUKrYjzl7tOvwJR wepTinI/wWQeFCIuPq01Bjty+hXs1J94jlKNaxacu4cVE9YM/Nt4DHFNuifPLCqRuQpl UOgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=g439C459CH1OddhMJ45SN6Ai5VaoDSSAZ947c4RRj8Q=; b=aLV72eWRmqyQ0/9nBswAC8ngB21da3JreyH7PYz4tZw4cxuIf/8yBsJc6vH617zkNT 1rgRtqLO2dd1H7lGAO+NChh5RWIEH/WGNKHiI1srGV2sneQLUTL341UKAoiyCL6mlYm2 lBmsTcyIp9udGh1eQTeC+7s4WRmXWdJ1yYvbyg/JyGENKCYes+sRi9itMLu/9sFmZKcz oy2tb4NMwyZ4i0ua73//+lZ6kNa/k3oS3MSIM0Add45DvMZnq9tMgD3AP9dwosLElebG 1E4T07e6xZBYZqLVVRszU9jtt8B9stZaM9I+TcVPsY9/JYoz2iWyqxJNlDDtZBdIQOn6 1BFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=hvyS0EL9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id b1si2329842edy.429.2021.01.07.08.12.27; Thu, 07 Jan 2021 08:12:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=hvyS0EL9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728604AbhAGQLN (ORCPT + 99 others); Thu, 7 Jan 2021 11:11:13 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:39125 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728573AbhAGQLM (ORCPT ); Thu, 7 Jan 2021 11:11:12 -0500 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210107161030epoutp0120dccaa618b4a6edc6e5f334109b5eec~X-w60LhG90770207702epoutp01P for ; Thu, 7 Jan 2021 16:10:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210107161030epoutp0120dccaa618b4a6edc6e5f334109b5eec~X-w60LhG90770207702epoutp01P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1610035830; bh=g439C459CH1OddhMJ45SN6Ai5VaoDSSAZ947c4RRj8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hvyS0EL9LB/pOwEf1gHTz8X8qurCaknteDdSGYlJoGcq3WV2DnK83mJtU0HQJZcY6 VA4TB6EeiRalq3HqCx9ERyyj3jc5ot2YQ7TMYTJUVyGMau2sFYfYBsOHqwL3UM6d5F QPx6jqyNOlOiJUHkcJGHs4AFYFufaMREWG2eKj/Y= Received: from epsmges5p3new.samsung.com (unknown [182.195.42.75]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20210107161028epcas5p332ce3b0c4627572c2c5efdf49b9d15f3~X-w5bYnus2636626366epcas5p3H; Thu, 7 Jan 2021 16:10:28 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id EB.BB.33964.47237FF5; Fri, 8 Jan 2021 01:10:28 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20210107153030epcas5p14b0967c4d8d9804a2d084981af445c58~X-OAJV35C2091320913epcas5p1-; Thu, 7 Jan 2021 15:30:30 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210107153030epsmtrp2519ac2f4d5611a8110fca846b86b99f3~X-OAIZSlw0417604176epsmtrp2P; Thu, 7 Jan 2021 15:30:30 +0000 (GMT) X-AuditID: b6c32a4b-eb7ff700000184ac-ed-5ff73274ddb0 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id E4.2A.08745.61927FF5; Fri, 8 Jan 2021 00:30:30 +0900 (KST) Received: from ubuntu.sa.corp.samsungelectronics.net (unknown [107.108.83.125]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210107153028epsmtip2971fe2872a2a5a799371e17e823cbcd0~X-N98qClA1958119581epsmtip2b; Thu, 7 Jan 2021 15:30:28 +0000 (GMT) From: Shradha Todi To: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org Cc: pankaj.dubey@samsung.com, sriram.dash@samsung.com, niyas.ahmed@samsung.com, p.rajanbabu@samsung.com, l.mehra@samsung.com, hari.tv@samsung.com, Anvesh Salveru , Shradha Todi , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas Subject: [PATCH v7 2/5] PCI: dwc: add support to handle ZRX-DC Compliant PHYs Date: Thu, 7 Jan 2021 20:58:40 +0530 Message-Id: <1610033323-10560-3-git-send-email-shradha.t@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1610033323-10560-1-git-send-email-shradha.t@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBKsWRmVeSWpSXmKPExsWy7bCmhm6J0fd4gz2HTSx+rJ7AbLGkKcNi 190OdouP01YyWaz4MpPd4s7zG4wWl3fNYbM4O+84m0Xnl1lsFm9+v2C3eDLlEavF0Y3BFou2 fmG3+L9nB7tF7+Faixvr2R0EPNbMW8PosXPWXXaPBZtKPTat6mTz6NuyitFjy/7PjB6fN8kF sEdx2aSk5mSWpRbp2yVwZSw9285SsFek4sme20wNjIcFuxg5OSQETCSWzFnE2MXIxSEksJtR Yu73pVDOJ0aJxi9fmSCcz4wSZ/5+Z4RpubvpDjNEYhdQ4tEvVginhUlixaJrTCBVbAJaEo1f u5hBbBGBKImZ21vBipgFtjFLTNs+lRUkISzgL7Hl7zUWEJtFQFXiVetLMJtXwFXi1d0b7BDr 5CRunusEG8Qp4Cbxbdo6sEESAlM5JBbvPgJ1k4vEm19/mSFsYYlXx7dANUtJfH63lw3CzpeY euEp0AIOILtCYnlPHUTYXuLAlTlgYWYBTYn1u/QhwrISU0+tA/uFWYBPovf3EyaIOK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xYbFhjlpZbrFSfmFpfmpesl5+duYgSHtpbWDsY9 qz7oHWJk4mA8xCjBwawkwmtx7Eu8EG9KYmVValF+fFFpTmrxIUZpDhYlcd4LXSfjhQTSE0tS s1NTC1KLYLJMHJxSDUy+Z9fJMrttTqmf3bzGM/SjY0pd9ZrrHstW2znGMPUcSZQOcNqhoHb3 +zTN5RWBTX5+9UbTerVPXL22/OvLHwtFZp1L3/J3v57z9z1nz6m0z2A2ixTSsnOb0rPbQfrf qsKf23bnVZtfeP0reDqL0V22QrWc3S1pzVu690/fLbBo0bnazMmeK63UCz7p2PHKRB8oeuT/ S5WdebFBGcfBk5/WnErbybJ1m8Ka8soEj66j81V/Pdo7be8S1/SHDOFSO7+ta7hRyFpxssW1 SCv94JYVn3hsXqTHPT3+Xc7w+X+Hwx71Ex0ys6V23H/Zv754R1Jl5IkbTfJ3w/oyLJdYtkv0 1Qkoi/237s/eZSPq4q/EUpyRaKjFXFScCAB1M7GW3AIAAA== X-CMS-MailID: 20210107153030epcas5p14b0967c4d8d9804a2d084981af445c58 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P X-CMS-RootMailID: 20210107153030epcas5p14b0967c4d8d9804a2d084981af445c58 References: <1610033323-10560-1-git-send-email-shradha.t@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pankaj Dubey Many platforms use DesignWare controller but the PHY can be different in different platforms. If the PHY is compliant is to ZRX-DC specification it helps in low power consumption during power states. 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 phy_zrxdc_compliant variable to specify this property to the controller. Signed-off-by: Anvesh Salveru Signed-off-by: Pankaj Dubey Signed-off-by: Shradha Todi Cc: Jingoo Han Cc: Gustavo Pimentel Cc: Lorenzo Pieralisi Cc: Rob Herring Cc: Bjorn Helgaas --- drivers/pci/controller/dwc/pcie-designware.c | 6 ++++++ drivers/pci/controller/dwc/pcie-designware.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index 645fa18..74590c7 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -722,4 +722,10 @@ 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 (pci->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); + } } diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 0207840..8b905a2 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -74,6 +74,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_PORT_MULTI_LANE_CTRL 0x8C0 #define PORT_MLTI_UPCFG_SUPPORT BIT(7) @@ -273,6 +276,7 @@ struct dw_pcie { u8 n_fts[2]; bool iatu_unroll_enabled: 1; bool io_cfg_atu_shared: 1; + bool phy_zrxdc_compliant; }; #define to_dw_pcie_from_pp(port) container_of((port), struct dw_pcie, pp) -- 2.7.4