From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel Ziswiler Date: Fri, 4 Aug 2017 18:10:02 +0200 Subject: [U-Boot] [PATCH 3/5] pci: tegra: make tegra_pcie_port_reset weak function with explicit index In-Reply-To: <20170804161004.27770-1-marcel@ziswiler.com> References: <20170804161004.27770-1-marcel@ziswiler.com> Message-ID: <20170804161004.27770-4-marcel@ziswiler.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Marcel Ziswiler 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 --- 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