[U-Boot] [PATCH 3/5] pci: tegra: make tegra_pcie_port_reset weak function with explicit index

Marcel Ziswiler marcel at ziswiler.com
Fri Aug 4 16:10:02 UTC 2017


From: Marcel Ziswiler <marcel.ziswiler at toradex.com>

Make tegra_pcie_port_reset() a weak function with an explicit index
parameter. This allows overriding the PCIe port reset functionality
from board specific code as e.g. required for Apalis TK1.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
---

 drivers/pci/pci_tegra.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c
index cb5cf8b..d373a88 100644
--- a/drivers/pci/pci_tegra.c
+++ b/drivers/pci/pci_tegra.c
@@ -893,7 +893,8 @@ static unsigned long tegra_pcie_port_get_pex_ctrl(struct tegra_pcie_port *port)
 	return ret;
 }
 
-static void tegra_pcie_port_reset(struct tegra_pcie_port *port)
+void __weak tegra_pcie_port_reset(struct tegra_pcie_port *port,
+				  unsigned int index)
 {
 	unsigned long ctrl = tegra_pcie_port_get_pex_ctrl(port);
 	unsigned long value;
@@ -928,7 +929,7 @@ static void tegra_pcie_port_enable(struct tegra_pcie_port *port)
 
 	afi_writel(pcie, value, ctrl);
 
-	tegra_pcie_port_reset(port);
+	tegra_pcie_port_reset(port, port->index);
 
 	if (soc->force_pca_enable) {
 		value = rp_readl(port, RP_VEND_CTL2);
@@ -979,7 +980,7 @@ static bool tegra_pcie_port_check_link(struct tegra_pcie_port *port)
 		} while (--timeout);
 
 retry:
-		tegra_pcie_port_reset(port);
+		tegra_pcie_port_reset(port, port->index);
 	} while (--retries);
 
 	return false;
-- 
2.9.4



More information about the U-Boot mailing list