aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250_pci.c2
-rw-r--r--drivers/serial/Kconfig10
-rw-r--r--drivers/serial/amba-pl011.c2
-rw-r--r--drivers/serial/mpc52xx_uart.c28
-rw-r--r--drivers/serial/pxa.c4
-rw-r--r--drivers/serial/serial_cs.c119
6 files changed, 47 insertions, 118 deletions
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 8d92adfbb8bd..8adca0ce267f 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -516,7 +516,7 @@ pci_timedia_setup(struct serial_private *priv, struct pciserial_board *board,
516 break; 516 break;
517 case 3: 517 case 3:
518 offset = board->uart_offset; 518 offset = board->uart_offset;
519 bar = 1; 519 /* FALLTHROUGH */
520 case 4: /* BAR 2 */ 520 case 4: /* BAR 2 */
521 case 5: /* BAR 3 */ 521 case 5: /* BAR 3 */
522 case 6: /* BAR 4 */ 522 case 6: /* BAR 4 */
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index ad47c1b84c3f..812bae62c8ec 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -10,7 +10,7 @@ menu "Serial drivers"
10# The new 8250/16550 serial drivers 10# The new 8250/16550 serial drivers
11config SERIAL_8250 11config SERIAL_8250
12 tristate "8250/16550 and compatible serial support" 12 tristate "8250/16550 and compatible serial support"
13 depends on (BROKEN || !(SPARC64 || SPARC32)) 13 depends on (BROKEN || !SPARC)
14 select SERIAL_CORE 14 select SERIAL_CORE
15 ---help--- 15 ---help---
16 This selects whether you want to include the driver for the standard 16 This selects whether you want to include the driver for the standard
@@ -469,14 +469,14 @@ config SERIAL_IMX_CONSOLE
469 469
470config SERIAL_SUNCORE 470config SERIAL_SUNCORE
471 bool 471 bool
472 depends on SPARC32 || SPARC64 472 depends on SPARC
473 select SERIAL_CORE 473 select SERIAL_CORE
474 select SERIAL_CORE_CONSOLE 474 select SERIAL_CORE_CONSOLE
475 default y 475 default y
476 476
477config SERIAL_SUNZILOG 477config SERIAL_SUNZILOG
478 tristate "Sun Zilog8530 serial support" 478 tristate "Sun Zilog8530 serial support"
479 depends on SPARC32 || SPARC64 479 depends on SPARC
480 help 480 help
481 This driver supports the Zilog8530 serial ports found on many Sparc 481 This driver supports the Zilog8530 serial ports found on many Sparc
482 systems. Say Y or M if you want to be able to these serial ports. 482 systems. Say Y or M if you want to be able to these serial ports.
@@ -491,7 +491,7 @@ config SERIAL_SUNZILOG_CONSOLE
491 491
492config SERIAL_SUNSU 492config SERIAL_SUNSU
493 tristate "Sun SU serial support" 493 tristate "Sun SU serial support"
494 depends on (SPARC32 || SPARC64) && PCI 494 depends on SPARC && PCI
495 help 495 help
496 This driver supports the 8250 serial ports that run the keyboard and 496 This driver supports the 8250 serial ports that run the keyboard and
497 mouse on (PCI) UltraSPARC systems. Say Y or M if you want to be able 497 mouse on (PCI) UltraSPARC systems. Say Y or M if you want to be able
@@ -547,7 +547,7 @@ config PDC_CONSOLE
547 547
548config SERIAL_SUNSAB 548config SERIAL_SUNSAB
549 tristate "Sun Siemens SAB82532 serial support" 549 tristate "Sun Siemens SAB82532 serial support"
550 depends on (SPARC32 || SPARC64) && PCI 550 depends on SPARC && PCI
551 help 551 help
552 This driver supports the Siemens SAB82532 DUSCC serial ports on newer 552 This driver supports the Siemens SAB82532 DUSCC serial ports on newer
553 (PCI) UltraSPARC systems. Say Y or M if you want to be able to these 553 (PCI) UltraSPARC systems. Say Y or M if you want to be able to these
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 89d7bd3eaee3..d84476ee6592 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -160,7 +160,7 @@ pl011_rx_chars(struct uart_amba_port *uap)
160 flag = TTY_FRAME; 160 flag = TTY_FRAME;
161 } 161 }
162 162
163 if (uart_handle_sysrq_char(&uap->port, ch, regs)) 163 if (uart_handle_sysrq_char(&uap->port, ch & 255, regs))
164 goto ignore_char; 164 goto ignore_char;
165 165
166 uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); 166 uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag);
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index b8727d9bf690..1288d6203e94 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -37,11 +37,11 @@
37 * by the bootloader or in the platform init code. 37 * by the bootloader or in the platform init code.
38 * 38 *
39 * The idx field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2, 39 * The idx field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2,
40 * and so on). So the PSC1 is mapped to /dev/ttyS0, PSC2 to /dev/ttyS1 and so 40 * and so on). So the PSC1 is mapped to /dev/ttyPSC0, PSC2 to /dev/ttyPSC1 and
41 * on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly for 41 * so on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly
42 * the console code : without this 1:1 mapping, at early boot time, when we are 42 * fpr the console code : without this 1:1 mapping, at early boot time, when we
43 * parsing the kernel args console=ttyS?, we wouldn't know wich PSC it will be 43 * are parsing the kernel args console=ttyPSC?, we wouldn't know wich PSC it
44 * mapped to. 44 * will be mapped to.
45 */ 45 */
46 46
47#include <linux/config.h> 47#include <linux/config.h>
@@ -65,6 +65,10 @@
65#include <linux/serial_core.h> 65#include <linux/serial_core.h>
66 66
67 67
68/* We've been assigned a range on the "Low-density serial ports" major */
69#define SERIAL_PSC_MAJOR 204
70#define SERIAL_PSC_MINOR 148
71
68 72
69#define ISR_PASS_LIMIT 256 /* Max number of iteration in the interrupt */ 73#define ISR_PASS_LIMIT 256 /* Max number of iteration in the interrupt */
70 74
@@ -668,15 +672,15 @@ mpc52xx_console_setup(struct console *co, char *options)
668} 672}
669 673
670 674
671extern struct uart_driver mpc52xx_uart_driver; 675static struct uart_driver mpc52xx_uart_driver;
672 676
673static struct console mpc52xx_console = { 677static struct console mpc52xx_console = {
674 .name = "ttyS", 678 .name = "ttyPSC",
675 .write = mpc52xx_console_write, 679 .write = mpc52xx_console_write,
676 .device = uart_console_device, 680 .device = uart_console_device,
677 .setup = mpc52xx_console_setup, 681 .setup = mpc52xx_console_setup,
678 .flags = CON_PRINTBUFFER, 682 .flags = CON_PRINTBUFFER,
679 .index = -1, /* Specified on the cmdline (e.g. console=ttyS0 ) */ 683 .index = -1, /* Specified on the cmdline (e.g. console=ttyPSC0 ) */
680 .data = &mpc52xx_uart_driver, 684 .data = &mpc52xx_uart_driver,
681}; 685};
682 686
@@ -703,10 +707,10 @@ console_initcall(mpc52xx_console_init);
703static struct uart_driver mpc52xx_uart_driver = { 707static struct uart_driver mpc52xx_uart_driver = {
704 .owner = THIS_MODULE, 708 .owner = THIS_MODULE,
705 .driver_name = "mpc52xx_psc_uart", 709 .driver_name = "mpc52xx_psc_uart",
706 .dev_name = "ttyS", 710 .dev_name = "ttyPSC",
707 .devfs_name = "ttyS", 711 .devfs_name = "ttyPSC",
708 .major = TTY_MAJOR, 712 .major = SERIAL_PSC_MAJOR,
709 .minor = 64, 713 .minor = SERIAL_PSC_MINOR,
710 .nr = MPC52xx_PSC_MAXNUM, 714 .nr = MPC52xx_PSC_MAXNUM,
711 .cons = MPC52xx_PSC_CONSOLE, 715 .cons = MPC52xx_PSC_CONSOLE,
712}; 716};
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index ff5e6309d682..cc998b99a19f 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -361,7 +361,7 @@ static int serial_pxa_startup(struct uart_port *port)
361 if (port->line == 3) /* HWUART */ 361 if (port->line == 3) /* HWUART */
362 up->mcr |= UART_MCR_AFE; 362 up->mcr |= UART_MCR_AFE;
363 else 363 else
364 up->mcr = 0; 364 up->mcr = 0;
365 365
366 /* 366 /*
367 * Allocate the IRQ 367 * Allocate the IRQ
@@ -641,7 +641,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
641 int i; 641 int i;
642 642
643 /* 643 /*
644 * First save the UER then disable the interrupts 644 * First save the IER then disable the interrupts
645 */ 645 */
646 ier = serial_in(up, UART_IER); 646 ier = serial_in(up, UART_IER);
647 serial_out(up, UART_IER, UART_IER_UUE); 647 serial_out(up, UART_IER, UART_IER_UUE);
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 7ce0c7e66d37..96969cb960a9 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -114,15 +114,7 @@ struct serial_cfg_mem {
114 114
115 115
116static void serial_config(dev_link_t * link); 116static void serial_config(dev_link_t * link);
117static int serial_event(event_t event, int priority,
118 event_callback_args_t * args);
119 117
120static dev_info_t dev_info = "serial_cs";
121
122static dev_link_t *serial_attach(void);
123static void serial_detach(dev_link_t *);
124
125static dev_link_t *dev_list = NULL;
126 118
127/*====================================================================== 119/*======================================================================
128 120
@@ -159,8 +151,9 @@ static void serial_remove(dev_link_t *link)
159 } 151 }
160} 152}
161 153
162static void serial_suspend(dev_link_t *link) 154static int serial_suspend(struct pcmcia_device *dev)
163{ 155{
156 dev_link_t *link = dev_to_instance(dev);
164 link->state |= DEV_SUSPEND; 157 link->state |= DEV_SUSPEND;
165 158
166 if (link->state & DEV_CONFIG) { 159 if (link->state & DEV_CONFIG) {
@@ -173,10 +166,13 @@ static void serial_suspend(dev_link_t *link)
173 if (!info->slave) 166 if (!info->slave)
174 pcmcia_release_configuration(link->handle); 167 pcmcia_release_configuration(link->handle);
175 } 168 }
169
170 return 0;
176} 171}
177 172
178static void serial_resume(dev_link_t *link) 173static int serial_resume(struct pcmcia_device *dev)
179{ 174{
175 dev_link_t *link = dev_to_instance(dev);
180 link->state &= ~DEV_SUSPEND; 176 link->state &= ~DEV_SUSPEND;
181 177
182 if (DEV_OK(link)) { 178 if (DEV_OK(link)) {
@@ -189,6 +185,8 @@ static void serial_resume(dev_link_t *link)
189 for (i = 0; i < info->ndev; i++) 185 for (i = 0; i < info->ndev; i++)
190 serial8250_resume_port(info->line[i]); 186 serial8250_resume_port(info->line[i]);
191 } 187 }
188
189 return 0;
192} 190}
193 191
194/*====================================================================== 192/*======================================================================
@@ -199,19 +197,17 @@ static void serial_resume(dev_link_t *link)
199 197
200======================================================================*/ 198======================================================================*/
201 199
202static dev_link_t *serial_attach(void) 200static int serial_probe(struct pcmcia_device *p_dev)
203{ 201{
204 struct serial_info *info; 202 struct serial_info *info;
205 client_reg_t client_reg;
206 dev_link_t *link; 203 dev_link_t *link;
207 int ret;
208 204
209 DEBUG(0, "serial_attach()\n"); 205 DEBUG(0, "serial_attach()\n");
210 206
211 /* Create new serial device */ 207 /* Create new serial device */
212 info = kmalloc(sizeof (*info), GFP_KERNEL); 208 info = kmalloc(sizeof (*info), GFP_KERNEL);
213 if (!info) 209 if (!info)
214 return NULL; 210 return -ENOMEM;
215 memset(info, 0, sizeof (*info)); 211 memset(info, 0, sizeof (*info));
216 link = &info->link; 212 link = &info->link;
217 link->priv = info; 213 link->priv = info;
@@ -227,20 +223,12 @@ static dev_link_t *serial_attach(void)
227 } 223 }
228 link->conf.IntType = INT_MEMORY_AND_IO; 224 link->conf.IntType = INT_MEMORY_AND_IO;
229 225
230 /* Register with Card Services */ 226 link->handle = p_dev;
231 link->next = dev_list; 227 p_dev->instance = link;
232 dev_list = link; 228 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
233 client_reg.dev_info = &dev_info; 229 serial_config(link);
234 client_reg.Version = 0x0210;
235 client_reg.event_callback_args.client_data = link;
236 ret = pcmcia_register_client(&link->handle, &client_reg);
237 if (ret != CS_SUCCESS) {
238 cs_error(link->handle, RegisterClient, ret);
239 serial_detach(link);
240 return NULL;
241 }
242 230
243 return link; 231 return 0;
244} 232}
245 233
246/*====================================================================== 234/*======================================================================
@@ -252,21 +240,13 @@ static dev_link_t *serial_attach(void)
252 240
253======================================================================*/ 241======================================================================*/
254 242
255static void serial_detach(dev_link_t * link) 243static void serial_detach(struct pcmcia_device *p_dev)
256{ 244{
245 dev_link_t *link = dev_to_instance(p_dev);
257 struct serial_info *info = link->priv; 246 struct serial_info *info = link->priv;
258 dev_link_t **linkp;
259 int ret;
260 247
261 DEBUG(0, "serial_detach(0x%p)\n", link); 248 DEBUG(0, "serial_detach(0x%p)\n", link);
262 249
263 /* Locate device structure */
264 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
265 if (*linkp == link)
266 break;
267 if (*linkp == NULL)
268 return;
269
270 /* 250 /*
271 * Ensure any outstanding scheduled tasks are completed. 251 * Ensure any outstanding scheduled tasks are completed.
272 */ 252 */
@@ -277,14 +257,7 @@ static void serial_detach(dev_link_t * link)
277 */ 257 */
278 serial_remove(link); 258 serial_remove(link);
279 259
280 if (link->handle) { 260 /* free bits */
281 ret = pcmcia_deregister_client(link->handle);
282 if (ret != CS_SUCCESS)
283 cs_error(link->handle, DeregisterClient, ret);
284 }
285
286 /* Unlink device structure, free bits */
287 *linkp = link->next;
288 kfree(info); 261 kfree(info);
289} 262}
290 263
@@ -718,54 +691,6 @@ void serial_config(dev_link_t * link)
718 kfree(cfg_mem); 691 kfree(cfg_mem);
719} 692}
720 693
721/*======================================================================
722
723 The card status event handler. Mostly, this schedules other
724 stuff to run after an event is received. A CARD_REMOVAL event
725 also sets some flags to discourage the serial drivers from
726 talking to the ports.
727
728======================================================================*/
729
730static int
731serial_event(event_t event, int priority, event_callback_args_t * args)
732{
733 dev_link_t *link = args->client_data;
734 struct serial_info *info = link->priv;
735
736 DEBUG(1, "serial_event(0x%06x)\n", event);
737
738 switch (event) {
739 case CS_EVENT_CARD_REMOVAL:
740 serial_remove(link);
741 break;
742
743 case CS_EVENT_CARD_INSERTION:
744 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
745 serial_config(link);
746 break;
747
748 case CS_EVENT_PM_SUSPEND:
749 serial_suspend(link);
750 break;
751
752 case CS_EVENT_RESET_PHYSICAL:
753 if ((link->state & DEV_CONFIG) && !info->slave)
754 pcmcia_release_configuration(link->handle);
755 break;
756
757 case CS_EVENT_PM_RESUME:
758 serial_resume(link);
759 break;
760
761 case CS_EVENT_CARD_RESET:
762 if (DEV_OK(link) && !info->slave)
763 pcmcia_request_configuration(link->handle, &link->conf);
764 break;
765 }
766 return 0;
767}
768
769static struct pcmcia_device_id serial_ids[] = { 694static struct pcmcia_device_id serial_ids[] = {
770 PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0057, 0x0021), 695 PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0057, 0x0021),
771 PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0089, 0x110a), 696 PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0089, 0x110a),
@@ -877,10 +802,11 @@ static struct pcmcia_driver serial_cs_driver = {
877 .drv = { 802 .drv = {
878 .name = "serial_cs", 803 .name = "serial_cs",
879 }, 804 },
880 .attach = serial_attach, 805 .probe = serial_probe,
881 .event = serial_event, 806 .remove = serial_detach,
882 .detach = serial_detach,
883 .id_table = serial_ids, 807 .id_table = serial_ids,
808 .suspend = serial_suspend,
809 .resume = serial_resume,
884}; 810};
885 811
886static int __init init_serial_cs(void) 812static int __init init_serial_cs(void)
@@ -891,7 +817,6 @@ static int __init init_serial_cs(void)
891static void __exit exit_serial_cs(void) 817static void __exit exit_serial_cs(void)
892{ 818{
893 pcmcia_unregister_driver(&serial_cs_driver); 819 pcmcia_unregister_driver(&serial_cs_driver);
894 BUG_ON(dev_list != NULL);
895} 820}
896 821
897module_init(init_serial_cs); 822module_init(init_serial_cs);