]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: a37xx: pci: Fix pcie_advk_link_up()
authorPali Rohár <pali@kernel.org>
Sat, 25 Sep 2021 22:54:41 +0000 (00:54 +0200)
committerStefan Roese <sr@denx.de>
Fri, 8 Oct 2021 06:33:52 +0000 (08:33 +0200)
Aardvark reports Disabled and Hot Reset LTSSM states as values >= 0x20.
Link is not up in these states, so fix pcie_advk_link_up() function.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/pci/pci-aardvark.c

index cf6e30f936fba75f25655b2c827e5d83003aac31..741e0431e118a2cd385fa429e91559dcf5f9082a 100644 (file)
 #define     LTSSM_SHIFT                                24
 #define     LTSSM_MASK                         0x3f
 #define     LTSSM_L0                           0x10
+#define     LTSSM_DISABLED                     0x20
 #define VENDOR_ID_REG                          (LMI_BASE_ADDR + 0x44)
 
 /* PCIe core controller registers */
@@ -569,7 +570,7 @@ static int pcie_advk_link_up(struct pcie_advk *pcie)
 
        val = advk_readl(pcie, CFG_REG);
        ltssm_state = (val >> LTSSM_SHIFT) & LTSSM_MASK;
-       return ltssm_state >= LTSSM_L0;
+       return ltssm_state >= LTSSM_L0 && ltssm_state < LTSSM_DISABLED;
 }
 
 /**