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
(cherry picked from commit 2c25e71aa46170784809683c2457a885d704373f)
Reviewed-on: http://git-master/r/275554
(cherry picked from commit 1abf6e4757cd5afabe7c3069ff1db60709314fb8)
Reviewed-on: http://git-master/r/277519
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
(cherry picked from commit fc32b7e487d05c26c28e51343cc3d13066327434)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>

arch/arm/mach-tegra/tegra11_emc.c

index 36aa093..b4b29a2 100644 (file)
@@ -693,7 +693,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) {
@@ -710,6 +710,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);
 
@@ -735,8 +738,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) {