Cleanup serial console baudrate calculation on AT91RM9200

This commit is contained in:
wdenk
2005-04-20 12:36:05 +00:00
parent b2323ea6f9
commit ec0ca73190
3 changed files with 47 additions and 5 deletions

View File

@@ -55,11 +55,8 @@ void serial_setbrg (void)
if ((baudrate = gd->baudrate) <= 0)
baudrate = CONFIG_BAUDRATE;
if (baudrate == 0 || baudrate == CONFIG_BAUDRATE)
us->US_BRGR = CFG_AT91C_BRGR_DIVISOR; /* hardcode so no __divsi3 */
else
/* MASTER_CLOCK/(16 * baudrate) */
us->US_BRGR = (AT91C_MASTER_CLOCK >> 4)/baudrate;
/* MASTER_CLOCK/(16 * baudrate) */
us->US_BRGR = (AT91C_MASTER_CLOCK >> 4)/baudrate;
}
int serial_init (void)