Skip to content

Commit 75d36df

Browse files
marcanLorenzo Pieralisi
authored andcommitted
PCI: apple: Fix REFCLK1 enable/poll logic
REFCLK1 has req/ack bits that need to be programmed, just like REFCLK0. Link: https://lore.kernel.org/r/[email protected] Fixes: 1e33888 ("PCI: apple: Add initial hardware bring-up") Signed-off-by: Hector Martin <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Marc Zyngier <[email protected]>
1 parent 754bb7a commit 75d36df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/pci/controller/pcie-apple.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@
4242
#define CORE_FABRIC_STAT_MASK 0x001F001F
4343
#define CORE_LANE_CFG(port) (0x84000 + 0x4000 * (port))
4444
#define CORE_LANE_CFG_REFCLK0REQ BIT(0)
45-
#define CORE_LANE_CFG_REFCLK1 BIT(1)
45+
#define CORE_LANE_CFG_REFCLK1REQ BIT(1)
4646
#define CORE_LANE_CFG_REFCLK0ACK BIT(2)
47+
#define CORE_LANE_CFG_REFCLK1ACK BIT(3)
4748
#define CORE_LANE_CFG_REFCLKEN (BIT(9) | BIT(10))
4849
#define CORE_LANE_CTL(port) (0x84004 + 0x4000 * (port))
4950
#define CORE_LANE_CTL_CFGACC BIT(15)
@@ -482,9 +483,9 @@ static int apple_pcie_setup_refclk(struct apple_pcie *pcie,
482483
if (res < 0)
483484
return res;
484485

485-
rmw_set(CORE_LANE_CFG_REFCLK1, pcie->base + CORE_LANE_CFG(port->idx));
486+
rmw_set(CORE_LANE_CFG_REFCLK1REQ, pcie->base + CORE_LANE_CFG(port->idx));
486487
res = readl_relaxed_poll_timeout(pcie->base + CORE_LANE_CFG(port->idx),
487-
stat, stat & CORE_LANE_CFG_REFCLK1,
488+
stat, stat & CORE_LANE_CFG_REFCLK1ACK,
488489
100, 50000);
489490

490491
if (res < 0)

0 commit comments

Comments
 (0)