[PATCH u-boot-marvell 2/3] arm: a37xx: pci: Register controller also when no PCIe card is connected

Stefan Roese sr at denx.de
Wed Feb 16 09:58:47 CET 2022


On 2/15/22 11:23, Pali Rohár wrote:
> 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 at kernel.org>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   drivers/pci/pci-aardvark.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
> index ccaeecaca8e3..c795ef10b884 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;
>   }

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list