projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36c50f7
)
[POWERPC] cpm2: Fix off-by-one error in setbrg().
author
Scott Wood
<
[email protected]
>
Wed, 5 Sep 2007 19:29:10 +0000
(14:29 -0500)
committer
Kumar Gala
<
[email protected]
>
Mon, 10 Sep 2007 21:02:09 +0000
(16:02 -0500)
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: Scott Wood <
[email protected]
>
Signed-off-by: Kumar Gala <
[email protected]
>
arch/powerpc/sysdev/cpm2_common.c
patch
|
blob
|
history
diff --git
a/arch/powerpc/sysdev/cpm2_common.c
b/arch/powerpc/sysdev/cpm2_common.c
index 9244129747955d062b7a255c3797b97a23b88ab4..c827715a50907704ad1e7d4b65d7206fa9988477 100644
(file)
--- a/
arch/powerpc/sysdev/cpm2_common.c
+++ b/
arch/powerpc/sysdev/cpm2_common.c
@@
-102,7
+102,7
@@
cpm_setbrg(uint brg, uint rate)
brg -= 4;
}
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);
}