mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 06:50:58 +07:00
[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: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
This commit is contained in:
parent
76d61e4ee0
commit
3d3d0fbf4d
@ -256,13 +256,9 @@ static void init_sdram_rows(void)
|
||||
|
||||
static u32 mdrefr_dri(unsigned int freq)
|
||||
{
|
||||
u32 dri = 0;
|
||||
u32 interval = freq * SDRAM_TREF / sdram_rows;
|
||||
|
||||
if (cpu_is_pxa25x())
|
||||
dri = ((freq * SDRAM_TREF) / (sdram_rows * 32));
|
||||
if (cpu_is_pxa27x())
|
||||
dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32;
|
||||
return dri;
|
||||
return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32;
|
||||
}
|
||||
|
||||
/* find a valid frequency point */
|
||||
|
Loading…
Reference in New Issue
Block a user