MIPS: lantiq: Return correct value for fpi clock on ar9
authorJohn Crispin <blogic@openwrt.org>
Wed, 4 Nov 2015 12:14:13 +0000 (13:14 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 11 Nov 2015 07:38:18 +0000 (08:38 +0100)
Some configurations of AR9 reported the incorrect speed for the fpi bus.

Signed-off-by: Ben Mulvihill <ben.mulvihill@gmail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11448/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/lantiq/xway/clk.c

index 80aad3080ef859955ad59808cda503ba24491b2e..07f6d5b0b65ee10ccca231e0abab24d08462332e 100644 (file)
@@ -88,8 +88,9 @@ unsigned long ltq_ar9_fpi_hz(void)
        unsigned long sys = ltq_ar9_sys_hz();
 
        if (ltq_cgu_r32(CGU_SYS) & BIT(0))
-               return sys;
-       return sys >> 1;
+               return sys / 3;
+       else
+               return sys / 2;
 }
 
 unsigned long ltq_ar9_cpu_hz(void)