summaryrefslogtreecommitdiff
path: root/cpu/at91rm9200/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/at91rm9200/serial.c')
-rw-r--r--cpu/at91rm9200/serial.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/cpu/at91rm9200/serial.c b/cpu/at91rm9200/serial.c
index fb03851..a9693bf 100644
--- a/cpu/at91rm9200/serial.c
+++ b/cpu/at91rm9200/serial.c
@@ -55,17 +55,11 @@ void serial_setbrg (void)
if ((baudrate = gd->baudrate) <= 0)
baudrate = CONFIG_BAUDRATE;
- if (baudrate == CONFIG_BAUDRATE) {
+ if (baudrate == 0 || baudrate == CONFIG_BAUDRATE)
us->US_BRGR = CFG_AT91C_BRGR_DIVISOR; /* hardcode so no __divsi3 */
- } else {
-#if 0
- /* 33 -> 115200 */
- us->US_BRGR = 33 * (115200/baudrate);
-#else
+ else
/* MASTER_CLOCK/(16 * baudrate) */
us->US_BRGR = (AT91C_MASTER_CLOCK >> 4)/baudrate;
-#endif
- }
}
int serial_init (void)