Skip to content

Commit c457ac0

Browse files
Mani-SadhasivamLorenzo Pieralisi
authored andcommitted
PCI: qcom-ep: Gate Master AXI clock to MHI bus during L1SS
During L1SS, gate the Master clock supplied to the MHI bus to save power. Link: https://lore.kernel.org/r/20220914075350.7992-7-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
1 parent 6dbba2b commit c457ac0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define PARF_SYS_CTRL 0x00
2828
#define PARF_DB_CTRL 0x10
2929
#define PARF_PM_CTRL 0x20
30+
#define PARF_MHI_CLOCK_RESET_CTRL 0x174
3031
#define PARF_MHI_BASE_ADDR_LOWER 0x178
3132
#define PARF_MHI_BASE_ADDR_UPPER 0x17c
3233
#define PARF_DEBUG_INT_EN 0x190
@@ -89,6 +90,9 @@
8990
#define PARF_PM_CTRL_READY_ENTR_L23 BIT(2)
9091
#define PARF_PM_CTRL_REQ_NOT_ENTR_L1 BIT(5)
9192

93+
/* PARF_MHI_CLOCK_RESET_CTRL fields */
94+
#define PARF_MSTR_AXI_CLK_EN BIT(1)
95+
9296
/* PARF_AXI_MSTR_RD_HALT_NO_WRITES register fields */
9397
#define PARF_AXI_MSTR_RD_HALT_NO_WRITE_EN BIT(0)
9498

@@ -394,6 +398,11 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *pci)
394398
pcie_ep->parf + PARF_MHI_BASE_ADDR_LOWER);
395399
writel_relaxed(0, pcie_ep->parf + PARF_MHI_BASE_ADDR_UPPER);
396400

401+
/* Gate Master AXI clock to MHI bus during L1SS */
402+
val = readl_relaxed(pcie_ep->parf + PARF_MHI_CLOCK_RESET_CTRL);
403+
val &= ~PARF_MSTR_AXI_CLK_EN;
404+
val = readl_relaxed(pcie_ep->parf + PARF_MHI_CLOCK_RESET_CTRL);
405+
397406
dw_pcie_ep_init_notify(&pcie_ep->pci.ep);
398407

399408
/* Enable LTSSM */

0 commit comments

Comments
 (0)