summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2012-04-05 10:08:28 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2012-04-05 10:08:28 +0200
commite9c178f64bea7f072e2c6d3c8aa03117f795f1b5 (patch)
tree9f21b3e3be4710541c0482ebcec9d70a7fdef401
parent99315ffcb06c924f4ef606248e7ede64d180ab04 (diff)
LEON APBUART: bad formula for scaler to baudrate conversion
-rw-r--r--c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
index 71a14d127a..3a1c070b45 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
@@ -499,7 +499,7 @@ int apbuart_get_baud(struct apbuart_priv *uart)
drvmgr_freq_get(uart->dev, DEV_APB_SLV, &core_clk_hz);
/* Calculate baud rate from generator "scaler" number */
- return core_clk_hz / (scaler * 8);
+ return core_clk_hz / ((scaler + 1) * 8);
}
struct apbuart_baud *apbuart_get_baud_closest(struct apbuart_priv *uart)