From: Matthias Fuchs <mfuchs@ma-fu.de>
To: linux-serial@vger.kernel.org
Subject: [PATCH] serial: Detect XR16C2852 UARTs correctly
Date: Tue, 30 Dec 2008 14:39:51 +0100 [thread overview]
Message-ID: <200812301439.52412.mfuchs@ma-fu.de> (raw)
Without this patch Exar XR16C2852 UARTs are detected
as Motorola 8xxx DUARTs (16550A compatible).
By checking the fifo size it is possible to
continue probing for the correct UART type.
Signed-off-by: Matthias Fuchs <mfuchs@ma-fu.de>
---
drivers/serial/8250.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 303272a..ec27086 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -782,7 +782,7 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
* reading back DLL and DLM. The chip type depends on the DLM
* value read back:
* 0x10 - XR16C850 and the DLL contains the chip revision.
- * 0x12 - XR16C2850.
+ * 0x12 - XR16C2850 + XR16C2852.
* 0x14 - XR16C854.
*/
id1 = autoconfig_read_divisor_id(up);
@@ -869,11 +869,27 @@ static void autoconfig_16550a(struct uart_8250_port *up)
DEBUG_AUTOCONF("EFRv1 ");
up->port.type = PORT_16650;
up->capabilities |= UART_CAP_EFR | UART_CAP_SLEEP;
+ serial_outp(up, UART_EFR, 0);
+ return;
} else {
- DEBUG_AUTOCONF("Motorola 8xxx DUART ");
+ int sf = size_fifo(up);
+ DEBUG_AUTOCONF("sf=%d ", sf);
+ /*
+ * This fifo size check is needed to detect
+ * Exar XR16C2852 UARTs later on.
+ * These devices have an AFR register at
+ * UART_EFR's address with LCR_DLAB set.
+ * Because of thier 128 byte fifo we can
+ * skip this point of return and let
+ * autoconfig_has_efr() detect them later.
+ */
+ if (sf != 128) {
+ DEBUG_AUTOCONF("Motorola 8xxx DUART ");
+ serial_outp(up, UART_EFR, 0);
+ return;
+ }
}
serial_outp(up, UART_EFR, 0);
- return;
}
/*
--
1.5.6.3
next reply other threads:[~2008-12-30 13:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-30 13:39 Matthias Fuchs [this message]
2009-02-09 7:35 ` [PATCH] serial: Detect XR16C2852 UARTs correctly Matthias Fuchs
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=200812301439.52412.mfuchs@ma-fu.de \
--to=mfuchs@ma-fu.de \
--cc=linux-serial@vger.kernel.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