summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-05-26 23:51:22 +0200
committerWolfgang Denk <wd@denx.de>2010-05-26 23:51:22 +0200
commitc4976807cbbabd281f45466ac5e47e5639bcc9cb (patch)
treea2d8c1896b4aba85f3b5f5d174caf22d7d6fd78d /drivers
parent45b728cdeef2880ab1e7ebb22eac683900a171a0 (diff)
downloadu-boot-imx-c4976807cbbabd281f45466ac5e47e5639bcc9cb.zip
u-boot-imx-c4976807cbbabd281f45466ac5e47e5639bcc9cb.tar.gz
u-boot-imx-c4976807cbbabd281f45466ac5e47e5639bcc9cb.tar.bz2
Coding style cleanup, update CHANGELOG.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/opencores_yanu.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/serial/opencores_yanu.c b/drivers/serial/opencores_yanu.c
index f18f7f4..f383011 100644
--- a/drivers/serial/opencores_yanu.c
+++ b/drivers/serial/opencores_yanu.c
@@ -69,7 +69,7 @@ void serial_setbrg (void)
#else
void serial_setbrg (void)
-{
+{
int n, k;
const unsigned max_uns = 0xFFFFFFFF;
unsigned best_n, best_m, baud;
@@ -114,12 +114,14 @@ int serial_init (void)
YANU_ACTION_RFE | YANU_ACTION_RFIFO_CLEAR | YANU_ACTION_TFIFO_CLEAR;
writel(action, &uart->action);
-
- /* control register cleanup */
- /* no interrupts enabled */
- /* one stop bit */
- /* hardware flow control disabled */
- /* 8 bits */
+
+ /*
+ * control register cleanup
+ * no interrupts enabled
+ * one stop bit
+ * hardware flow control disabled
+ * 8 bits
+ */
control = (0x7 << YANU_CONTROL_BITS_POS);
/* enven parity just to be clean */
control |= YANU_CONTROL_PAREVEN;
@@ -146,7 +148,7 @@ void serial_putc (char c)
if (c == '\n')
serial_putc ('\r');
-
+
while (1) {
status = readl(&uart->status);
tx_chars = (status>>YANU_TFIFO_CHARS_POS)
@@ -174,13 +176,13 @@ int serial_tstc(void)
status = readl(&uart->status);
return (((status >> YANU_RFIFO_CHARS_POS) &
((1 << YANU_RFIFO_CHARS_N) - 1)) > 0);
-}
+}
int serial_getc (void)
{
while (serial_tstc() == 0)
WATCHDOG_RESET ();
-
+
/* first we pull the char */
writel(YANU_ACTION_RFIFO_PULL, &uart->action);