aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c8
-rw-r--r--drivers/serial/8250_pci.c27
-rw-r--r--drivers/serial/Kconfig5
-rw-r--r--drivers/serial/atmel_serial.c54
-rw-r--r--drivers/serial/crisv10.c14
-rw-r--r--drivers/serial/ioc4_serial.c6
-rw-r--r--drivers/serial/serial_txx9.c23
7 files changed, 82 insertions, 55 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 5261f0af8b10..2964ca9df5a0 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -920,12 +920,16 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
920#ifdef __i386__ 920#ifdef __i386__
921 outb(0xff, 0x080); 921 outb(0xff, 0x080);
922#endif 922#endif
923 scratch2 = serial_inp(up, UART_IER); 923 /*
924 * Mask out IER[7:4] bits for test as some UARTs (e.g. TL
925 * 16C754B) allow only to modify them if an EFR bit is set.
926 */
927 scratch2 = serial_inp(up, UART_IER) & 0x0f;
924 serial_outp(up, UART_IER, 0x0F); 928 serial_outp(up, UART_IER, 0x0F);
925#ifdef __i386__ 929#ifdef __i386__
926 outb(0, 0x080); 930 outb(0, 0x080);
927#endif 931#endif
928 scratch3 = serial_inp(up, UART_IER); 932 scratch3 = serial_inp(up, UART_IER) & 0x0f;
929 serial_outp(up, UART_IER, scratch); 933 serial_outp(up, UART_IER, scratch);
930 if (scratch2 != 0 || scratch3 != 0x0F) { 934 if (scratch2 != 0 || scratch3 != 0x0F) {
931 /* 935 /*
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 52e2e64c6649..a2dac378bda9 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -679,6 +679,13 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
679 */ 679 */
680 { 680 {
681 .vendor = PCI_VENDOR_ID_PLX, 681 .vendor = PCI_VENDOR_ID_PLX,
682 .device = PCI_DEVICE_ID_PLX_9030,
683 .subvendor = PCI_SUBVENDOR_ID_PERLE,
684 .subdevice = PCI_ANY_ID,
685 .setup = pci_default_setup,
686 },
687 {
688 .vendor = PCI_VENDOR_ID_PLX,
682 .device = PCI_DEVICE_ID_PLX_9050, 689 .device = PCI_DEVICE_ID_PLX_9050,
683 .subvendor = PCI_SUBVENDOR_ID_EXSYS, 690 .subvendor = PCI_SUBVENDOR_ID_EXSYS,
684 .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055, 691 .subdevice = PCI_SUBDEVICE_ID_EXSYS_4055,
@@ -936,6 +943,7 @@ enum pci_board_num_t {
936 943
937 pbn_b2_1_115200, 944 pbn_b2_1_115200,
938 pbn_b2_2_115200, 945 pbn_b2_2_115200,
946 pbn_b2_4_115200,
939 pbn_b2_8_115200, 947 pbn_b2_8_115200,
940 948
941 pbn_b2_1_460800, 949 pbn_b2_1_460800,
@@ -1249,6 +1257,12 @@ static struct pciserial_board pci_boards[] __devinitdata = {
1249 .base_baud = 115200, 1257 .base_baud = 115200,
1250 .uart_offset = 8, 1258 .uart_offset = 8,
1251 }, 1259 },
1260 [pbn_b2_4_115200] = {
1261 .flags = FL_BASE2,
1262 .num_ports = 4,
1263 .base_baud = 115200,
1264 .uart_offset = 8,
1265 },
1252 [pbn_b2_8_115200] = { 1266 [pbn_b2_8_115200] = {
1253 .flags = FL_BASE2, 1267 .flags = FL_BASE2,
1254 .num_ports = 8, 1268 .num_ports = 8,
@@ -1990,6 +2004,10 @@ static struct pci_device_id serial_pci_tbl[] = {
1990 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM, 2004 { PCI_VENDOR_ID_PANACOM, PCI_DEVICE_ID_PANACOM_DUALMODEM,
1991 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2005 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
1992 pbn_panacom2 }, 2006 pbn_panacom2 },
2007 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
2008 PCI_VENDOR_ID_ESDGMBH,
2009 PCI_DEVICE_ID_ESDGMBH_CPCIASIO4, 0, 0,
2010 pbn_b2_4_115200 },
1993 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, 2011 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
1994 PCI_SUBVENDOR_ID_CHASE_PCIFAST, 2012 PCI_SUBVENDOR_ID_CHASE_PCIFAST,
1995 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0, 2013 PCI_SUBDEVICE_ID_CHASE_PCIFAST4, 0, 0,
@@ -2379,6 +2397,15 @@ static struct pci_device_id serial_pci_tbl[] = {
2379 pbn_b2_2_115200 }, 2397 pbn_b2_2_115200 },
2380 2398
2381 /* 2399 /*
2400 * Perle PCI-RAS cards
2401 */
2402 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
2403 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS4,
2404 0, 0, pbn_b2_4_921600 },
2405 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
2406 PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8,
2407 0, 0, pbn_b2_8_921600 },
2408 /*
2382 * These entries match devices with class COMMUNICATION_SERIAL, 2409 * These entries match devices with class COMMUNICATION_SERIAL,
2383 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL 2410 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
2384 */ 2411 */
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 2978c09860ee..5cc6b91f8408 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -916,6 +916,11 @@ config SERIAL_TXX9
916config HAS_TXX9_SERIAL 916config HAS_TXX9_SERIAL
917 bool 917 bool
918 918
919config SERIAL_TXX9_NR_UARTS
920 int "Maximum number of TMPTX39XX/49XX SIO ports"
921 depends on SERIAL_TXX9
922 default "6"
923
919config SERIAL_TXX9_CONSOLE 924config SERIAL_TXX9_CONSOLE
920 bool "TMPTX39XX/49XX SIO Console support" 925 bool "TMPTX39XX/49XX SIO Console support"
921 depends on SERIAL_TXX9=y 926 depends on SERIAL_TXX9=y
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 881f886b91c6..df45a7ac773f 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -73,35 +73,35 @@
73 73
74#define ATMEL_ISR_PASS_LIMIT 256 74#define ATMEL_ISR_PASS_LIMIT 256
75 75
76#define UART_PUT_CR(port,v) writel(v, (port)->membase + ATMEL_US_CR) 76#define UART_PUT_CR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_CR)
77#define UART_GET_MR(port) readl((port)->membase + ATMEL_US_MR) 77#define UART_GET_MR(port) __raw_readl((port)->membase + ATMEL_US_MR)
78#define UART_PUT_MR(port,v) writel(v, (port)->membase + ATMEL_US_MR) 78#define UART_PUT_MR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_MR)
79#define UART_PUT_IER(port,v) writel(v, (port)->membase + ATMEL_US_IER) 79#define UART_PUT_IER(port,v) __raw_writel(v, (port)->membase + ATMEL_US_IER)
80#define UART_PUT_IDR(port,v) writel(v, (port)->membase + ATMEL_US_IDR) 80#define UART_PUT_IDR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_IDR)
81#define UART_GET_IMR(port) readl((port)->membase + ATMEL_US_IMR) 81#define UART_GET_IMR(port) __raw_readl((port)->membase + ATMEL_US_IMR)
82#define UART_GET_CSR(port) readl((port)->membase + ATMEL_US_CSR) 82#define UART_GET_CSR(port) __raw_readl((port)->membase + ATMEL_US_CSR)
83#define UART_GET_CHAR(port) readl((port)->membase + ATMEL_US_RHR) 83#define UART_GET_CHAR(port) __raw_readl((port)->membase + ATMEL_US_RHR)
84#define UART_PUT_CHAR(port,v) writel(v, (port)->membase + ATMEL_US_THR) 84#define UART_PUT_CHAR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_THR)
85#define UART_GET_BRGR(port) readl((port)->membase + ATMEL_US_BRGR) 85#define UART_GET_BRGR(port) __raw_readl((port)->membase + ATMEL_US_BRGR)
86#define UART_PUT_BRGR(port,v) writel(v, (port)->membase + ATMEL_US_BRGR) 86#define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR)
87#define UART_PUT_RTOR(port,v) writel(v, (port)->membase + ATMEL_US_RTOR) 87#define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR)
88 88
89// #define UART_GET_CR(port) readl((port)->membase + ATMEL_US_CR) // is write-only 89// #define UART_GET_CR(port) __raw_readl((port)->membase + ATMEL_US_CR) // is write-only
90 90
91 /* PDC registers */ 91 /* PDC registers */
92#define UART_PUT_PTCR(port,v) writel(v, (port)->membase + ATMEL_PDC_PTCR) 92#define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR)
93#define UART_GET_PTSR(port) readl((port)->membase + ATMEL_PDC_PTSR) 93#define UART_GET_PTSR(port) __raw_readl((port)->membase + ATMEL_PDC_PTSR)
94 94
95#define UART_PUT_RPR(port,v) writel(v, (port)->membase + ATMEL_PDC_RPR) 95#define UART_PUT_RPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RPR)
96#define UART_GET_RPR(port) readl((port)->membase + ATMEL_PDC_RPR) 96#define UART_GET_RPR(port) __raw_readl((port)->membase + ATMEL_PDC_RPR)
97#define UART_PUT_RCR(port,v) writel(v, (port)->membase + ATMEL_PDC_RCR) 97#define UART_PUT_RCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RCR)
98#define UART_PUT_RNPR(port,v) writel(v, (port)->membase + ATMEL_PDC_RNPR) 98#define UART_PUT_RNPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RNPR)
99#define UART_PUT_RNCR(port,v) writel(v, (port)->membase + ATMEL_PDC_RNCR) 99#define UART_PUT_RNCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RNCR)
100 100
101#define UART_PUT_TPR(port,v) writel(v, (port)->membase + ATMEL_PDC_TPR) 101#define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR)
102#define UART_PUT_TCR(port,v) writel(v, (port)->membase + ATMEL_PDC_TCR) 102#define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR)
103//#define UART_PUT_TNPR(port,v) writel(v, (port)->membase + ATMEL_PDC_TNPR) 103//#define UART_PUT_TNPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TNPR)
104//#define UART_PUT_TNCR(port,v) writel(v, (port)->membase + ATMEL_PDC_TNCR) 104//#define UART_PUT_TNCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TNCR)
105 105
106static int (*atmel_open_hook)(struct uart_port *); 106static int (*atmel_open_hook)(struct uart_port *);
107static void (*atmel_close_hook)(struct uart_port *); 107static void (*atmel_close_hook)(struct uart_port *);
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 42b050c46abe..312bef6bd583 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -3173,12 +3173,8 @@ do_softint(void *private_)
3173 if (!tty) 3173 if (!tty)
3174 return; 3174 return;
3175 3175
3176 if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) { 3176 if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event))
3177 if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && 3177 tty_wakeup(tty);
3178 tty->ldisc.write_wakeup)
3179 (tty->ldisc.write_wakeup)(tty);
3180 wake_up_interruptible(&tty->write_wait);
3181 }
3182} 3178}
3183 3179
3184static int 3180static int
@@ -3798,11 +3794,7 @@ rs_flush_buffer(struct tty_struct *tty)
3798 info->xmit.head = info->xmit.tail = 0; 3794 info->xmit.head = info->xmit.tail = 0;
3799 restore_flags(flags); 3795 restore_flags(flags);
3800 3796
3801 wake_up_interruptible(&tty->write_wait); 3797 tty_wakeup(tty);
3802
3803 if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
3804 tty->ldisc.write_wakeup)
3805 (tty->ldisc.write_wakeup)(tty);
3806} 3798}
3807 3799
3808/* 3800/*
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index c862f67c985a..f540212e7409 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -2685,7 +2685,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd)
2685 free_irq(control->ic_irq, soft); 2685 free_irq(control->ic_irq, soft);
2686 if (soft->is_ioc4_serial_addr) { 2686 if (soft->is_ioc4_serial_addr) {
2687 iounmap(soft->is_ioc4_serial_addr); 2687 iounmap(soft->is_ioc4_serial_addr);
2688 release_region((unsigned long) 2688 release_mem_region((unsigned long)
2689 soft->is_ioc4_serial_addr, 2689 soft->is_ioc4_serial_addr,
2690 sizeof(struct ioc4_serial)); 2690 sizeof(struct ioc4_serial));
2691 } 2691 }
@@ -2790,7 +2790,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
2790 /* request serial registers */ 2790 /* request serial registers */
2791 tmp_addr1 = idd->idd_bar0 + IOC4_SERIAL_OFFSET; 2791 tmp_addr1 = idd->idd_bar0 + IOC4_SERIAL_OFFSET;
2792 2792
2793 if (!request_region(tmp_addr1, sizeof(struct ioc4_serial), 2793 if (!request_mem_region(tmp_addr1, sizeof(struct ioc4_serial),
2794 "sioc4_uart")) { 2794 "sioc4_uart")) {
2795 printk(KERN_WARNING 2795 printk(KERN_WARNING
2796 "ioc4 (%p): unable to get request region for " 2796 "ioc4 (%p): unable to get request region for "
@@ -2889,7 +2889,7 @@ out3:
2889out2: 2889out2:
2890 if (serial) 2890 if (serial)
2891 iounmap(serial); 2891 iounmap(serial);
2892 release_region(tmp_addr1, sizeof(struct ioc4_serial)); 2892 release_mem_region(tmp_addr1, sizeof(struct ioc4_serial));
2893out1: 2893out1:
2894 2894
2895 return ret; 2895 return ret;
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c
index 7186a82c4759..f4440d329310 100644
--- a/drivers/serial/serial_txx9.c
+++ b/drivers/serial/serial_txx9.c
@@ -37,6 +37,7 @@
37 * 1.06 Do not insert a char caused previous overrun. 37 * 1.06 Do not insert a char caused previous overrun.
38 * Fix some spin_locks. 38 * Fix some spin_locks.
39 * Do not call uart_add_one_port for absent ports. 39 * Do not call uart_add_one_port for absent ports.
40 * 1.07 Use CONFIG_SERIAL_TXX9_NR_UARTS. Cleanup.
40 */ 41 */
41 42
42#if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 43#if defined(CONFIG_SERIAL_TXX9_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
@@ -58,9 +59,8 @@
58#include <linux/mutex.h> 59#include <linux/mutex.h>
59 60
60#include <asm/io.h> 61#include <asm/io.h>
61#include <asm/irq.h>
62 62
63static char *serial_version = "1.06"; 63static char *serial_version = "1.07";
64static char *serial_name = "TX39/49 Serial driver"; 64static char *serial_name = "TX39/49 Serial driver";
65 65
66#define PASS_LIMIT 256 66#define PASS_LIMIT 256
@@ -88,12 +88,7 @@ static char *serial_name = "TX39/49 Serial driver";
88/* 88/*
89 * Number of serial ports 89 * Number of serial ports
90 */ 90 */
91#ifdef ENABLE_SERIAL_TXX9_PCI 91#define UART_NR CONFIG_SERIAL_TXX9_NR_UARTS
92#define NR_PCI_BOARDS 4
93#define UART_NR (4 + NR_PCI_BOARDS)
94#else
95#define UART_NR 4
96#endif
97 92
98#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) 93#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
99 94
@@ -987,6 +982,7 @@ int __init early_serial_txx9_setup(struct uart_port *port)
987} 982}
988 983
989#ifdef ENABLE_SERIAL_TXX9_PCI 984#ifdef ENABLE_SERIAL_TXX9_PCI
985#ifdef CONFIG_PM
990/** 986/**
991 * serial_txx9_suspend_port - suspend one serial port 987 * serial_txx9_suspend_port - suspend one serial port
992 * @line: serial line number 988 * @line: serial line number
@@ -1008,6 +1004,7 @@ static void serial_txx9_resume_port(int line)
1008{ 1004{
1009 uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port); 1005 uart_resume_port(&serial_txx9_reg, &serial_txx9_ports[line].port);
1010} 1006}
1007#endif
1011 1008
1012static DEFINE_MUTEX(serial_txx9_mutex); 1009static DEFINE_MUTEX(serial_txx9_mutex);
1013 1010
@@ -1118,6 +1115,7 @@ static void __devexit pciserial_txx9_remove_one(struct pci_dev *dev)
1118 } 1115 }
1119} 1116}
1120 1117
1118#ifdef CONFIG_PM
1121static int pciserial_txx9_suspend_one(struct pci_dev *dev, pm_message_t state) 1119static int pciserial_txx9_suspend_one(struct pci_dev *dev, pm_message_t state)
1122{ 1120{
1123 int line = (int)(long)pci_get_drvdata(dev); 1121 int line = (int)(long)pci_get_drvdata(dev);
@@ -1142,11 +1140,10 @@ static int pciserial_txx9_resume_one(struct pci_dev *dev)
1142 } 1140 }
1143 return 0; 1141 return 0;
1144} 1142}
1143#endif
1145 1144
1146static struct pci_device_id serial_txx9_pci_tbl[] = { 1145static const struct pci_device_id serial_txx9_pci_tbl[] = {
1147 { PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC, 1146 { PCI_DEVICE(PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC) },
1148 PCI_ANY_ID, PCI_ANY_ID,
1149 0, 0, 0 },
1150 { 0, } 1147 { 0, }
1151}; 1148};
1152 1149
@@ -1154,8 +1151,10 @@ static struct pci_driver serial_txx9_pci_driver = {
1154 .name = "serial_txx9", 1151 .name = "serial_txx9",
1155 .probe = pciserial_txx9_init_one, 1152 .probe = pciserial_txx9_init_one,
1156 .remove = __devexit_p(pciserial_txx9_remove_one), 1153 .remove = __devexit_p(pciserial_txx9_remove_one),
1154#ifdef CONFIG_PM
1157 .suspend = pciserial_txx9_suspend_one, 1155 .suspend = pciserial_txx9_suspend_one,
1158 .resume = pciserial_txx9_resume_one, 1156 .resume = pciserial_txx9_resume_one,
1157#endif
1159 .id_table = serial_txx9_pci_tbl, 1158 .id_table = serial_txx9_pci_tbl,
1160}; 1159};
1161 1160