ARM: tegra: clock: Add reset propagation delays
Alex Frid [Wed, 1 May 2013 20:14:44 +0000 (13:14 -0700)]
Added explicit reset propagation delay in resume procedure.

Change-Id: I5ace9c33d5abccaf52eba5fe52482ab28a8060f9
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/224585
(cherry picked from commit 5d78cccb04fede95c6c1b9f90bea17da01314c6d)
Reviewed-on: http://git-master/r/225495
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

arch/arm/mach-tegra/clock.h
arch/arm/mach-tegra/tegra11_clocks.c

index 11c5d36..c45660e 100644 (file)
@@ -37,6 +37,8 @@
 #endif
 #endif
 
+#define RESET_PROPAGATION_DELAY        5
+
 #ifndef __ASSEMBLY__
 
 #include <linux/clk-provider.h>
index 86b0066..e83095b 100644 (file)
@@ -4010,7 +4010,7 @@ static int tegra11_periph_clk_enable(struct clk *c)
        clk_writel_delay(PERIPH_CLK_TO_BIT(c), PERIPH_CLK_TO_ENB_SET_REG(c));
        if (!(c->flags & PERIPH_NO_RESET) && !(c->flags & PERIPH_MANUAL_RESET)) {
                if (clk_readl(PERIPH_CLK_TO_RST_REG(c)) & PERIPH_CLK_TO_BIT(c)) {
-                       udelay(5);      /* reset propagation delay */
+                       udelay(RESET_PROPAGATION_DELAY);
                        clk_writel(PERIPH_CLK_TO_BIT(c), PERIPH_CLK_TO_RST_CLR_REG(c));
                }
        }
@@ -7624,6 +7624,8 @@ static void tegra11_clk_resume(void)
                off <= PERIPH_CLK_SOURCE_SOC_THERM; off += 4)
                clk_writel(*ctx++, off);
 
+       udelay(RESET_PROPAGATION_DELAY);
+
        clk_writel(*ctx++, RST_DEVICES_L);
        clk_writel(*ctx++, RST_DEVICES_H);
        clk_writel(*ctx++, RST_DEVICES_U);