Skip to content

Commit 3164f27

Browse files
committed
Merge branch 'remotes/lorenzo/pci/apple'
- Enable clock gating to save power (Hector Martin) - Fix REFCLK1 enable/poll logic (Hector Martin) * remotes/lorenzo/pci/apple: PCI: apple: Fix REFCLK1 enable/poll logic PCI: apple: Enable clock gating
2 parents 800cee8 + 75d36df commit 3164f27

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/pci/controller/pcie-apple.c

Lines changed: 7 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)
@@ -553,6 +554,9 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
553554
return ret;
554555
}
555556

557+
rmw_clear(PORT_REFCLK_CGDIS, port->base + PORT_REFCLK);
558+
rmw_clear(PORT_APPCLK_CGDIS, port->base + PORT_APPCLK);
559+
556560
ret = apple_pcie_port_setup_irq(port);
557561
if (ret)
558562
return ret;

0 commit comments

Comments
 (0)