From: Thomas Koeller <thomas.koeller@baslerweb.com>
To: rmk+serial@arm.linux.org.uk
Cc: linux-serial@vger.kernel.org
Subject: [PATCH]
Date: Thu, 4 Nov 2004 14:30:37 +0100 [thread overview]
Message-ID: <200411041430.38006.thomas.koeller@baslerweb.com> (raw)
Hi,
I made the 8250 driver work on the internal UART found on
PMC-Sierra RM9000 MIPS CPUs. To do so, I did
- define the register layout, which is different from the standard
layout, in include/linux/serial_reg.h
- add a new register access type named UPIO_PORT32 for I/O
registers that must be accessed as 32-bit entities
- add a new port type PORT_RM9000 in include/linux/serial_core.h
While being at it, I also fixed a couple of missing resource
allocations for UPIO_MEM32.
tk
Signed-off-by: Thomas Koeller <thomas.koeller@baslerweb.com>
diff -rpu linux-2.6.9-old/drivers/serial/8250.c linux-2.6.9/drivers/serial/8250.c
--- linux-2.6.9-old/drivers/serial/8250.c 2004-10-28 12:45:30.000000000 +0200
+++ linux-2.6.9/drivers/serial/8250.c 2004-11-04 14:11:42.636338544 +0100
@@ -174,6 +174,7 @@ static const struct serial8250_config ua
{ "RSA", 2048, 2048, UART_CAP_FIFO },
{ "NS16550A", 16, 16, UART_CAP_FIFO | UART_NATSEMI },
{ "XScale", 32, 32, UART_CAP_FIFO },
+ { "RM9000", 16, 16, UART_CAP_FIFO }
};
static _INLINE_ unsigned int serial_in(struct uart_8250_port *up, int offset)
@@ -191,6 +192,9 @@ static _INLINE_ unsigned int serial_in(s
case UPIO_MEM32:
return readl(up->port.membase + offset);
+ case UPIO_PORT32:
+ return inl(up->port.iobase + offset);
+
default:
return inb(up->port.iobase + offset);
}
@@ -215,6 +219,10 @@ serial_out(struct uart_8250_port *up, in
writel(value, up->port.membase + offset);
break;
+ case UPIO_PORT32:
+ outl(value, up->port.iobase + offset);
+ break;
+
default:
outb(value, up->port.iobase + offset);
}
@@ -1624,6 +1633,7 @@ serial8250_request_std_resource(struct u
int ret = 0;
switch (up->port.iotype) {
+ case UPIO_MEM32:
case UPIO_MEM:
if (up->port.mapbase) {
*res = request_mem_region(up->port.mapbase, size, "serial");
@@ -1634,6 +1644,7 @@ serial8250_request_std_resource(struct u
case UPIO_HUB6:
case UPIO_PORT:
+ case UPIO_PORT32:
*res = request_region(up->port.iobase, size, "serial");
if (!*res)
ret = -EBUSY;
@@ -1651,6 +1662,7 @@ serial8250_request_rsa_resource(struct u
switch (up->port.iotype) {
case UPIO_MEM:
+ case UPIO_MEM32:
if (up->port.mapbase) {
start = up->port.mapbase;
start += UART_RSA_BASE << up->port.regshift;
@@ -1662,6 +1674,7 @@ serial8250_request_rsa_resource(struct u
case UPIO_HUB6:
case UPIO_PORT:
+ case UPIO_PORT32:
start = up->port.iobase;
start += UART_RSA_BASE << up->port.regshift;
*res = request_region(start, size, "serial-rsa");
@@ -1687,6 +1700,7 @@ static void serial8250_release_port(stru
switch (up->port.iotype) {
case UPIO_MEM:
+ case UPIO_MEM32:
if (up->port.mapbase) {
/*
* Unmap the area.
@@ -1704,6 +1718,7 @@ static void serial8250_release_port(stru
case UPIO_HUB6:
case UPIO_PORT:
+ case UPIO_PORT32:
start = up->port.iobase;
if (size)
diff -rpu linux-2.6.9-old/include/linux/serial_core.h linux-2.6.9/include/linux/serial_core.h
--- linux-2.6.9-old/include/linux/serial_core.h 2004-10-28 12:46:02.000000000 +0200
+++ linux-2.6.9/include/linux/serial_core.h 2004-11-04 14:11:42.637338392 +0100
@@ -37,7 +37,8 @@
#define PORT_RSA 13
#define PORT_NS16550A 14
#define PORT_XSCALE 15
-#define PORT_MAX_8250 15 /* max port ID */
+#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
+#define PORT_MAX_8250 16 /* max port ID */
/*
* ARM specific type numbers. These are not currently guaranteed
@@ -177,6 +178,7 @@ struct uart_port {
#define UPIO_HUB6 (1)
#define UPIO_MEM (2)
#define UPIO_MEM32 (3)
+#define UPIO_PORT32 (4)
unsigned int read_status_mask; /* driver specific */
unsigned int ignore_status_mask; /* driver specific */
diff -rpu linux-2.6.9-old/include/linux/serial_reg.h linux-2.6.9/include/linux/serial_reg.h
--- linux-2.6.9-old/include/linux/serial_reg.h 2004-10-28 12:46:03.000000000 +0200
+++ linux-2.6.9/include/linux/serial_reg.h 2004-11-04 14:11:42.638338240 +0100
@@ -14,6 +14,40 @@
#ifndef _LINUX_SERIAL_REG_H
#define _LINUX_SERIAL_REG_H
+#include <linux/config.h>
+
+#if defined(CONFIG_SERIAL_RM9000)
+
+/*
+ * The internal UART present on PMC-Sierra MIPS RM9000 CPUs
+ * has a different register layout
+ */
+#define UART_RX 0x00 /* In: Receive buffer (DLAB=0) */
+#define UART_TX 0x04 /* Out: Transmit buffer (DLAB=0) */
+#define UART_DLL 0x08 /* Out: Divisor Latch Low (DLAB=1) */
+
+#define UART_DLM 0x10 /* Out: Divisor Latch High (DLAB=1) */
+#define UART_IER 0x0c /* Out: Interrupt Enable Register */
+
+#define UART_IIR 0x14 /* In: Interrupt ID Register */
+#define UART_FCR 0x18 /* Out: FIFO Control Register */
+
+#define UART_LCR 0x1c /* Out: Line Control Register */
+#define UART_MCR 0x20 /* Out: Modem Control Register */
+#define UART_LSR 0x24 /* In: Line Status Register */
+#define UART_MSR 0x28 /* In: Modem Status Register */
+#define UART_SCR 0x2c /* I/O: Scratch Register */
+
+/* Unimplemented registers */
+#define UART_EFR 0xff /* I/O: Extended Features Register */
+#define UART_EMSR 0xff /* (LCR=BF) Extended Mode Select Register */
+
+/* Dummies */
+#define UART_FCTR 1
+#define UART_TRG 0
+
+#else
+
#define UART_RX 0 /* In: Receive buffer (DLAB=0) */
#define UART_TX 0 /* Out: Transmit buffer (DLAB=0) */
#define UART_DLL 0 /* Out: Divisor Latch Low (DLAB=1) */
@@ -40,6 +74,7 @@
#define UART_EMSR 7 /* (LCR=BF) Extended Mode Select Register
* FCTR bit 6 selects SCR or EMSR
* XR16c85x only */
+#endif /* defined(SERIAL_RM9000) */
/*
* These are the definitions for the FIFO Control Register
--
--------------------------------------------------
Thomas Koeller, Software Development
Basler Vision Technologies
thomas dot koeller at baslerweb dot com
http://www.baslerweb.com
==============================
next reply other threads:[~2004-11-04 13:26 UTC|newest]
Thread overview: 139+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-04 13:30 Thomas Koeller [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-10-29 13:38 [PATCH] Dorine Tipo
2023-10-29 14:22 ` [PATCH] Julia Lawall
2022-02-02 21:26 [PATCH] Sergey Shtylyov
2019-04-12 15:15 trace-cmd fails with many cpus Steven Rostedt
2019-04-12 23:01 ` [PATCH] Slavomir Kaslev
2019-04-12 23:01 ` [PATCH] Slavomir Kaslev
2017-11-30 8:10 [PATCH] Lu, Xinyu
2017-07-09 23:58 [PATCH] armetallica
2017-07-09 23:54 ` [PATCH] Kershner, David A
2017-07-09 23:35 [PATCH] armetallica
2017-07-09 23:35 ` [PATCH] armetallica
2017-07-20 15:06 ` [PATCH] Mauro Carvalho Chehab
2017-05-19 10:39 [PATCH] Andreas Herrmann
2017-05-27 8:46 ` [PATCH] Sitsofe Wheeler
2015-01-16 3:42 [patch] Carlos O'Donell
[not found] ` <54B8888F.4050403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-01-16 3:43 ` [patch] Carlos O'Donell
[not found] ` <54B888D1.8050009-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-01-16 6:14 ` [patch] Michael Kerrisk (man-pages)
2013-12-24 15:45 [PATCH] Evan Hosseini
2014-01-09 18:27 ` [PATCH] Greg KH
[not found] <002b01ce1661$245ebb70$6d1c3250$@certicon.cz>
2013-03-01 10:28 ` [PATCH] Jan Pešta
2013-03-01 11:53 ` [PATCH] Matthieu Moy
2012-03-04 20:34 [PATCH] Stefan Richter
2012-03-04 20:36 ` [PATCH] Stefan Richter
2012-01-24 18:37 [PATCH] Alan Stern
2012-01-24 20:24 ` [PATCH] Greg KH
2011-08-11 21:29 [PATCH] Rafael J. Wysocki
2010-09-19 2:25 [PATCH] Junio C Hamano
2010-09-19 9:54 ` [PATCH] Sam Ravnborg
2010-09-19 18:21 ` [PATCH] Junio C Hamano
2010-09-19 19:31 ` [PATCH] Sam Ravnborg
2010-09-20 12:11 ` [PATCH] Michal Marek
2010-08-14 12:43 [PATCH] Sam Ravnborg
2010-08-14 12:43 ` [PATCH] Sam Ravnborg
2009-10-29 14:51 [PATCH] flinkdeldinky
2009-10-29 15:03 ` [PATCH] Jarod Wilson
2009-05-12 6:18 [PATCH] Johannes Berg
2009-04-07 16:20 [PATCH] Christoph Hellwig
2008-10-24 17:31 [PATCH]: Steve Dickson
[not found] ` <4902068D.2030201-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2008-10-31 20:39 ` [PATCH]: J. Bruce Fields
2008-11-03 13:51 ` [PATCH]: Steve Dickson
2008-10-15 7:03 [PATCH] Tim Shimmin
2008-10-15 12:43 ` [PATCH] Eric Sandeen
2008-07-24 0:22 [PATCH] Junio C Hamano
2008-06-24 8:13 [PATCH] Christoph Hellwig
2008-05-02 22:35 [PATCH] Johannes Berg
2008-04-04 21:37 [PATCH] Johannes Berg
2008-01-28 23:59 [PATCH] S.Çağlar Onur
[not found] ` <200801290159.41333.caglar-caicS1wCkhO6A22drWdTBw@public.gmane.org>
2008-01-29 13:12 ` [PATCH] Izik Eidus
[not found] ` <479F263E.2040105-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-29 15:58 ` [PATCH] S.Çağlar Onur
2008-01-17 2:58 [PATCH] Jiang zhe
2008-01-17 10:20 ` [PATCH] Takashi Iwai
2007-12-03 15:54 [PATCH] Andries E. Brouwer
2007-12-03 17:06 ` [PATCH] Alan Cox
2007-11-15 22:03 [PATCH] Roel Kluin
2007-11-15 22:03 ` [PATCH] Roel Kluin
2007-08-22 22:19 [PATCH] Alan Cox
2007-10-02 15:33 ` [PATCH] Jeff Garzik
2007-10-02 15:43 ` [PATCH] Alan Cox
2007-10-02 16:43 ` [PATCH] Jeff Garzik
2007-04-01 18:13 [PATCH 0/16] Assorted patches Jan Engelhardt
2007-04-01 18:15 ` [PATCH 07/16] kconfig-dynamic-frequency.diff Jan Engelhardt
2007-04-01 18:39 ` Kyle Moffett
2007-04-01 18:42 ` Jan Engelhardt
2007-04-01 18:52 ` Kyle Moffett
2007-04-01 19:01 ` Jan Engelhardt
2007-04-01 19:42 ` [PATCH] Kyle Moffett
2007-04-01 19:47 ` [PATCH] Jan Engelhardt
2007-04-01 20:07 ` [PATCH] Kyle Moffett
2007-04-01 23:03 ` [PATCH] Andi Kleen
2007-02-21 21:23 [PATCH] James Simmons
2007-02-21 21:23 ` [PATCH] James Simmons
2007-02-22 1:03 ` [PATCH] Antonino A. Daplas
2007-02-22 1:35 ` [Linux-fbdev-devel] [PATCH] James Simmons
2007-02-22 1:53 ` [PATCH] Antonino A. Daplas
2007-02-22 16:49 ` [PATCH] James Simmons
2007-01-26 17:19 [PATCH] Jens Osterkamp
2006-07-15 18:43 [PATCH] Chris Boot
2006-03-24 23:07 [PATCH] Daniel Walker
2006-03-24 23:19 ` [PATCH] john stultz
2006-03-24 23:22 ` [PATCH] Daniel Walker
2006-03-10 14:47 [PATCH] Kumar Gala
2006-03-10 15:05 ` [PATCH] Kumar Gala
2006-02-22 11:33 [PATCH] Hagen Paul Pfeifer
2005-06-29 19:28 [PATCH] dann frazier
2005-06-15 11:41 [PATCH] Jan Beulich
2004-11-18 20:17 [PATCH] Colin Leroy
2004-08-10 2:49 [PATCH] Roland McGrath
2004-08-05 13:51 [PATCH] Michal Ludvig
2004-08-05 14:11 ` [PATCH] James Morris
2004-08-05 19:49 ` [PATCH] Jean-Luc Cooke
2004-08-06 2:47 ` [PATCH] James Morris
2004-08-06 2:03 ` [PATCH] Michael Halcrow
2004-08-06 4:58 ` [PATCH] Linus Torvalds
2004-08-06 13:03 ` [PATCH] Jean-Luc Cooke
2004-08-06 3:36 ` [PATCH] YOSHIFUJI Hideaki / 吉藤英明
2004-08-06 4:21 ` [PATCH] David S. Miller
2004-08-06 4:28 ` [PATCH] Jean-Luc Cooke
2004-08-06 4:42 ` [PATCH] James Morris
2004-08-06 12:54 ` [PATCH] Jean-Luc Cooke
2004-08-06 18:26 ` [PATCH] David S. Miller
2004-08-06 18:36 ` [PATCH] Jean-Luc Cooke
2004-08-06 23:24 ` [PATCH] Matt Mackall
2004-08-07 3:01 ` [PATCH] Jean-Luc Cooke
2004-08-07 22:26 ` [PATCH] Theodore Ts'o
2004-08-08 15:38 ` [PATCH] Jean-Luc Cooke
2004-08-09 18:43 ` [PATCH] Theodore Ts'o
2004-08-09 18:49 ` [PATCH] Jean-Luc Cooke
2004-08-10 0:22 ` [PATCH] Theodore Ts'o
2004-06-05 16:12 [patch] Luke Kenneth Casson Leighton
2004-06-06 8:14 ` [patch] Russell Coker
2004-06-06 10:48 ` [patch] Luke Kenneth Casson Leighton
2004-06-06 12:27 ` [patch] Russell Coker
2003-08-18 11:12 [PATCH] Mark Hemment
2003-08-18 22:58 ` [PATCH] Neil Brown
2003-08-11 13:40 [PATCH] davej
2003-07-30 16:31 [patch] Adrian Bunk
2003-07-30 16:31 ` [patch] Adrian Bunk
2002-12-19 20:00 [PATCH]: Juan Quintela
2002-12-19 20:54 ` [PATCH]: Maciej W. Rozycki
2002-12-19 21:09 ` [PATCH]: Juan Quintela
2002-12-18 1:42 [PATCH]: Juan Quintela
2002-12-18 19:29 ` [PATCH]: Ralf Baechle
2002-12-18 21:41 ` [PATCH]: Juan Quintela
2002-12-18 22:35 ` [PATCH]: Ralf Baechle
2002-08-06 23:04 [PATCH] Paul Mackerras
2002-04-15 18:39 [PATCH] Andre Hedrick
2002-04-15 19:09 ` [PATCH] Josh McKinney
2002-04-15 19:16 ` [PATCH] Andre Hedrick
2002-04-15 19:59 ` [PATCH] Andre Hedrick
2002-04-16 3:11 ` [PATCH] Josh McKinney
2002-04-16 4:11 ` [PATCH] Andre Hedrick
2002-04-16 5:53 ` [PATCH] Jens Axboe
2002-04-16 6:51 ` [PATCH] Andre Hedrick
2002-04-16 6:54 ` [PATCH] Jens Axboe
2002-04-16 7:04 ` [PATCH] Andre Hedrick
2001-10-25 17:24 [PATCH] Christoph Hellwig
2001-08-20 14:42 [PATCH] Rik van Riel
2001-08-20 19:43 ` [PATCH] Marcelo Tosatti
2001-08-20 21:34 ` [PATCH] Rik van Riel
2001-08-15 17:35 [PATCH] Ben LaHaise
2001-08-15 17:40 ` [PATCH] Linus Torvalds
2001-08-15 17:53 ` [PATCH] Ben LaHaise
2001-08-15 18:26 ` [PATCH] Daniel Phillips
2000-11-07 23:20 [PATCH] Bartlomiej Zolnierkiewicz
2000-11-07 23:09 [PATCH] Bartlomiej Zolnierkiewicz
2000-11-07 23:30 ` [PATCH] Bartlomiej Zolnierkiewicz
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=200411041430.38006.thomas.koeller@baslerweb.com \
--to=thomas.koeller@baslerweb.com \
--cc=linux-serial@vger.kernel.org \
--cc=rmk+serial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.