Commit 83fcdb4b authored by Scott Wood's avatar Scott Wood Committed by Kumar Gala

[POWERPC] cpm2: Fix off-by-one error in setbrg().

The hardware adds one to the BRG value to get the divider, so it must
be subtracted by software.  Without this patch, characters will occasionally
be corrupted.
Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 36c50f72
...@@ -102,7 +102,7 @@ cpm_setbrg(uint brg, uint rate) ...@@ -102,7 +102,7 @@ cpm_setbrg(uint brg, uint rate)
brg -= 4; brg -= 4;
} }
bp += brg; bp += brg;
*bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN; out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN);
cpm2_unmap(bp); cpm2_unmap(bp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment