Commit 0357ae8f authored by Marek Vasut's avatar Marek Vasut Committed by Eric Miao

[ARM] pxa: cpufreq-pxa2xx: fix DRI recomputation routine

This patch:
1) Simpifies the DRI recomputation routine by pulling out the common code
2) Fixes a bug in PXA27x DRI recomputation caused by incorrect parenthesis
Signed-off-by: default avatarMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 5852984a
...@@ -256,13 +256,9 @@ static void init_sdram_rows(void) ...@@ -256,13 +256,9 @@ static void init_sdram_rows(void)
static u32 mdrefr_dri(unsigned int freq) static u32 mdrefr_dri(unsigned int freq)
{ {
u32 dri = 0; u32 interval = freq * SDRAM_TREF / sdram_rows;
if (cpu_is_pxa25x()) return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
if (cpu_is_pxa27x())
dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
return dri;
} }
/* find a valid frequency point */ /* find a valid frequency point */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment