diff options
author | wdenk <wdenk> | 2003-07-15 20:04:06 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-07-15 20:04:06 +0000 |
commit | 2e5983d2ea5ff21406408c18c5b8fa12d4250908 (patch) | |
tree | 829991db5c6a66aab9219183c887ac0df423976e /drivers/serial.c | |
parent | 6dff55297283ebe16096e25f2dadb54e4b6fd9fc (diff) | |
download | u-boot-imx-2e5983d2ea5ff21406408c18c5b8fa12d4250908.zip u-boot-imx-2e5983d2ea5ff21406408c18c5b8fa12d4250908.tar.gz u-boot-imx-2e5983d2ea5ff21406408c18c5b8fa12d4250908.tar.bz2 |
Patches by Kshitij, 04 Jul 2003
- added support for arm925t cpu core
- added support for TI OMAP 1510 Innovator Board
Diffstat (limited to 'drivers/serial.c')
-rw-r--r-- | drivers/serial.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/serial.c b/drivers/serial.c index 36d0e6e..f28ad80 100644 --- a/drivers/serial.c +++ b/drivers/serial.c @@ -42,12 +42,22 @@ static NS16550_t console = (NS16550_t) CFG_NS16550_COM4; #error no valid console defined #endif -int serial_init (void) +static int calc_divisor (void) { DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_OMAP1510 + /* If can't cleanly clock 115200 set div to 1 */ + if ((CFG_NS16550_CLK == 12000000) && (gd->baudrate == 115200)) { + console->osc_12m_sel = OSC_12M_SEL; /* enable 6.5 * divisor */ + return (1); /* return 1 for base divisor */ + } +#endif + return (CFG_NS16550_CLK / 16 / gd->baudrate); +} - int clock_divisor = (CFG_NS16550_CLK + gd->baudrate * 8 ) - / (gd->baudrate * 16); +int serial_init (void) +{ + int clock_divisor = calc_divisor(); #ifdef CFG_NS87308 initialise_ns87308(); @@ -91,10 +101,9 @@ serial_tstc(void) void serial_setbrg (void) { - DECLARE_GLOBAL_DATA_PTR; - - int clock_divisor = CFG_NS16550_CLK / 16 / gd->baudrate; + int clock_divisor; + clock_divisor = calc_divisor(); NS16550_reinit(console, clock_divisor); } |