mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
IXP: Add full baud-rate support for ixp42x, ixp45x and ixp46x
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
a2df4da31b
commit
7b74ebe723
1 changed files with 10 additions and 14 deletions
|
@ -31,25 +31,22 @@
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <asm/arch/ixp425.h>
|
#include <asm/arch/ixp425.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 14.7456 MHz
|
||||||
|
* Baud Rate = --------------
|
||||||
|
* 16 x Divisor
|
||||||
|
*/
|
||||||
|
#define SERIAL_CLOCK 921600
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
void serial_setbrg (void)
|
void serial_setbrg (void)
|
||||||
{
|
{
|
||||||
unsigned int quot = 0;
|
unsigned int quot = 0;
|
||||||
int uart = CFG_IXP425_CONSOLE;
|
int uart = CFG_IXP425_CONSOLE;
|
||||||
|
|
||||||
if (gd->baudrate == 1200)
|
if ((gd->baudrate <= SERIAL_CLOCK) && (SERIAL_CLOCK % gd->baudrate == 0))
|
||||||
quot = 192;
|
quot = SERIAL_CLOCK / gd->baudrate;
|
||||||
else if (gd->baudrate == 9600)
|
|
||||||
quot = 96;
|
|
||||||
else if (gd->baudrate == 19200)
|
|
||||||
quot = 48;
|
|
||||||
else if (gd->baudrate == 38400)
|
|
||||||
quot = 24;
|
|
||||||
else if (gd->baudrate == 57600)
|
|
||||||
quot = 16;
|
|
||||||
else if (gd->baudrate == 115200)
|
|
||||||
quot = 8;
|
|
||||||
else
|
else
|
||||||
hang ();
|
hang ();
|
||||||
|
|
||||||
|
@ -65,7 +62,6 @@ void serial_setbrg (void)
|
||||||
IER(uart) = IER_UUE;
|
IER(uart) = IER_UUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialise the serial port with the given baudrate. The settings
|
* Initialise the serial port with the given baudrate. The settings
|
||||||
* are always 8 data bits, no parity, 1 stop bit, no start bits.
|
* are always 8 data bits, no parity, 1 stop bit, no start bits.
|
||||||
|
|
Loading…
Add table
Reference in a new issue