mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH v4 4/4] ns16550: fix ier selection
Date: Wed, 18 Jan 2012 10:31:56 +0400	[thread overview]
Message-ID: <1326868316-29385-5-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1326868316-29385-1-git-send-email-antonynpavlov@gmail.com>

The document "PC16550D Universal Asynchronous
Receiver Transmitter with FIFOs" (vers. June 1995,
http://www.national.com/ds/PC/PC16550D.pdf) states
that IER (Interrupt Enable Register) is accessible
if the bit DLAB = 0 (DLAB is bit 7 in LCR; in barebox
DLAB known as LCR_BKSE).

So before IER access we need set DLAB to 0.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 drivers/serial/serial_ns16550.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index 802331d..88ba836 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -140,7 +140,9 @@ static inline unsigned int ns16550_calc_divisor(struct console_device *cdev,
 static void ns16550_serial_init_port(struct console_device *cdev)
 {
 	/* initializing the device for the first time */
+	ns16550_write(cdev, 0x00, lcr); /* select ier reg */
 	ns16550_write(cdev, 0x00, ier);
+
 #ifdef CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS
 	ns16550_write(cdev, 0x07, mdr1);	/* Disable */
 #endif
-- 
1.7.8.3


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

      parent reply	other threads:[~2012-01-18  6:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  6:31 [PATCH v4 0/2] ns16550-related patches Antony Pavlov
2012-01-18  6:31 ` [PATCH v4 1/4] ns16550: support for UART with broken FIFO Antony Pavlov
2012-01-18  6:31 ` [PATCH v4 2/4] ns16550: make ns16550_serial_init_port() shorter Antony Pavlov
2012-01-18  6:31 ` [PATCH v4 3/4] ns16550: write zero to ier only once Antony Pavlov
2012-01-18  6:31 ` Antony Pavlov [this message]

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=1326868316-29385-5-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@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