Skip to content

Commit

Permalink
powerpc/qe: Fixup QE_General4 errata
Browse files Browse the repository at this point in the history
QE_General4 should only round up the divisor iff divisor is > 3.
Rounding up lower divisors makes the error too big, causing USB
on MPC832x to fail.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
  • Loading branch information
joakim-tjernlund authored and kumargala committed Nov 24, 2011
1 parent 05011f3 commit ae5f8c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/qe_lib/qe.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
/* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says
that the BRG divisor must be even if you're not using divide-by-16
mode. */
if (!div16 && (divisor & 1))
if (!div16 && (divisor & 1) && (divisor > 3))
divisor++;

tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
Expand Down

0 comments on commit ae5f8c1

Please sign in to comment.