Skip to content

Commit

Permalink
PCI: tegra: Remove platform driver support for ZRX-DC compliant PHY
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pankajkdubey authored and intel-lab-lkp committed Jan 7, 2021
1 parent e39f140 commit a626b81
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions drivers/pci/controller/dwc/pcie-tegra194.c
Expand Up @@ -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)
Expand Down Expand Up @@ -897,10 +896,6 @@ static void tegra_pcie_prepare_host(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;
Expand Down Expand Up @@ -1753,10 +1748,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);
Expand Down Expand Up @@ -1959,6 +1950,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;
Expand Down Expand Up @@ -2067,8 +2059,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,
Expand Down

0 comments on commit a626b81

Please sign in to comment.