summaryrefslogtreecommitdiff
path: root/drivers/serial/serial_s5pc1xx.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-12-01 12:10:51 +0100
committerWolfgang Denk <wd@denx.de>2009-12-01 12:10:51 +0100
commit57bf140ac66f95c9c36c494e4d027551b5477b01 (patch)
tree78cc2602ee9dca3284e47f38d29380171fb53646 /drivers/serial/serial_s5pc1xx.c
parent34ddbd171ba154e9afd83f07a07ad8b57ac592e3 (diff)
parent71636fa7c3de63de29c0f514d5c725eccb011657 (diff)
Merge branch 'next-sync' of git://git.denx.de/u-boot-arm into next
Diffstat (limited to 'drivers/serial/serial_s5pc1xx.c')
-rw-r--r--drivers/serial/serial_s5pc1xx.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/serial/serial_s5pc1xx.c b/drivers/serial/serial_s5pc1xx.c
index 68c06a919..73669a9f1 100644
--- a/drivers/serial/serial_s5pc1xx.c
+++ b/drivers/serial/serial_s5pc1xx.c
@@ -98,14 +98,24 @@ int serial_init_dev(const int dev_index)
return 0;
}
-static int serial_err_check(const int dev_index)
+static int serial_err_check(const int dev_index, int op)
{
struct s5pc1xx_uart *const uart = s5pc1xx_get_base_uart(dev_index);
+ unsigned int mask;
+
+ /*
+ * UERSTAT
+ * Break Detect [3]
+ * Frame Err [2] : receive operation
+ * Parity Err [1] : receive operation
+ * Overrun Err [0] : receive operation
+ */
+ if (op)
+ mask = 0x8;
+ else
+ mask = 0xf;
- if (readl(&uart->uerstat) & 0xf)
- return 1;
-
- return 0;
+ return readl(&uart->uerstat) & mask;
}
/*
@@ -119,7 +129,7 @@ int serial_getc_dev(const int dev_index)
/* wait for character to arrive */
while (!(readl(&uart->utrstat) & 0x1)) {
- if (serial_err_check(dev_index))
+ if (serial_err_check(dev_index, 0))
return 0;
}
@@ -135,7 +145,7 @@ void serial_putc_dev(const char c, const int dev_index)
/* wait for room in the tx FIFO */
while (!(readl(&uart->utrstat) & 0x2)) {
- if (serial_err_check(dev_index))
+ if (serial_err_check(dev_index, 1))
return;
}