PCI: keystone: Invoke phy_reset() API before enabling PHY
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 25 Mar 2019 09:39:36 +0000 (15:09 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 15 Apr 2019 12:24:02 +0000 (13:24 +0100)
SERDES connected to the PCIe controller in AM654 requires
power on reset enable (POR_EN) to be set in the SERDES. The
SERDES driver sets POR_EN in the reset ops and it has to be
invoked before init or enable ops. In order for SERDES driver
to set POR_EN, invoke the phy_reset() API in pci-keystone driver.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/controller/dwc/pci-keystone.c

index a6a482b..e4a816f 100644 (file)
@@ -897,6 +897,10 @@ static int ks_pcie_enable_phy(struct keystone_pcie *ks_pcie)
        int num_lanes = ks_pcie->num_lanes;
 
        for (i = 0; i < num_lanes; i++) {
+               ret = phy_reset(ks_pcie->phy[i]);
+               if (ret < 0)
+                       goto err_phy;
+
                ret = phy_init(ks_pcie->phy[i]);
                if (ret < 0)
                        goto err_phy;