From: Shradha Todi <shradha.t@samsung.com>
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 <anvesh.salveru@gmail.com>,
Shradha Todi <shradha.t@samsung.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Andrew Murray <andrew.murray@arm.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Vidya Sagar <vidyas@nvidia.com>,
Jonathan Hunter <jonathanh@nvidia.com>
Subject: [PATCH v7 4/5] PCI: tegra: Remove platform driver support for ZRX-DC compliant PHY
Date: Thu, 7 Jan 2021 20:58:42 +0530 [thread overview]
Message-ID: <1610033323-10560-5-git-send-email-shradha.t@samsung.com> (raw)
In-Reply-To: <1610033323-10560-1-git-send-email-shradha.t@samsung.com>
From: Pankaj Dubey <pankaj.dubey@samsung.com>
As part of dw_pcie_setup(), PHYs which are compliant to ZRX-DC
specification are already handled based on "phy-zrxdc-compliant" property
in PCIe PHY DT node. So, instead of handling ZRX-DC compliant settings in
each platform driver, remove this driver specific code.
Signed-off-by: Anvesh Salveru <anvesh.salveru@gmail.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Signed-off-by: Shradha Todi <shradha.t@samsung.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Andrew Murray <andrew.murray@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Vidya Sagar <vidyas@nvidia.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
---
drivers/pci/controller/dwc/pcie-tegra194.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 6fa216e..50e85e5 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -194,7 +194,6 @@
#define GEN3_EQ_CONTROL_OFF_FB_MODE_MASK GENMASK(3, 0)
#define GEN3_RELATED_OFF 0x890
-#define GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL BIT(0)
#define GEN3_RELATED_OFF_GEN3_EQ_DISABLE BIT(16)
#define GEN3_RELATED_OFF_RATE_SHADOW_SEL_SHIFT 24
#define GEN3_RELATED_OFF_RATE_SHADOW_SEL_MASK GENMASK(25, 24)
@@ -899,10 +898,6 @@ static int tegra_pcie_dw_host_init(struct pcie_port *pp)
disable_aspm_l12(pcie);
}
- val = dw_pcie_readl_dbi(pci, GEN3_RELATED_OFF);
- val &= ~GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL;
- dw_pcie_writel_dbi(pci, GEN3_RELATED_OFF, val);
-
if (pcie->update_fc_fixup) {
val = dw_pcie_readl_dbi(pci, CFG_TIMER_CTRL_MAX_FUNC_NUM_OFF);
val |= 0x1 << CFG_TIMER_CTRL_ACK_NAK_SHIFT;
@@ -1752,10 +1747,6 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
disable_aspm_l12(pcie);
}
- val = dw_pcie_readl_dbi(pci, GEN3_RELATED_OFF);
- val &= ~GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL;
- dw_pcie_writel_dbi(pci, GEN3_RELATED_OFF, val);
-
pcie->pcie_cap_base = dw_pcie_find_capability(&pcie->pci,
PCI_CAP_ID_EXP);
clk_set_rate(pcie->core_clk, GEN4_CORE_CLK_FREQ);
@@ -1958,6 +1949,7 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
{
const struct tegra_pcie_dw_of_data *data;
struct device *dev = &pdev->dev;
+ unsigned int phy_zrxdc_count;
struct resource *atu_dma_res;
struct tegra_pcie_dw *pcie;
struct pcie_port *pp;
@@ -2066,8 +2058,15 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
dev_err(dev, "Failed to get PHY: %d\n", ret);
return ret;
}
+ if (phy_property_present(phys[i], "phy-zrxdc-compliant"))
+ phy_zrxdc_count++;
}
+ if ((pcie->phy_count) && (pcie->phy_count == phy_zrxdc_count))
+ pci->phy_zrxdc_compliant = true;
+ else
+ pci->phy_zrxdc_compliant = false;
+
pcie->phys = phys;
atu_dma_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
--
2.7.4
next prev parent reply other threads:[~2021-01-07 16:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210107152945epcas5p158e88c757a44e98f4e9a898d3ff5f87c@epcas5p1.samsung.com>
2021-01-07 15:28 ` [PATCH v7 0/5] Add support to handle ZRX-DC Compliant PHYs Shradha Todi
[not found] ` <CGME20210107153013epcas5p27700f30e341d7f1fb457035a690490c6@epcas5p2.samsung.com>
2021-01-07 15:28 ` [PATCH v7 1/5] phy: core: add phy_property_present method Shradha Todi
[not found] ` <CGME20210107153030epcas5p14b0967c4d8d9804a2d084981af445c58@epcas5p1.samsung.com>
2021-01-07 15:28 ` [PATCH v7 2/5] PCI: dwc: add support to handle ZRX-DC Compliant PHYs Shradha Todi
2021-01-07 18:44 ` Bjorn Helgaas
2021-01-12 1:52 ` Pankaj Dubey
[not found] ` <CGME20210107153051epcas5p4f54210f89f8b8d2e18be016521657be0@epcas5p4.samsung.com>
2021-01-07 15:28 ` [PATCH v7 3/5] dt-bindings: PHY: P2U: Add binding for ZRX-DC PHY property Shradha Todi
[not found] ` <CGME20210107153105epcas5p49ca103794f62faa48c5bedcfc8b4a287@epcas5p4.samsung.com>
2021-01-07 15:28 ` Shradha Todi [this message]
2021-01-07 18:46 ` [PATCH v7 4/5] PCI: tegra: Remove platform driver support for ZRX-DC compliant PHY kernel test robot
[not found] ` <CGME20210107153116epcas5p3510286e503e690537d5b2eb7486fa7ab@epcas5p3.samsung.com>
2021-01-07 15:28 ` [PATCH v7 5/5] arm64: tegra: Add support for ZRX DC PHY property Shradha Todi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1610033323-10560-5-git-send-email-shradha.t@samsung.com \
--to=shradha.t@samsung.com \
--cc=andrew.murray@arm.com \
--cc=anvesh.salveru@gmail.com \
--cc=bhelgaas@google.com \
--cc=hari.tv@samsung.com \
--cc=jonathanh@nvidia.com \
--cc=l.mehra@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=niyas.ahmed@samsung.com \
--cc=p.rajanbabu@samsung.com \
--cc=pankaj.dubey@samsung.com \
--cc=sriram.dash@samsung.com \
--cc=vidyas@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®