Skip to content

Commit 0391632

Browse files
Mani-Sadhasivambjorn-helgaas
authored andcommitted
PCI: qcom-ep: Disable Master AXI Clock when there is no PCIe traffic
The Master AXI clock can be disabled when it is not used i.e., when there is no traffic on the PCIe bus. This helps to save power during idle state. [bhelgaas: tidy and wrap comment] Link: https://lore.kernel.org/r/20220914075350.7992-8-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent c457ac0 commit 0391632

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/pci/controller/dwc/pcie-qcom-ep.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
/* PARF_SYS_CTRL register fields */
106106
#define PARF_SYS_CTRL_AUX_PWR_DET BIT(4)
107107
#define PARF_SYS_CTRL_CORE_CLK_CGC_DIS BIT(6)
108+
#define PARF_SYS_CTRL_MSTR_ACLK_CGC_DIS BIT(10)
108109
#define PARF_SYS_CTRL_SLV_DBI_WAKE_DISABLE BIT(11)
109110

110111
/* PARF_DB_CTRL register fields */
@@ -341,8 +342,14 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *pci)
341342
val &= ~PARF_Q2A_FLUSH_EN;
342343
writel_relaxed(val, pcie_ep->parf + PARF_Q2A_FLUSH);
343344

344-
/* Disable DBI Wakeup, core clock CGC and enable AUX power */
345+
/*
346+
* Disable Master AXI clock during idle. Do not allow DBI access
347+
* to take the core out of L1. Disable core clock gating that
348+
* gates PIPE clock from propagating to core clock. Report to the
349+
* host that Vaux is present.
350+
*/
345351
val = readl_relaxed(pcie_ep->parf + PARF_SYS_CTRL);
352+
val &= ~PARF_SYS_CTRL_MSTR_ACLK_CGC_DIS;
346353
val |= PARF_SYS_CTRL_SLV_DBI_WAKE_DISABLE |
347354
PARF_SYS_CTRL_CORE_CLK_CGC_DIS |
348355
PARF_SYS_CTRL_AUX_PWR_DET;

0 commit comments

Comments
 (0)