PCI: brcmstb: Assert PERST# on BCM2711
authorJim Quinlan <james.quinlan@broadcom.com>
Fri, 23 Jun 2023 14:40:57 +0000 (10:40 -0400)
committerLorenzo Pieralisi <lpieralisi@kernel.org>
Thu, 24 Aug 2023 15:33:58 +0000 (17:33 +0200)
The current PCIe driver assumes PERST# is asserted when probe() is invoked.
Some older versions of the 2711/RPi bootloader left PERST# unasserted, as
the Raspian OS does assert PERST# on probe().  For this reason, we assert
PERST# for BCM2711 SOCs (i.e. RPi).

Link: https://lore.kernel.org/r/20230623144100.34196-5-james.quinlan@broadcom.com
Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
drivers/pci/controller/pcie-brcmstb.c

index f593a42..74808e9 100644 (file)
@@ -874,6 +874,11 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
 
        /* Reset the bridge */
        pcie->bridge_sw_init_set(pcie, 1);
+
+       /* Ensure that PERST# is asserted; some bootloaders may deassert it. */
+       if (pcie->type == BCM2711)
+               pcie->perst_set(pcie, 1);
+
        usleep_range(100, 200);
 
        /* Take the bridge out of reset */