提交 d6a50784 编写于 作者: J Jayachandran C 提交者: Ralf Baechle

MIPS: boot: Fixes for compressed/uart-16550.c

Fix uart-16550.c for adding XLR/XLP support, changes are:
* Make register read/write use volatile pointers
* Support 32 bit IO read/write
* Increase timeout in waiting for UART LSR
Signed-off-by: NJayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5416/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 5649d37c
......@@ -23,23 +23,27 @@
#define PORT(offset) (UART0_BASE + (4 * offset))
#endif
#ifndef IOTYPE
#define IOTYPE char
#endif
#ifndef PORT
#error please define the serial port address for your own machine
#endif
static inline unsigned int serial_in(int offset)
{
return *((char *)PORT(offset));
return *((volatile IOTYPE *)PORT(offset)) & 0xFF;
}
static inline void serial_out(int offset, int value)
{
*((char *)PORT(offset)) = value;
*((volatile IOTYPE *)PORT(offset)) = value & 0xFF;
}
void putc(char c)
{
int timeout = 1024;
int timeout = 1000000;
while (((serial_in(UART_LSR) & UART_LSR_THRE) == 0) && (timeout-- > 0))
;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册