ARM: tegra11: clock: Move auto-refresh control to CCFIFO
Alex Frid [Sun, 19 May 2013 06:23:27 +0000 (23:23 -0700)]
Disabled/Enabled auto-refresh during EMC clock change using CCFIFO
mechanism.

Bug 1339693

Change-Id: I00fc1cc4fe4668ed84c1e7a4e105ebbb684b0ca5
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/230986
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

arch/arm/mach-tegra/tegra11_emc.c

index c5afa6a..03daaa1 100644 (file)
@@ -623,7 +623,7 @@ static noinline void emc_set_clock(const struct tegra11_emc_table *next_timing,
                overwrite_mrs_wait_cnt(next_timing, zcal_long);
 
        /* 5.2 disable auto-refresh to save time after clock change */
-       emc_writel(EMC_REFCTRL_DISABLE_ALL(dram_dev_num), EMC_REFCTRL);
+       ccfifo_writel(EMC_REFCTRL_DISABLE_ALL(dram_dev_num), EMC_REFCTRL);
 
        /* 6. turn Off dll and enter self-refresh on DDR3 */
        if (dram_type == DRAM_TYPE_DDR3) {
@@ -640,6 +640,9 @@ static noinline void emc_set_clock(const struct tegra11_emc_table *next_timing,
        if (dram_type == DRAM_TYPE_DDR3)
                ccfifo_writel(DRAM_BROADCAST(dram_dev_num), EMC_SELF_REF);
 
+       /* 8.1 re-enable auto-refresh */
+       ccfifo_writel(EMC_REFCTRL_ENABLE_ALL(dram_dev_num), EMC_REFCTRL);
+
        /* 9. set dram mode registers */
        set_dram_mode(next_timing, last_timing, dll_change);
 
@@ -665,8 +668,7 @@ static noinline void emc_set_clock(const struct tegra11_emc_table *next_timing,
           change EMC clock source register wait for clk change completion */
        do_clock_change(clk_setting);
 
-       /* 14.1 re-enable auto-refresh */
-       emc_writel(EMC_REFCTRL_ENABLE_ALL(dram_dev_num), EMC_REFCTRL);
+       /* 14.1 re-enable auto-refresh - moved to ccfifo in 8.1 */
 
        /* 14.2 program burst_up_down registers if emc rate is going up */
        if (next_timing->rate > last_timing->rate) {