-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename common ns16550 constants with UART_ prefix to prevent conflicts
Fix problems introduced in commit 7b5611c [inka4x0: Add hardware diagnosis functions for inka4x0] which redefined MSR_RI which is already used on PowerPC systems. Also eliminate redundant definitions in ps2mult.h. More cleanup will be needed for other redundant occurrences though. Signed-off-by: Detlev Zundel <[email protected]>
- Loading branch information
Showing
6 changed files
with
139 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*********************************************************************** | ||
* | ||
* (C) Copyright 2004 | ||
* (C) Copyright 2004-2009 | ||
* DENX Software Engineering | ||
* Wolfgang Denk, [email protected] | ||
* All rights reserved. | ||
|
@@ -18,9 +18,11 @@ | |
#include <asm/io.h> | ||
#include <asm/atomic.h> | ||
#include <ps2mult.h> | ||
#if defined(CONFIG_SYS_NS16550) || defined(CONFIG_MPC85xx) | ||
#include <ns16550.h> | ||
/* This is needed for ns16550.h */ | ||
#ifndef CONFIG_SYS_NS16550_REG_SIZE | ||
#define CONFIG_SYS_NS16550_REG_SIZE 1 | ||
#endif | ||
#include <ns16550.h> | ||
|
||
DECLARE_GLOBAL_DATA_PTR; | ||
|
||
|
@@ -128,12 +130,12 @@ int ps2ser_init(void) | |
NS16550_t com_port = (NS16550_t)COM_BASE; | ||
|
||
com_port->ier = 0x00; | ||
com_port->lcr = LCR_BKSE | LCR_8N1; | ||
com_port->lcr = UART_LCR_BKSE | UART_LCR_8N1; | ||
com_port->dll = (CONFIG_SYS_NS16550_CLK / 16 / PS2SER_BAUD) & 0xff; | ||
com_port->dlm = ((CONFIG_SYS_NS16550_CLK / 16 / PS2SER_BAUD) >> 8) & 0xff; | ||
com_port->lcr = LCR_8N1; | ||
com_port->mcr = (MCR_DTR | MCR_RTS); | ||
com_port->fcr = (FCR_FIFO_EN | FCR_RXSR | FCR_TXSR); | ||
com_port->lcr = UART_LCR_8N1; | ||
com_port->mcr = (UART_MCR_DTR | UART_MCR_RTS); | ||
com_port->fcr = (UART_FCR_FIFO_EN | UART_FCR_RXSR | UART_FCR_TXSR); | ||
|
||
return (0); | ||
} | ||
|
@@ -202,7 +204,7 @@ void ps2ser_putc(int chr) | |
psc->psc_buffer_8 = chr; | ||
#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \ | ||
defined(CONFIG_MPC8548) || defined(CONFIG_MPC8555) | ||
while ((com_port->lsr & LSR_THRE) == 0); | ||
while ((com_port->lsr & UART_LSR_THRE) == 0); | ||
com_port->thr = chr; | ||
#else | ||
while (!(ps2ser_in(UART_LSR) & UART_LSR_THRE)); | ||
|
@@ -227,7 +229,7 @@ static int ps2ser_getc_hw(void) | |
} | ||
#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \ | ||
defined(CONFIG_MPC8548) || defined(CONFIG_MPC8555) | ||
if (com_port->lsr & LSR_DR) { | ||
if (com_port->lsr & UART_LSR_DR) { | ||
res = com_port->rbr; | ||
} | ||
#else | ||
|
@@ -315,7 +317,7 @@ static void ps2ser_interrupt(void *dev_id) | |
} while (status & PSC_SR_RXRDY); | ||
#elif defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \ | ||
defined(CONFIG_MPC8548) || defined(CONFIG_MPC8555) | ||
} while (status & LSR_DR); | ||
} while (status & UART_LSR_DR); | ||
#else | ||
} while (status & UART_IIR_RDI); | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.