]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MIPS: ath79: use correct fractional dividers for {CPU,DDR}_PLL on AR934x
authorGabor Juhos <juhosg@openwrt.org>
Sat, 1 Sep 2012 16:46:00 +0000 (18:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:50:26 +0000 (05:50 +0900)
commitc2bb4485c33a281d9b58e20c811dfe5711ef9f62
treed9fc7316a06363d1950f5ef4054959e00bc51f5c
parenta6d26c56e266a7b72dc48833f0429b4e0479f8cd
MIPS: ath79: use correct fractional dividers for {CPU,DDR}_PLL on AR934x

commit 65fc7f9957c52ad4fdf4ee5dfe3a75aa0a633d39 upstream.

The current dividers in the code are wrong and this
leads to broken CPU frequency calculation on boards
where the fractional part is used.

For example, if the SoC is running from a 40MHz
reference clock, refdiv=1, nint=14, outdiv=0 and
nfrac=31 the real frequency is 579.375MHz but the
current code calculates 569.687MHz instead.

Because the system time is indirectly related to
the CPU frequency the broken computation causes
drift in the system time.

The correct divider is 2^6 for the CPU PLL and 2^10
for the DDR PLL. Use the correct values to fix the
issue.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/4305/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/ath79/clock.c