ARM: tegra: t124: update pinmux LP0 entry/exit sequence
Ashwini Ghuge [Mon, 20 May 2013 08:39:54 +0000 (13:39 +0530)]
Updated pinmux LP0 entry/exit sequence to fix
pad glitches and clear DPD_SAMPLE immediately
after pinmux restoration on LP0 exit

Bug 1202456

Change-Id: I8488642db1dccf43ce26742a9716f2d3f4fc9c65
Signed-off-by: Ashwini Ghuge <aghuge@nvidia.com>
Reviewed-on: http://git-master/r/227065
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

arch/arm/mach-tegra/pinmux-t12-tables.c
arch/arm/mach-tegra/pm.c

index c685b3a..de0856e 100644 (file)
 #include "gpio-names.h"
 #include "iomap.h"
 
+#define PMC_DPD_SAMPLE         0x20
+#define PMC_IO_DPD_REQ         0x1B8
+#define PMC_IO_DPD2_REQ                0x1C0
+
 #define PINGROUP_REG_A 0x868
 #define MUXCTL_REG_A   0x3000
 
@@ -569,12 +573,9 @@ static int tegra12x_pinmux_suspend(void)
        return 0;
 }
 
-#define PMC_IO_DPD_REQ         0x1B8
-#define PMC_IO_DPD2_REQ                0x1C0
-
 static void tegra12x_pinmux_resume(void)
 {
-       void __iomem *pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
+       static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
        unsigned int i;
        u32 *ctx = pinmux_reg;
        u32 *tmp = pinmux_reg;
@@ -587,8 +588,8 @@ static void tegra12x_pinmux_resume(void)
                        tegra_soc_pingroups[i].mux_reg);
        }
 
-       writel(0x400fffff, pmc_base + PMC_IO_DPD_REQ);
-       writel(0x40001fff, pmc_base + PMC_IO_DPD2_REQ);
+       writel(0x400fffff, pmc + PMC_IO_DPD_REQ);
+       writel(0x40001fff, pmc + PMC_IO_DPD2_REQ);
 
        for (i = 0; i < TEGRA_MAX_PINGROUP; i++)
                pg_writel(*ctx++, tegra_soc_pingroups[i].mux_bank,
@@ -597,6 +598,9 @@ static void tegra12x_pinmux_resume(void)
        for (i = 0; i < ARRAY_SIZE(tegra_soc_drive_pingroups); i++)
                pg_writel(*ctx++, tegra_soc_drive_pingroups[i].reg_bank,
                        tegra_soc_drive_pingroups[i].reg);
+
+       /* Clear DPD sample */
+       writel(0x0, pmc + PMC_DPD_SAMPLE);
 }
 
 static struct syscore_ops tegra_pinmux_syscore_ops = {
index ee09791..cb04627 100644 (file)
@@ -973,9 +973,12 @@ static void tegra_pm_set(enum tegra_suspend_mode mode)
                /* Enable DPD sample to trigger sampling pads data and direction
                 * in which pad will be driven during lp0 mode*/
                writel(0x1, pmc + PMC_DPD_SAMPLE);
-#if !defined(CONFIG_ARCH_TEGRA_3x_SOC) && !defined(CONFIG_ARCH_TEGRA_2x_SOC) &&\
-                                        !defined(CONFIG_ARCH_TEGRA_14x_SOC)
+#if !defined(CONFIG_ARCH_TEGRA_3x_SOC) && !defined(CONFIG_ARCH_TEGRA_2x_SOC)
+#if defined(CONFIG_ARCH_TEGRA_11x_SOC)
                writel(0x800fdfff, pmc + PMC_IO_DPD_REQ);
+#else
+               writel(0x800fffff, pmc + PMC_IO_DPD_REQ);
+#endif
                writel(0x80001fff, pmc + PMC_IO_DPD2_REQ);
 #endif