diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-05-23 15:57:31 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-05-23 15:57:31 -0400 |
commit | a2ab67fae1ab9226679495a8d260f4e6555efc5f (patch) | |
tree | f7de683c9c8ff0869a7e11f1d40802145d05f5b4 /drivers/serial | |
parent | 6d0485a99366d4e0e7e725f14995c74cb7ca4499 (diff) | |
parent | 135cad366b4e7d6a79f6369f6cb5b721985aa62f (diff) |
Merge branch 'for-rmk-devel' of git://git.pengutronix.de/git/imx/linux-2.6 into devel
Conflicts:
arch/arm/Kconfig
arch/arm/Makefile
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/crisv10.c | 173 | ||||
-rw-r--r-- | drivers/serial/imx.c | 13 |
2 files changed, 81 insertions, 105 deletions
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index 7ba7d70f04d6..7be52fe288eb 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c | |||
@@ -23,16 +23,18 @@ static char *serial_version = "$Revision: 1.25 $"; | |||
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/slab.h> | 24 | #include <linux/slab.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <asm/uaccess.h> | ||
27 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
28 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
29 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
29 | #include <linux/seq_file.h> | ||
30 | #include <linux/delay.h> | ||
31 | #include <linux/module.h> | ||
32 | #include <linux/uaccess.h> | ||
33 | #include <linux/io.h> | ||
30 | 34 | ||
31 | #include <asm/io.h> | ||
32 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
33 | #include <asm/dma.h> | 36 | #include <asm/dma.h> |
34 | #include <asm/system.h> | 37 | #include <asm/system.h> |
35 | #include <linux/delay.h> | ||
36 | 38 | ||
37 | #include <arch/svinto.h> | 39 | #include <arch/svinto.h> |
38 | 40 | ||
@@ -456,7 +458,6 @@ static struct e100_serial rs_table[] = { | |||
456 | 458 | ||
457 | #define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial)) | 459 | #define NR_PORTS (sizeof(rs_table)/sizeof(struct e100_serial)) |
458 | 460 | ||
459 | static struct ktermios *serial_termios[NR_PORTS]; | ||
460 | #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER | 461 | #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER |
461 | static struct fast_timer fast_timers[NR_PORTS]; | 462 | static struct fast_timer fast_timers[NR_PORTS]; |
462 | #endif | 463 | #endif |
@@ -4257,151 +4258,132 @@ rs_open(struct tty_struct *tty, struct file * filp) | |||
4257 | return 0; | 4258 | return 0; |
4258 | } | 4259 | } |
4259 | 4260 | ||
4261 | #ifdef CONFIG_PROC_FS | ||
4260 | /* | 4262 | /* |
4261 | * /proc fs routines.... | 4263 | * /proc fs routines.... |
4262 | */ | 4264 | */ |
4263 | 4265 | ||
4264 | static int line_info(char *buf, struct e100_serial *info) | 4266 | static void seq_line_info(struct seq_file *m, struct e100_serial *info) |
4265 | { | 4267 | { |
4266 | char stat_buf[30]; | ||
4267 | int ret; | ||
4268 | unsigned long tmp; | 4268 | unsigned long tmp; |
4269 | 4269 | ||
4270 | ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d", | 4270 | seq_printf(m, "%d: uart:E100 port:%lX irq:%d", |
4271 | info->line, (unsigned long)info->ioport, info->irq); | 4271 | info->line, (unsigned long)info->ioport, info->irq); |
4272 | 4272 | ||
4273 | if (!info->ioport || (info->type == PORT_UNKNOWN)) { | 4273 | if (!info->ioport || (info->type == PORT_UNKNOWN)) { |
4274 | ret += sprintf(buf+ret, "\n"); | 4274 | seq_printf(m, "\n"); |
4275 | return ret; | 4275 | return; |
4276 | } | 4276 | } |
4277 | 4277 | ||
4278 | stat_buf[0] = 0; | 4278 | seq_printf(m, " baud:%d", info->baud); |
4279 | stat_buf[1] = 0; | 4279 | seq_printf(m, " tx:%lu rx:%lu", |
4280 | if (!E100_RTS_GET(info)) | ||
4281 | strcat(stat_buf, "|RTS"); | ||
4282 | if (!E100_CTS_GET(info)) | ||
4283 | strcat(stat_buf, "|CTS"); | ||
4284 | if (!E100_DTR_GET(info)) | ||
4285 | strcat(stat_buf, "|DTR"); | ||
4286 | if (!E100_DSR_GET(info)) | ||
4287 | strcat(stat_buf, "|DSR"); | ||
4288 | if (!E100_CD_GET(info)) | ||
4289 | strcat(stat_buf, "|CD"); | ||
4290 | if (!E100_RI_GET(info)) | ||
4291 | strcat(stat_buf, "|RI"); | ||
4292 | |||
4293 | ret += sprintf(buf+ret, " baud:%d", info->baud); | ||
4294 | |||
4295 | ret += sprintf(buf+ret, " tx:%lu rx:%lu", | ||
4296 | (unsigned long)info->icount.tx, | 4280 | (unsigned long)info->icount.tx, |
4297 | (unsigned long)info->icount.rx); | 4281 | (unsigned long)info->icount.rx); |
4298 | tmp = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); | 4282 | tmp = CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); |
4299 | if (tmp) { | 4283 | if (tmp) |
4300 | ret += sprintf(buf+ret, " tx_pend:%lu/%lu", | 4284 | seq_printf(m, " tx_pend:%lu/%lu", |
4301 | (unsigned long)tmp, | 4285 | (unsigned long)tmp, |
4302 | (unsigned long)SERIAL_XMIT_SIZE); | 4286 | (unsigned long)SERIAL_XMIT_SIZE); |
4303 | } | ||
4304 | 4287 | ||
4305 | ret += sprintf(buf+ret, " rx_pend:%lu/%lu", | 4288 | seq_printf(m, " rx_pend:%lu/%lu", |
4306 | (unsigned long)info->recv_cnt, | 4289 | (unsigned long)info->recv_cnt, |
4307 | (unsigned long)info->max_recv_cnt); | 4290 | (unsigned long)info->max_recv_cnt); |
4308 | 4291 | ||
4309 | #if 1 | 4292 | #if 1 |
4310 | if (info->port.tty) { | 4293 | if (info->port.tty) { |
4311 | |||
4312 | if (info->port.tty->stopped) | 4294 | if (info->port.tty->stopped) |
4313 | ret += sprintf(buf+ret, " stopped:%i", | 4295 | seq_printf(m, " stopped:%i", |
4314 | (int)info->port.tty->stopped); | 4296 | (int)info->port.tty->stopped); |
4315 | if (info->port.tty->hw_stopped) | 4297 | if (info->port.tty->hw_stopped) |
4316 | ret += sprintf(buf+ret, " hw_stopped:%i", | 4298 | seq_printf(m, " hw_stopped:%i", |
4317 | (int)info->port.tty->hw_stopped); | 4299 | (int)info->port.tty->hw_stopped); |
4318 | } | 4300 | } |
4319 | 4301 | ||
4320 | { | 4302 | { |
4321 | unsigned char rstat = info->ioport[REG_STATUS]; | 4303 | unsigned char rstat = info->ioport[REG_STATUS]; |
4322 | if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) | 4304 | if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect)) |
4323 | ret += sprintf(buf+ret, " xoff_detect:1"); | 4305 | seq_printf(m, " xoff_detect:1"); |
4324 | } | 4306 | } |
4325 | 4307 | ||
4326 | #endif | 4308 | #endif |
4327 | 4309 | ||
4328 | |||
4329 | |||
4330 | |||
4331 | if (info->icount.frame) | 4310 | if (info->icount.frame) |
4332 | ret += sprintf(buf+ret, " fe:%lu", | 4311 | seq_printf(m, " fe:%lu", (unsigned long)info->icount.frame); |
4333 | (unsigned long)info->icount.frame); | ||
4334 | 4312 | ||
4335 | if (info->icount.parity) | 4313 | if (info->icount.parity) |
4336 | ret += sprintf(buf+ret, " pe:%lu", | 4314 | seq_printf(m, " pe:%lu", (unsigned long)info->icount.parity); |
4337 | (unsigned long)info->icount.parity); | ||
4338 | 4315 | ||
4339 | if (info->icount.brk) | 4316 | if (info->icount.brk) |
4340 | ret += sprintf(buf+ret, " brk:%lu", | 4317 | seq_printf(m, " brk:%lu", (unsigned long)info->icount.brk); |
4341 | (unsigned long)info->icount.brk); | ||
4342 | 4318 | ||
4343 | if (info->icount.overrun) | 4319 | if (info->icount.overrun) |
4344 | ret += sprintf(buf+ret, " oe:%lu", | 4320 | seq_printf(m, " oe:%lu", (unsigned long)info->icount.overrun); |
4345 | (unsigned long)info->icount.overrun); | ||
4346 | 4321 | ||
4347 | /* | 4322 | /* |
4348 | * Last thing is the RS-232 status lines | 4323 | * Last thing is the RS-232 status lines |
4349 | */ | 4324 | */ |
4350 | ret += sprintf(buf+ret, " %s\n", stat_buf+1); | 4325 | if (!E100_RTS_GET(info)) |
4351 | return ret; | 4326 | seq_puts(m, "|RTS"); |
4327 | if (!E100_CTS_GET(info)) | ||
4328 | seq_puts(m, "|CTS"); | ||
4329 | if (!E100_DTR_GET(info)) | ||
4330 | seq_puts(m, "|DTR"); | ||
4331 | if (!E100_DSR_GET(info)) | ||
4332 | seq_puts(m, "|DSR"); | ||
4333 | if (!E100_CD_GET(info)) | ||
4334 | seq_puts(m, "|CD"); | ||
4335 | if (!E100_RI_GET(info)) | ||
4336 | seq_puts(m, "|RI"); | ||
4337 | seq_puts(m, "\n"); | ||
4352 | } | 4338 | } |
4353 | 4339 | ||
4354 | int rs_read_proc(char *page, char **start, off_t off, int count, | 4340 | |
4355 | int *eof, void *data) | 4341 | static int crisv10_proc_show(struct seq_file *m, void *v) |
4356 | { | 4342 | { |
4357 | int i, len = 0, l; | 4343 | int i; |
4358 | off_t begin = 0; | ||
4359 | 4344 | ||
4360 | len += sprintf(page, "serinfo:1.0 driver:%s\n", | 4345 | seq_printf(m, "serinfo:1.0 driver:%s\n", serial_version); |
4361 | serial_version); | 4346 | |
4362 | for (i = 0; i < NR_PORTS && len < 4000; i++) { | 4347 | for (i = 0; i < NR_PORTS; i++) { |
4363 | if (!rs_table[i].enabled) | 4348 | if (!rs_table[i].enabled) |
4364 | continue; | 4349 | continue; |
4365 | l = line_info(page + len, &rs_table[i]); | 4350 | seq_line_info(m, &rs_table[i]); |
4366 | len += l; | ||
4367 | if (len+begin > off+count) | ||
4368 | goto done; | ||
4369 | if (len+begin < off) { | ||
4370 | begin += len; | ||
4371 | len = 0; | ||
4372 | } | ||
4373 | } | 4351 | } |
4374 | #ifdef DEBUG_LOG_INCLUDED | 4352 | #ifdef DEBUG_LOG_INCLUDED |
4375 | for (i = 0; i < debug_log_pos; i++) { | 4353 | for (i = 0; i < debug_log_pos; i++) { |
4376 | len += sprintf(page + len, "%-4i %lu.%lu ", i, debug_log[i].time, timer_data_to_ns(debug_log[i].timer_data)); | 4354 | seq_printf(m, "%-4i %lu.%lu ", |
4377 | len += sprintf(page + len, debug_log[i].string, debug_log[i].value); | 4355 | i, debug_log[i].time, |
4378 | if (len+begin > off+count) | 4356 | timer_data_to_ns(debug_log[i].timer_data)); |
4379 | goto done; | 4357 | seq_printf(m, debug_log[i].string, debug_log[i].value); |
4380 | if (len+begin < off) { | ||
4381 | begin += len; | ||
4382 | len = 0; | ||
4383 | } | ||
4384 | } | 4358 | } |
4385 | len += sprintf(page + len, "debug_log %i/%i %li bytes\n", | 4359 | seq_printf(m, "debug_log %i/%i\n", i, DEBUG_LOG_SIZE); |
4386 | i, DEBUG_LOG_SIZE, begin+len); | ||
4387 | debug_log_pos = 0; | 4360 | debug_log_pos = 0; |
4388 | #endif | 4361 | #endif |
4362 | return 0; | ||
4363 | } | ||
4389 | 4364 | ||
4390 | *eof = 1; | 4365 | static int crisv10_proc_open(struct inode *inode, struct file *file) |
4391 | done: | 4366 | { |
4392 | if (off >= len+begin) | 4367 | return single_open(file, crisv10_proc_show, NULL); |
4393 | return 0; | ||
4394 | *start = page + (off-begin); | ||
4395 | return ((count < begin+len-off) ? count : begin+len-off); | ||
4396 | } | 4368 | } |
4397 | 4369 | ||
4370 | static const struct file_operations crisv10_proc_fops = { | ||
4371 | .owner = THIS_MODULE, | ||
4372 | .open = crisv10_proc_open, | ||
4373 | .read = seq_read, | ||
4374 | .llseek = seq_lseek, | ||
4375 | .release = single_release, | ||
4376 | }; | ||
4377 | #endif | ||
4378 | |||
4379 | |||
4398 | /* Finally, routines used to initialize the serial driver. */ | 4380 | /* Finally, routines used to initialize the serial driver. */ |
4399 | 4381 | ||
4400 | static void | 4382 | static void show_serial_version(void) |
4401 | show_serial_version(void) | ||
4402 | { | 4383 | { |
4403 | printk(KERN_INFO | 4384 | printk(KERN_INFO |
4404 | "ETRAX 100LX serial-driver %s, (c) 2000-2004 Axis Communications AB\r\n", | 4385 | "ETRAX 100LX serial-driver %s, " |
4386 | "(c) 2000-2004 Axis Communications AB\r\n", | ||
4405 | &serial_version[11]); /* "$Revision: x.yy" */ | 4387 | &serial_version[11]); /* "$Revision: x.yy" */ |
4406 | } | 4388 | } |
4407 | 4389 | ||
@@ -4425,13 +4407,14 @@ static const struct tty_operations rs_ops = { | |||
4425 | .break_ctl = rs_break, | 4407 | .break_ctl = rs_break, |
4426 | .send_xchar = rs_send_xchar, | 4408 | .send_xchar = rs_send_xchar, |
4427 | .wait_until_sent = rs_wait_until_sent, | 4409 | .wait_until_sent = rs_wait_until_sent, |
4428 | .read_proc = rs_read_proc, | ||
4429 | .tiocmget = rs_tiocmget, | 4410 | .tiocmget = rs_tiocmget, |
4430 | .tiocmset = rs_tiocmset | 4411 | .tiocmset = rs_tiocmset, |
4412 | #ifdef CONFIG_PROC_FS | ||
4413 | .proc_fops = &crisv10_proc_fops, | ||
4414 | #endif | ||
4431 | }; | 4415 | }; |
4432 | 4416 | ||
4433 | static int __init | 4417 | static int __init rs_init(void) |
4434 | rs_init(void) | ||
4435 | { | 4418 | { |
4436 | int i; | 4419 | int i; |
4437 | struct e100_serial *info; | 4420 | struct e100_serial *info; |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 9f460b175c50..3f5d5a200481 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -66,7 +66,7 @@ | |||
66 | #define ONEMS 0xb0 /* One Millisecond register */ | 66 | #define ONEMS 0xb0 /* One Millisecond register */ |
67 | #define UTS 0xb4 /* UART Test Register */ | 67 | #define UTS 0xb4 /* UART Test Register */ |
68 | #endif | 68 | #endif |
69 | #if defined(CONFIG_ARCH_IMX) || defined(CONFIG_ARCH_MX1) | 69 | #ifdef CONFIG_ARCH_MX1 |
70 | #define BIPR1 0xb0 /* Incremental Preset Register 1 */ | 70 | #define BIPR1 0xb0 /* Incremental Preset Register 1 */ |
71 | #define BIPR2 0xb4 /* Incremental Preset Register 2 */ | 71 | #define BIPR2 0xb4 /* Incremental Preset Register 2 */ |
72 | #define BIPR3 0xb8 /* Incremental Preset Register 3 */ | 72 | #define BIPR3 0xb8 /* Incremental Preset Register 3 */ |
@@ -96,7 +96,7 @@ | |||
96 | #define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */ | 96 | #define UCR1_RTSDEN (1<<5) /* RTS delta interrupt enable */ |
97 | #define UCR1_SNDBRK (1<<4) /* Send break */ | 97 | #define UCR1_SNDBRK (1<<4) /* Send break */ |
98 | #define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */ | 98 | #define UCR1_TDMAEN (1<<3) /* Transmitter ready DMA enable */ |
99 | #if defined(CONFIG_ARCH_IMX) || defined(CONFIG_ARCH_MX1) | 99 | #ifdef CONFIG_ARCH_MX1 |
100 | #define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */ | 100 | #define UCR1_UARTCLKEN (1<<2) /* UART clock enabled */ |
101 | #endif | 101 | #endif |
102 | #if defined CONFIG_ARCH_MX3 || defined CONFIG_ARCH_MX2 | 102 | #if defined CONFIG_ARCH_MX3 || defined CONFIG_ARCH_MX2 |
@@ -127,7 +127,7 @@ | |||
127 | #define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ | 127 | #define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ |
128 | #define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ | 128 | #define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ |
129 | #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ | 129 | #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ |
130 | #ifdef CONFIG_ARCH_IMX | 130 | #ifdef CONFIG_ARCH_MX1 |
131 | #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */ | 131 | #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */ |
132 | #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */ | 132 | #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */ |
133 | #endif | 133 | #endif |
@@ -180,13 +180,6 @@ | |||
180 | #define UTS_SOFTRST (1<<0) /* Software reset */ | 180 | #define UTS_SOFTRST (1<<0) /* Software reset */ |
181 | 181 | ||
182 | /* We've been assigned a range on the "Low-density serial ports" major */ | 182 | /* We've been assigned a range on the "Low-density serial ports" major */ |
183 | #ifdef CONFIG_ARCH_IMX | ||
184 | #define SERIAL_IMX_MAJOR 204 | ||
185 | #define MINOR_START 41 | ||
186 | #define DEV_NAME "ttySMX" | ||
187 | #define MAX_INTERNAL_IRQ IMX_IRQS | ||
188 | #endif | ||
189 | |||
190 | #ifdef CONFIG_ARCH_MXC | 183 | #ifdef CONFIG_ARCH_MXC |
191 | #define SERIAL_IMX_MAJOR 207 | 184 | #define SERIAL_IMX_MAJOR 207 |
192 | #define MINOR_START 16 | 185 | #define MINOR_START 16 |