mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Juergen Beisert <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Trensch <MTrensch@gmail.com>
Subject: [PATCH 3/7] netX: UART may not initialize correctly.
Date: Fri, 27 Apr 2012 11:32:21 +0200	[thread overview]
Message-ID: <1335519145-12349-4-git-send-email-jbe@pengutronix.de> (raw)
In-Reply-To: <1335519145-12349-1-git-send-email-jbe@pengutronix.de>

From: Michael Trensch <MTrensch@gmail.com>

The netX internal UART latches register settings and internally uses
them only if written in the correct order. Other orders may work, but
sometimes the UART gets stuck, as the baudrate has not correctly been
set.

Signed-off-by: Michael Trensch <MTrensch@gmail.com>
Acked-by: Juergen Beisert <jbe@pengutronix.de>
---
 drivers/serial/serial_netx.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/serial/serial_netx.c b/drivers/serial/serial_netx.c
index 2d4ef11..838293f 100644
--- a/drivers/serial/serial_netx.c
+++ b/drivers/serial/serial_netx.c
@@ -77,10 +77,7 @@ static int netx_serial_init_port(struct console_device *cdev)
 
 	/* disable uart */
 	writel(0, base + UART_CR);
-
-	writel(LINE_CR_8BIT | LINE_CR_FEN, base + UART_LINE_CR);
-
-	writel(DRV_ENABLE_TX | DRV_ENABLE_RTS, base + UART_DRV_ENABLE);
+	writel(BRM_CR_BAUD_RATE_MODE, base + UART_BRM_CR);
 
 	/* set baud rate */
 	divisor = 115200 * 4096;
@@ -88,9 +85,11 @@ static int netx_serial_init_port(struct console_device *cdev)
 	divisor *= 256;
 	divisor /= 100000;
 
-	writel((divisor >> 8) & 0xff, base + UART_BAUDDIV_MSB);
 	writel(divisor & 0xff, base + UART_BAUDDIV_LSB);
-	writel(BRM_CR_BAUD_RATE_MODE, base + UART_BRM_CR);
+	writel((divisor >> 8) & 0xff, base + UART_BAUDDIV_MSB);
+	writel(DRV_ENABLE_TX | DRV_ENABLE_RTS, base + UART_DRV_ENABLE);
+
+	writel(LINE_CR_8BIT | LINE_CR_FEN, base + UART_LINE_CR);
 
 	/* Finally, enable the UART */
 	writel(CR_UARTEN, base + UART_CR);
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-04-27  9:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  9:32 [PATCH] netX: fixes, cleanups, helpers and a new platform: THLINK-ETH Juergen Beisert
2012-04-27  9:32 ` [PATCH 1/7] netX: add a few base addresses for non on chip devices Juergen Beisert
2012-04-27  9:32 ` [PATCH 2/7] netX: unify the device registration Juergen Beisert
2012-04-27  9:32 ` Juergen Beisert [this message]
2012-04-27  9:32 ` [PATCH 4/7] netX/network: fix debug outputs Juergen Beisert
2012-04-27  9:32 ` [PATCH 5/7] netX: XPEC firmware is always of attribute const Juergen Beisert
2012-04-27  9:32 ` [PATCH 6/7] netX: don't bother with variable sizes, use the intend Juergen Beisert
2012-04-27  9:32 ` [PATCH 7/7] netX: add the 'th link' platform Juergen Beisert
2012-04-30 11:46   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335519145-12349-4-git-send-email-jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=MTrensch@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox