aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-26 12:02:40 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-26 12:02:40 -0400
commit97af11286d68e359f61579214ca7a7b4433fe458 (patch)
tree3d89de007d362d688bf48528b906faa9f0f29814 /drivers
parent1e14c33fe2e3409d9f34041859af52be6e4723af (diff)
parent2b49abac5855aff9b42cf2cdb5376ac805bebd86 (diff)
Automatic merge of kernel.org:/home/rmk/linux-2.6-serial.git
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/21285.c2
-rw-r--r--drivers/serial/8250_hp300.c53
-rw-r--r--drivers/serial/amba-pl010.c2
-rw-r--r--drivers/serial/amba-pl011.c2
-rw-r--r--drivers/serial/clps711x.c65
-rw-r--r--drivers/serial/s3c2410.c2
-rw-r--r--drivers/serial/sa1100.c65
-rw-r--r--drivers/serial/serial_lh7a40x.c2
8 files changed, 83 insertions, 110 deletions
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c
index f8504b0adebc..33fbda79f350 100644
--- a/drivers/serial/21285.c
+++ b/drivers/serial/21285.c
@@ -110,7 +110,7 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *r
110 port->icount.rx++; 110 port->icount.rx++;
111 111
112 rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ; 112 rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ;
113 if (rxs & RXSTAT_ANYERR) { 113 if (unlikely(rxs & RXSTAT_ANYERR)) {
114 if (rxs & RXSTAT_PARITY) 114 if (rxs & RXSTAT_PARITY)
115 port->icount.parity++; 115 port->icount.parity++;
116 else if (rxs & RXSTAT_FRAME) 116 else if (rxs & RXSTAT_FRAME)
diff --git a/drivers/serial/8250_hp300.c b/drivers/serial/8250_hp300.c
index b8d51eb56bff..4315afe9c080 100644
--- a/drivers/serial/8250_hp300.c
+++ b/drivers/serial/8250_hp300.c
@@ -9,15 +9,15 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/tty.h>
13#include <linux/serial.h> 12#include <linux/serial.h>
14#include <linux/serialP.h>
15#include <linux/serial_core.h> 13#include <linux/serial_core.h>
16#include <linux/delay.h> 14#include <linux/delay.h>
17#include <linux/dio.h> 15#include <linux/dio.h>
18#include <linux/console.h> 16#include <linux/console.h>
19#include <asm/io.h> 17#include <asm/io.h>
20 18
19#include "8250.h"
20
21#if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI) 21#if !defined(CONFIG_HPDCA) && !defined(CONFIG_HPAPCI)
22#warning CONFIG_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure? 22#warning CONFIG_8250 defined but neither CONFIG_HPDCA nor CONFIG_HPAPCI defined, are you sure?
23#endif 23#endif
@@ -163,7 +163,7 @@ int __init hp300_setup_serial_console(void)
163static int __devinit hpdca_init_one(struct dio_dev *d, 163static int __devinit hpdca_init_one(struct dio_dev *d,
164 const struct dio_device_id *ent) 164 const struct dio_device_id *ent)
165{ 165{
166 struct serial_struct serial_req; 166 struct uart_port port;
167 int line; 167 int line;
168 168
169#ifdef CONFIG_SERIAL_8250_CONSOLE 169#ifdef CONFIG_SERIAL_8250_CONSOLE
@@ -172,21 +172,22 @@ static int __devinit hpdca_init_one(struct dio_dev *d,
172 return 0; 172 return 0;
173 } 173 }
174#endif 174#endif
175 memset(&serial_req, 0, sizeof(struct serial_struct)); 175 memset(&port, 0, sizeof(struct uart_port));
176 176
177 /* Memory mapped I/O */ 177 /* Memory mapped I/O */
178 serial_req.io_type = SERIAL_IO_MEM; 178 port.iotype = UPIO_MEM;
179 serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; 179 port.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
180 serial_req.irq = d->ipl; 180 port.irq = d->ipl;
181 serial_req.baud_base = HPDCA_BAUD_BASE; 181 port.uartclk = HPDCA_BAUD_BASE * 16;
182 serial_req.iomap_base = (d->resource.start + UART_OFFSET); 182 port.mapbase = (d->resource.start + UART_OFFSET);
183 serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE); 183 port.membase = (char *)(port.mapbase + DIO_VIRADDRBASE);
184 serial_req.iomem_reg_shift = 1; 184 port.regshift = 1;
185 line = register_serial(&serial_req); 185 port.dev = &d->dev;
186 line = serial8250_register_port(&port);
186 187
187 if (line < 0) { 188 if (line < 0) {
188 printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d" 189 printk(KERN_NOTICE "8250_hp300: register_serial() DCA scode %d"
189 " irq %d failed\n", d->scode, serial_req.irq); 190 " irq %d failed\n", d->scode, port.irq);
190 return -ENOMEM; 191 return -ENOMEM;
191 } 192 }
192 193
@@ -209,7 +210,7 @@ static int __init hp300_8250_init(void)
209#ifdef CONFIG_HPAPCI 210#ifdef CONFIG_HPAPCI
210 int line; 211 int line;
211 unsigned long base; 212 unsigned long base;
212 struct serial_struct serial_req; 213 struct uart_port uport;
213 struct hp300_port *port; 214 struct hp300_port *port;
214 int i; 215 int i;
215#endif 216#endif
@@ -251,25 +252,25 @@ static int __init hp300_8250_init(void)
251 if (!port) 252 if (!port)
252 return -ENOMEM; 253 return -ENOMEM;
253 254
254 memset(&serial_req, 0, sizeof(struct serial_struct)); 255 memset(&uport, 0, sizeof(struct uart_port));
255 256
256 base = (FRODO_BASE + FRODO_APCI_OFFSET(i)); 257 base = (FRODO_BASE + FRODO_APCI_OFFSET(i));
257 258
258 /* Memory mapped I/O */ 259 /* Memory mapped I/O */
259 serial_req.io_type = SERIAL_IO_MEM; 260 uport.iotype = UPIO_MEM;
260 serial_req.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF; 261 uport.flags = UPF_SKIP_TEST | UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF;
261 /* XXX - no interrupt support yet */ 262 /* XXX - no interrupt support yet */
262 serial_req.irq = 0; 263 uport.irq = 0;
263 serial_req.baud_base = HPAPCI_BAUD_BASE; 264 uport.uartclk = HPAPCI_BAUD_BASE * 16;
264 serial_req.iomap_base = base; 265 uport.mapbase = base;
265 serial_req.iomem_base = (char *)(serial_req.iomap_base + DIO_VIRADDRBASE); 266 uport.membase = (char *)(base + DIO_VIRADDRBASE);
266 serial_req.iomem_reg_shift = 2; 267 uport.regshift = 2;
267 268
268 line = register_serial(&serial_req); 269 line = serial8250_register_port(&uport);
269 270
270 if (line < 0) { 271 if (line < 0) {
271 printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d" 272 printk(KERN_NOTICE "8250_hp300: register_serial() APCI %d"
272 " irq %d failed\n", i, serial_req.irq); 273 " irq %d failed\n", i, uport.irq);
273 kfree(port); 274 kfree(port);
274 continue; 275 continue;
275 } 276 }
@@ -299,7 +300,7 @@ static void __devexit hpdca_remove_one(struct dio_dev *d)
299 /* Disable board-interrupts */ 300 /* Disable board-interrupts */
300 out_8(d->resource.start + DIO_VIRADDRBASE + DCA_IC, 0); 301 out_8(d->resource.start + DIO_VIRADDRBASE + DCA_IC, 0);
301 } 302 }
302 unregister_serial(line); 303 serial8250_unregister_port(line);
303} 304}
304#endif 305#endif
305 306
@@ -309,7 +310,7 @@ static void __exit hp300_8250_exit(void)
309 struct hp300_port *port, *to_free; 310 struct hp300_port *port, *to_free;
310 311
311 for (port = hp300_ports; port; ) { 312 for (port = hp300_ports; port; ) {
312 unregister_serial(port->line); 313 serial8250_unregister_port(port->line);
313 to_free = port; 314 to_free = port;
314 port = port->next; 315 port = port->next;
315 kfree(to_free); 316 kfree(to_free);
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 484f6fb900b5..f2a5e2933c47 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -172,7 +172,7 @@ pl010_rx_chars(struct uart_port *port)
172 * out of the main execution path 172 * out of the main execution path
173 */ 173 */
174 rsr = UART_GET_RSR(port) | UART_DUMMY_RSR_RX; 174 rsr = UART_GET_RSR(port) | UART_DUMMY_RSR_RX;
175 if (rsr & UART01x_RSR_ANY) { 175 if (unlikely(rsr & UART01x_RSR_ANY)) {
176 if (rsr & UART01x_RSR_BE) { 176 if (rsr & UART01x_RSR_BE) {
177 rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); 177 rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
178 port->icount.brk++; 178 port->icount.brk++;
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index ff658a830f34..d5cbef3fe8b6 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -137,7 +137,7 @@ pl011_rx_chars(struct uart_amba_port *uap)
137 * out of the main execution path 137 * out of the main execution path
138 */ 138 */
139 rsr = readw(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX; 139 rsr = readw(uap->port.membase + UART01x_RSR) | UART_DUMMY_RSR_RX;
140 if (rsr & UART01x_RSR_ANY) { 140 if (unlikely(rsr & UART01x_RSR_ANY)) {
141 if (rsr & UART01x_RSR_BE) { 141 if (rsr & UART01x_RSR_BE) {
142 rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE); 142 rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
143 uap->port.icount.brk++; 143 uap->port.icount.brk++;
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
index 16592fae47f3..6242f3090a96 100644
--- a/drivers/serial/clps711x.c
+++ b/drivers/serial/clps711x.c
@@ -116,54 +116,43 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *re
116 * Note that the error handling code is 116 * Note that the error handling code is
117 * out of the main execution path 117 * out of the main execution path
118 */ 118 */
119 if (ch & UART_ANY_ERR) 119 if (unlikely(ch & UART_ANY_ERR)) {
120 goto handle_error; 120 if (ch & UARTDR_PARERR)
121 port->icount.parity++;
122 else if (ch & UARTDR_FRMERR)
123 port->icount.frame++;
124 if (ch & UARTDR_OVERR)
125 port->icount.overrun++;
121 126
122 if (uart_handle_sysrq_char(port, ch, regs)) 127 ch &= port->read_status_mask;
123 goto ignore_char;
124 128
125 error_return: 129 if (ch & UARTDR_PARERR)
126 tty_insert_flip_char(tty, ch, flg); 130 flg = TTY_PARITY;
127 ignore_char: 131 else if (ch & UARTDR_FRMERR)
128 status = clps_readl(SYSFLG(port)); 132 flg = TTY_FRAME;
129 }
130 out:
131 tty_flip_buffer_push(tty);
132 return IRQ_HANDLED;
133 133
134 handle_error: 134#ifdef SUPPORT_SYSRQ
135 if (ch & UARTDR_PARERR) 135 port->sysrq = 0;
136 port->icount.parity++; 136#endif
137 else if (ch & UARTDR_FRMERR) 137 }
138 port->icount.frame++;
139 if (ch & UARTDR_OVERR)
140 port->icount.overrun++;
141
142 if (ch & port->ignore_status_mask) {
143 if (++ignored > 100)
144 goto out;
145 goto ignore_char;
146 }
147 ch &= port->read_status_mask;
148 138
149 if (ch & UARTDR_PARERR) 139 if (uart_handle_sysrq_char(port, ch, regs))
150 flg = TTY_PARITY; 140 goto ignore_char;
151 else if (ch & UARTDR_FRMERR)
152 flg = TTY_FRAME;
153 141
154 if (ch & UARTDR_OVERR) {
155 /* 142 /*
156 * CHECK: does overrun affect the current character? 143 * CHECK: does overrun affect the current character?
157 * ASSUMPTION: it does not. 144 * ASSUMPTION: it does not.
158 */ 145 */
159 tty_insert_flip_char(tty, ch, flg); 146 if ((ch & port->ignore_status_mask & ~RXSTAT_OVERRUN) == 0)
160 ch = 0; 147 tty_insert_flip_char(tty, ch, flg);
161 flg = TTY_OVERRUN; 148 if ((ch & ~port->ignore_status_mask & RXSTAT_OVERRUN) == 0)
149 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
150
151 ignore_char:
152 status = clps_readl(SYSFLG(port));
162 } 153 }
163#ifdef SUPPORT_SYSRQ 154 tty_flip_buffer_push(tty);
164 port->sysrq = 0; 155 return IRQ_HANDLED;
165#endif
166 goto error_return;
167} 156}
168 157
169static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs) 158static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index bd6782aeb831..435750d40a47 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -364,7 +364,7 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id, struct pt_regs *regs)
364 flag = TTY_NORMAL; 364 flag = TTY_NORMAL;
365 port->icount.rx++; 365 port->icount.rx++;
366 366
367 if (uerstat & S3C2410_UERSTAT_ANY) { 367 if (unlikely(uerstat & S3C2410_UERSTAT_ANY)) {
368 dbg("rxerr: port ch=0x%02x, rxs=0x%08x\n", 368 dbg("rxerr: port ch=0x%02x, rxs=0x%08x\n",
369 ch, uerstat); 369 ch, uerstat);
370 370
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index 086065210d1e..157218bc6c6f 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -214,56 +214,39 @@ sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
214 * note that the error handling code is 214 * note that the error handling code is
215 * out of the main execution path 215 * out of the main execution path
216 */ 216 */
217 if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) 217 if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) {
218 goto handle_error; 218 if (status & UTSR1_TO_SM(UTSR1_PRE))
219 sport->port.icount.parity++;
220 else if (status & UTSR1_TO_SM(UTSR1_FRE))
221 sport->port.icount.frame++;
222 if (status & UTSR1_TO_SM(UTSR1_ROR))
223 sport->port.icount.overrun++;
224
225 status &= sport->port.read_status_mask;
226
227 if (status & UTSR1_TO_SM(UTSR1_PRE))
228 flg = TTY_PARITY;
229 else if (status & UTSR1_TO_SM(UTSR1_FRE))
230 flg = TTY_FRAME;
231
232#ifdef SUPPORT_SYSRQ
233 sport->port.sysrq = 0;
234#endif
235 }
219 236
220 if (uart_handle_sysrq_char(&sport->port, ch, regs)) 237 if (uart_handle_sysrq_char(&sport->port, ch, regs))
221 goto ignore_char; 238 goto ignore_char;
222 239
223 error_return: 240 if ((status & port->ignore_status_mask & ~UTSR1_TO_SM(UTSR1_ROR)) == 0)
224 tty_insert_flip_char(tty, ch, flg); 241 tty_insert_flip_char(tty, ch, flg);
242 if (status & ~port->ignore_status_mask & UTSR1_TO_SM(UTSR1_ROR))
243 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
244
225 ignore_char: 245 ignore_char:
226 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | 246 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
227 UTSR0_TO_SM(UART_GET_UTSR0(sport)); 247 UTSR0_TO_SM(UART_GET_UTSR0(sport));
228 } 248 }
229 out:
230 tty_flip_buffer_push(tty); 249 tty_flip_buffer_push(tty);
231 return;
232
233 handle_error:
234 if (status & UTSR1_TO_SM(UTSR1_PRE))
235 sport->port.icount.parity++;
236 else if (status & UTSR1_TO_SM(UTSR1_FRE))
237 sport->port.icount.frame++;
238 if (status & UTSR1_TO_SM(UTSR1_ROR))
239 sport->port.icount.overrun++;
240
241 if (status & sport->port.ignore_status_mask) {
242 if (++ignored > 100)
243 goto out;
244 goto ignore_char;
245 }
246
247 status &= sport->port.read_status_mask;
248
249 if (status & UTSR1_TO_SM(UTSR1_PRE))
250 flg = TTY_PARITY;
251 else if (status & UTSR1_TO_SM(UTSR1_FRE))
252 flg = TTY_FRAME;
253
254 if (status & UTSR1_TO_SM(UTSR1_ROR)) {
255 /*
256 * overrun does *not* affect the character
257 * we read from the FIFO
258 */
259 tty_insert_flip_char(tty, ch, flg);
260 ch = 0;
261 flg = TTY_OVERRUN;
262 }
263#ifdef SUPPORT_SYSRQ
264 sport->port.sysrq = 0;
265#endif
266 goto error_return;
267} 250}
268 251
269static void sa1100_tx_chars(struct sa1100_port *sport) 252static void sa1100_tx_chars(struct sa1100_port *sport)
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c
index 4ce3a41f1611..85cfa08d3bad 100644
--- a/drivers/serial/serial_lh7a40x.c
+++ b/drivers/serial/serial_lh7a40x.c
@@ -162,7 +162,7 @@ lh7a40xuart_rx_chars (struct uart_port* port)
162 flag = TTY_NORMAL; 162 flag = TTY_NORMAL;
163 ++port->icount.rx; 163 ++port->icount.rx;
164 164
165 if (data & RxError) { /* Quick check, short-circuit */ 165 if (unlikely(data & RxError)) { /* Quick check, short-circuit */
166 if (data & RxBreak) { 166 if (data & RxBreak) {
167 data &= ~(RxFramingError | RxParityError); 167 data &= ~(RxFramingError | RxParityError);
168 ++port->icount.brk; 168 ++port->icount.brk;