Skip to content

Commit 6990e25

Browse files
P33Mpelwell
authored andcommitted
pcie-brcmstb: move the unilateral disable of CLKREQ# before link-up
If a platform has a pull-up on CLKREQ# with no endpoint control, then this could cause link failure in the idle time between PERST# deassert and brcm_config_clkreq(). Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
1 parent a7b4767 commit 6990e25

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,10 +1584,6 @@ static void brcm_config_clkreq(struct brcm_pcie *pcie)
15841584
mode = "safe";
15851585
}
15861586

1587-
/* Start out assuming safe mode (both mode bits cleared) */
1588-
clkreq_cntl = readl(pcie->base + HARD_DEBUG(pcie));
1589-
clkreq_cntl &= ~PCIE_CLKREQ_MASK;
1590-
15911587
if (strcmp(mode, "no-l1ss") == 0) {
15921588
/*
15931589
* "no-l1ss" -- Provides Clock Power Management, L0s, and
@@ -1784,6 +1780,11 @@ static int brcm_pcie_start_link(struct brcm_pcie *pcie)
17841780

17851781
brcm_pcie_stats_trigger(pcie, 0);
17861782

1783+
/* Disable CLKREQ# input prior to link-up */
1784+
tmp = readl(pcie->base + HARD_DEBUG(pcie));
1785+
tmp &= ~PCIE_CLKREQ_MASK;
1786+
writel(tmp, pcie->base + HARD_DEBUG(pcie));
1787+
17871788
/* Unassert the fundamental reset */
17881789
if (pcie->tperst_clk_ms) {
17891790
/*

0 commit comments

Comments
 (0)