PCI: tegra: Put PEX CLK & BIAS pads in DPD mode [Linux 5.3]

This Linux kernel change "PCI: tegra: Put PEX CLK & BIAS pads in DPD mode" is included in the Linux 5.3 release. This change is authored by Manikanta Maddireddy <mmaddireddy [at] nvidia.com> on Tue Jun 18 23:32:03 2019 +0530. The commit for this change in Linux stable tree is 2d8c736 (patch).

PCI: tegra: Put PEX CLK & BIAS pads in DPD mode

In Tegra210 AFI design has clamp value for the BIAS pad as 0, which keeps
the bias pad in non power down mode. This is leading to power consumption
of 2 mW in BIAS pad, even if the PCIe partition is powergated. To avoid
unnecessary power consumption, put PEX CLK & BIAS pads in deep power down
mode when PCIe partition is power gated.

Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Thierry Reding <treding@nvidia.com>

There are 13 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/pci/controller/pci-tegra.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 6be4ea7..0fd1c1a 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -30,6 +30,7 @@
 #include <linux/of_platform.h>
 #include <linux/pci.h>
 #include <linux/phy/phy.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/reset.h>
 #include <linux/sizes.h>
@@ -2853,6 +2854,7 @@ static int __maybe_unused tegra_pcie_pm_suspend(struct device *dev)

+   pinctrl_pm_select_idle_state(dev);

    return 0;
@@ -2868,6 +2870,13 @@ static int __maybe_unused tegra_pcie_pm_resume(struct device *dev)
        dev_err(dev, "tegra pcie power on fail: %d\n", err);
        return err;
+   err = pinctrl_pm_select_default_state(dev);
+   if (err < 0) {
+       dev_err(dev, "failed to disable PCIe IO DPD: %d\n", err);
+       goto poweroff;
+   }

@@ -2877,7 +2886,7 @@ static int __maybe_unused tegra_pcie_pm_resume(struct device *dev)
    err = clk_prepare_enable(pcie->pex_clk);
    if (err) {
        dev_err(dev, "failed to enable PEX clock: %d\n", err);
-       goto poweroff;
+       goto pex_dpd_enable;

@@ -2898,6 +2907,8 @@ static int __maybe_unused tegra_pcie_pm_resume(struct device *dev)
+   pinctrl_pm_select_idle_state(dev);

Leave a Reply

Your email address will not be published. Required fields are marked *