MIPS: Alchemy: Fix cpu clock calculation
authorManuel Lauss <[email protected]>
Wed, 18 Feb 2015 10:01:56 +0000 (11:01 +0100)
committerRalf Baechle <[email protected]>
Fri, 20 Feb 2015 12:01:42 +0000 (13:01 +0100)
commit69e4e63ec816a7e22cc3aa14bc7ef4ac734d370c
treee568482e3fd178211e3caa00f9cb4d64ae31a804
parent200276e6730c2817a77cfa6fc7e39ab3a63c4646
MIPS: Alchemy: Fix cpu clock calculation

The current code uses bits 0-6 of the sys_cpupll register to calculate
core clock speed.  However this is only valid on Au1300, on all earlier
models the hardware only uses bits 0-5 to generate core clock.

This fixes clock calculation on the MTX1 (Au1500), where bit 6 of cpupll
is set as well, which ultimately lead the code to calculate a bogus cpu
core clock and also uart base clock down the line.

Signed-off-by: Manuel Lauss <[email protected]>
Reported-by: John Crispin <[email protected]>
Tested-by: Bruno Randolf <[email protected]>
Cc: [email protected] [v3.17+]
Cc: Linux-MIPS <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/9279/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/alchemy/common/clock.c