public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marcel Ziswiler <marcel@ziswiler.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] pci: tegra: make tegra_pcie_port_reset weak function with explicit index
Date: Fri,  4 Aug 2017 18:10:02 +0200	[thread overview]
Message-ID: <20170804161004.27770-4-marcel@ziswiler.com> (raw)
In-Reply-To: <20170804161004.27770-1-marcel@ziswiler.com>

From: Marcel Ziswiler <marcel.ziswiler@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@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

  parent reply	other threads:[~2017-08-04 16:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04 16:09 [U-Boot] [PATCH 0/5] fix apalis-tk1 pcie gigabit ethernet operation Marcel Ziswiler
2017-08-04 16:10 ` [U-Boot] [PATCH 1/5] configs: apalis-tk1: fix boot failure using ext4 rootfs Marcel Ziswiler
2017-08-04 16:10 ` [U-Boot] [PATCH 2/5] apalis-tk1: add missing as3722 gpio0 configuration Marcel Ziswiler
2017-08-06  5:16   ` Simon Glass
2017-08-04 16:10 ` Marcel Ziswiler [this message]
2017-08-04 16:33   ` [U-Boot] [PATCH 3/5] pci: tegra: make tegra_pcie_port_reset weak function with explicit index Stephen Warren
2017-08-07 12:47     ` Marcel Ziswiler
2017-08-04 16:10 ` [U-Boot] [PATCH 4/5] power: as3722: add as3722_ldo_set_voltage signature to header file Marcel Ziswiler
2017-08-06  5:16   ` Simon Glass
2017-08-04 16:10 ` [U-Boot] [PATCH 5/5] apalis-tk1: fix pcie reset for reliable gigabit ethernet operation Marcel Ziswiler

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=20170804161004.27770-4-marcel@ziswiler.com \
    --to=marcel@ziswiler.com \
    --cc=u-boot@lists.denx.de \
    /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