[PATCH] cpm2: Round the baud-rate clock divider to the nearest integer.

Scott Wood scottwood at freescale.com
Fri Nov 21 06:53:48 EST 2008


On Thu, Nov 20, 2008 at 01:32:23PM +0100, Laurent Pinchart wrote:
> Instead of rounding the divider down, improve the baud-rate generators
> accuracy by rounding to the nearest integer.
> 
> Signed-off-by: Laurent Pinchart <laurentp at cse-semaphore.com>

This makes things worse on mpc8272ads -- the result of the division is
13.56, but I only get error-free serial output when rounding down.  I
don't think the remote end has timing problems, as I don't see this with
any other board.

Possibly the crystal is a little off, or maybe it's just better to be a
little too fast than a little too slow for some reason?

Maybe we should change CPM_CLK to be MAIN_CLK/4 rather than MAIN_CLK/16
when the BRG clock is below a certain frequency.

-Scott



More information about the Linuxppc-dev mailing list