aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/pci-aardvark.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-02-15 11:23:36 +0100
committerStefan Roese <sr@denx.de>2022-02-17 14:17:07 +0100
commit6c7ccb9700d48a6a4a6254f144e58329074fac9e (patch)
tree578d8c5e3041bcc84866ef04ea121a84dd9c3971 /drivers/pci/pci-aardvark.c
parent2727e9dd2795c38a20dda9bda24c3f18fbbbb2bf (diff)
downloadu-boot-6c7ccb9700d48a6a4a6254f144e58329074fac9e.zip
u-boot-6c7ccb9700d48a6a4a6254f144e58329074fac9e.tar.gz
u-boot-6c7ccb9700d48a6a4a6254f144e58329074fac9e.tar.bz2
arm: a37xx: pci: Register controller also when no PCIe card is connected
Allow access to config space of PCIe Root Port (which is always present on the root bus) even when PCIe link is down or no card is connected. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/pci/pci-aardvark.c')
-rw-r--r--drivers/pci/pci-aardvark.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index ccaeeca..c795ef1 100644
--- a/drivers/pci/pci-aardvark.c
+++ b/drivers/pci/pci-aardvark.c
@@ -645,11 +645,8 @@ retry:
* @pcie: The PCI device to access
*
* Wait up to 1 second for link training to be accomplished.
- *
- * Return 1 (true) if link training ends up with link up success.
- * Return 0 (false) if link training ends up with link up failure.
*/
-static int pcie_advk_wait_for_link(struct pcie_advk *pcie)
+static void pcie_advk_wait_for_link(struct pcie_advk *pcie)
{
int retries;
@@ -657,15 +654,13 @@ static int pcie_advk_wait_for_link(struct pcie_advk *pcie)
for (retries = 0; retries < LINK_MAX_RETRIES; retries++) {
if (pcie_advk_link_up(pcie)) {
printf("PCIe: Link up\n");
- return 0;
+ return;
}
udelay(LINK_WAIT_TIMEOUT);
}
printf("PCIe: Link down\n");
-
- return -ETIMEDOUT;
}
/*
@@ -898,8 +893,7 @@ static int pcie_advk_setup_hw(struct pcie_advk *pcie)
return -EINVAL;
/* Wait for PCIe link up */
- if (pcie_advk_wait_for_link(pcie))
- return -ENXIO;
+ pcie_advk_wait_for_link(pcie);
return 0;
}