summaryrefslogtreecommitdiffstats
path: root/arch/mips/boot
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2013-06-10 06:33:25 +0000
committerRalf Baechle <ralf@linux-mips.org>2013-06-13 17:46:41 +0200
commitd6a5078459d95137d8d620787d1099a3016932a9 (patch)
tree41537019731d2b6375c73ebcfb79bbbe999237f0 /arch/mips/boot
parent5649d37c2b23ad6545709c976b9abbfa8d5f4e11 (diff)
downloadlinux-stable-d6a5078459d95137d8d620787d1099a3016932a9.tar.gz
linux-stable-d6a5078459d95137d8d620787d1099a3016932a9.tar.bz2
linux-stable-d6a5078459d95137d8d620787d1099a3016932a9.zip
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: Jayachandran C <jchandra@broadcom.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5416/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/boot')
-rw-r--r--arch/mips/boot/compressed/uart-16550.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/mips/boot/compressed/uart-16550.c b/arch/mips/boot/compressed/uart-16550.c
index 1c7b739b6a1d..90ae4400c40c 100644
--- a/arch/mips/boot/compressed/uart-16550.c
+++ b/arch/mips/boot/compressed/uart-16550.c
@@ -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))
;