mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-kernel@vger.kernel.org
Cc: rmk@arm.linux.org.uk, akpm@osdl.org
Subject: Re: [PATCH] Serial 8250 OMAP support, take 2
Date: Fri, 29 Oct 2004 17:48:27 -0700	[thread overview]
Message-ID: <20041030004826.GL3756@atomide.com> (raw)
In-Reply-To: <20041028195445.GI14884@atomide.com>

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

* Tony Lindgren <tony@atomide.com> [041028 13:02]:
> * Russell King <rmk+lkml@arm.linux.org.uk> [041028 12:32]:
> > 
> > One of the things which previous changes have done is to move us away
> > from "port types" towards "capabilities" for serial ports, so things
> > like the FIFO, hardware flow control and so forth can be individually
> > controlled, rather than having to rely on a table of features.
> > 
> > So, it appears that OMAP ports are like a TI752 port, but with a couple
> > of extra features.  Can we use the existing TI75x feature support code
> > for these ports?
> 
> Well last time I checked at least the autoconfig failed. I can look into it
> a bit more.

OK, got it working by resetting the ports before calling
early_serial_setup(). The ports are now properly autodetected as PORT_16654,
and seem to be working :) The new patch is quite minimal, see below!

Hmm, I wonder if there would be some advantage if the ports were detected as
TI16750?

The omap specific reset function is basically:

omap_serial_outp(up, UART_OMAP_MDR1, 0x07); /* disable UART */
omap_serial_outp(up, UART_OMAP_MDR1, 0x00); /* enable UART */

Macro is_omap_port() is defined in the omap serial.h to check the port
address. Moving that to somewhere else would allow removing one ifdef.

The macro cpu_is_omap1510() is omap specific, so one ifdef is still needed.

> > Also, these ports seem to use extra address space which isn't covered by
> > a request_region/request_mem_region... that's something which should be
> > fixed.
> 
> OK, I'll change that.

This is fixed now too.

Tony

[-- Attachment #2: patch-2.6.10-rc1-serial-8250-add-omap-take3 --]
[-- Type: text/plain, Size: 1915 bytes --]

--- linus/drivers/serial/8250.c	2004-10-26 10:41:48.000000000 -0700
+++ linux-omap-dev/drivers/serial/8250.c	2004-10-29 17:22:00.000000000 -0700
@@ -1689,6 +1689,17 @@
 		serial_outp(up, UART_EFR, efr);
 	}
 
+#ifdef CONFIG_ARCH_OMAP1510
+	/* Workaround to enable 115200 baud on OMAP1510 internal ports */
+	if (cpu_is_omap1510() && is_omap_port(up->port.membase)) {
+		if (baud == 115200) {
+			quot = 1;
+			serial_out(up, UART_OMAP_OSC_12M_SEL, 1);
+		} else
+			serial_out(up, UART_OMAP_OSC_12M_SEL, 0);
+        }
+#endif
+
 	if (up->capabilities & UART_NATSEMI) {
 		/* Switch to bank 2 not bank 1, to avoid resetting EXCR2 */
 		serial_outp(up, UART_LCR, 0xe0);
@@ -1742,6 +1753,11 @@
 	unsigned int size = 8 << up->port.regshift;
 	int ret = 0;
 
+#ifdef CONFIG_ARCH_OMAP
+	if (is_omap_port(up->port.membase))
+		size = 0x16 << up->port.regshift;
+#endif
+
 	switch (up->port.iotype) {
 	case UPIO_MEM:
 		if (up->port.mapbase) {
--- linus/include/linux/serial_reg.h	2004-10-25 10:33:36.000000000 -0700
+++ linux-omap-dev/include/linux/serial_reg.h	2004-10-29 14:13:01.000000000 -0700
@@ -307,5 +307,19 @@
 #define SERIAL_RSA_BAUD_BASE (921600)
 #define SERIAL_RSA_BAUD_BASE_LO (SERIAL_RSA_BAUD_BASE / 8)
 
+/*
+ * Extra serial register definitions for the internal UARTs 
+ * in TI OMAP processors.
+ */
+#define UART_OMAP_MDR1		0x08	/* Mode definition register */
+#define UART_OMAP_MDR2		0x09	/* Mode definition register 2 */
+#define UART_OMAP_SCR		0x10	/* Supplementary control register */
+#define UART_OMAP_SSR		0x11	/* Supplementary status register */
+#define UART_OMAP_EBLR		0x12	/* BOF length register */
+#define UART_OMAP_OSC_12M_SEL	0x13	/* OMAP1510 12MHz osc select */
+#define UART_OMAP_MVER		0x14	/* Module version register */
+#define UART_OMAP_SYSC		0x15	/* System configuration register */
+#define UART_OMAP_SYSS		0x16	/* System status register */
+
 #endif /* _LINUX_SERIAL_REG_H */
 

      reply	other threads:[~2004-10-30  0:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-28 19:18 Tony Lindgren
2004-10-28 19:31 ` Russell King
2004-10-28 19:54   ` Tony Lindgren
2004-10-30  0:48     ` Tony Lindgren [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=20041030004826.GL3756@atomide.com \
    --to=tony@atomide.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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

Powered by JetHome