diff options
author | wdenk <wdenk> | 2004-02-12 00:47:09 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2004-02-12 00:47:09 +0000 |
commit | bf9e3b38f77c2eac620263dd60437c6ec47a27bf (patch) | |
tree | d03891090553d167f3eb08d7f9c3f2532e43fcc2 /board/bmw/ns16550.c | |
parent | a2d18bb7d31e7b971386fef505ff0218f3b6e893 (diff) | |
download | bootable_bootloader_goldelico_gta04-bf9e3b38f77c2eac620263dd60437c6ec47a27bf.zip bootable_bootloader_goldelico_gta04-bf9e3b38f77c2eac620263dd60437c6ec47a27bf.tar.gz bootable_bootloader_goldelico_gta04-bf9e3b38f77c2eac620263dd60437c6ec47a27bf.tar.bz2 |
* Some code cleanup
* Patch by Josef Baumgartner, 10 Feb 2004:
Fixes for Coldfire port
* Patch by Brad Kemp, 11 Feb 2004:
Fix CFI flash driver problems
Diffstat (limited to 'board/bmw/ns16550.c')
-rw-r--r-- | board/bmw/ns16550.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/board/bmw/ns16550.c b/board/bmw/ns16550.c index b1c28eb..7064567 100644 --- a/board/bmw/ns16550.c +++ b/board/bmw/ns16550.c @@ -9,49 +9,49 @@ typedef struct NS16550 *NS16550_t; -const NS16550_t COM_PORTS[] = { (NS16550_t) ((CFG_EUMB_ADDR) + 0x4500), (NS16550_t) ((CFG_EUMB_ADDR) + 0x4600)}; +const NS16550_t COM_PORTS[] = + { (NS16550_t) ((CFG_EUMB_ADDR) + 0x4500), +(NS16550_t) ((CFG_EUMB_ADDR) + 0x4600) }; -volatile struct NS16550 * -NS16550_init(int chan, int baud_divisor) +volatile struct NS16550 *NS16550_init (int chan, int baud_divisor) { - volatile struct NS16550 *com_port; - com_port = (struct NS16550 *) COM_PORTS[chan]; - com_port->ier = 0x00; - com_port->lcr = LCR_BKSE; /* Access baud rate */ - com_port->dll = baud_divisor & 0xff; /* 9600 baud */ - com_port->dlm = (baud_divisor >> 8) & 0xff; - com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */ - com_port->mcr = MCR_RTS; /* RTS/DTR */ - com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */ -return (com_port); + volatile struct NS16550 *com_port; + + com_port = (struct NS16550 *) COM_PORTS[chan]; + com_port->ier = 0x00; + com_port->lcr = LCR_BKSE; /* Access baud rate */ + com_port->dll = baud_divisor & 0xff; /* 9600 baud */ + com_port->dlm = (baud_divisor >> 8) & 0xff; + com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */ + com_port->mcr = MCR_RTS; /* RTS/DTR */ + com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */ + return (com_port); } -void -NS16550_reinit(volatile struct NS16550 *com_port, int baud_divisor) +void NS16550_reinit (volatile struct NS16550 *com_port, int baud_divisor) { - com_port->ier = 0x00; - com_port->lcr = LCR_BKSE; /* Access baud rate */ - com_port->dll = baud_divisor & 0xff; /* 9600 baud */ - com_port->dlm = (baud_divisor >> 8) & 0xff; - com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */ - com_port->mcr = MCR_RTS; /* RTS/DTR */ - com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */ + com_port->ier = 0x00; + com_port->lcr = LCR_BKSE; /* Access baud rate */ + com_port->dll = baud_divisor & 0xff; /* 9600 baud */ + com_port->dlm = (baud_divisor >> 8) & 0xff; + com_port->lcr = LCR_8N1; /* 8 data, 1 stop, no parity */ + com_port->mcr = MCR_RTS; /* RTS/DTR */ + com_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR; /* Clear & enable FIFOs */ } -void NS16550_putc(volatile struct NS16550 *com_port, unsigned char c) +void NS16550_putc (volatile struct NS16550 *com_port, unsigned char c) { - while ((com_port->lsr & LSR_THRE) == 0) ; - com_port->thr = c; + while ((com_port->lsr & LSR_THRE) == 0); + com_port->thr = c; } -unsigned char -NS16550_getc(volatile struct NS16550 *com_port) +unsigned char NS16550_getc (volatile struct NS16550 *com_port) { - while ((com_port->lsr & LSR_DR) == 0) ; - return (com_port->rbr); + while ((com_port->lsr & LSR_DR) == 0); + return (com_port->rbr); } -int NS16550_tstc(volatile struct NS16550 *com_port) +int NS16550_tstc (volatile struct NS16550 *com_port) { - return ((com_port->lsr & LSR_DR) != 0); + return ((com_port->lsr & LSR_DR) != 0); } |