aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c3
-rw-r--r--drivers/serial/Kconfig36
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c3
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.c6
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c6
-rw-r--r--drivers/serial/mpc52xx_uart.c181
-rw-r--r--drivers/serial/ucc_uart.c4
7 files changed, 15 insertions, 224 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index ec39203b879d..1528de23a650 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2976,6 +2976,9 @@ static int __init serial8250_init(void)
2976 "%d ports, IRQ sharing %sabled\n", nr_uarts, 2976 "%d ports, IRQ sharing %sabled\n", nr_uarts,
2977 share_irqs ? "en" : "dis"); 2977 share_irqs ? "en" : "dis");
2978 2978
2979 for (i = 0; i < NR_IRQS; i++)
2980 spin_lock_init(&irq_lists[i].lock);
2981
2979#ifdef CONFIG_SPARC 2982#ifdef CONFIG_SPARC
2980 ret = sunserial_register_minors(&serial8250_reg, UART_NR); 2983 ret = sunserial_register_minors(&serial8250_reg, UART_NR);
2981#else 2984#else
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 31786b3b0a68..db783b77a881 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -1123,42 +1123,6 @@ config SERIAL_CPM_CONSOLE
1123 your boot loader (lilo or loadlin) about how to pass options to the 1123 your boot loader (lilo or loadlin) about how to pass options to the
1124 kernel at boot time.) 1124 kernel at boot time.)
1125 1125
1126config SERIAL_CPM_SCC1
1127 bool "Support for SCC1 serial port"
1128 depends on SERIAL_CPM=y
1129 help
1130 Select this option to use SCC1 as a serial port
1131
1132config SERIAL_CPM_SCC2
1133 bool "Support for SCC2 serial port"
1134 depends on SERIAL_CPM=y
1135 help
1136 Select this option to use SCC2 as a serial port
1137
1138config SERIAL_CPM_SCC3
1139 bool "Support for SCC3 serial port"
1140 depends on SERIAL_CPM=y
1141 help
1142 Select this option to use SCC3 as a serial port
1143
1144config SERIAL_CPM_SCC4
1145 bool "Support for SCC4 serial port"
1146 depends on SERIAL_CPM=y
1147 help
1148 Select this option to use SCC4 as a serial port
1149
1150config SERIAL_CPM_SMC1
1151 bool "Support for SMC1 serial port"
1152 depends on SERIAL_CPM=y
1153 help
1154 Select this option to use SMC1 as a serial port
1155
1156config SERIAL_CPM_SMC2
1157 bool "Support for SMC2 serial port"
1158 depends on SERIAL_CPM=y
1159 help
1160 Select this option to use SMC2 as a serial port
1161
1162config SERIAL_SGI_L1_CONSOLE 1126config SERIAL_SGI_L1_CONSOLE
1163 bool "SGI Altix L1 serial console support" 1127 bool "SGI Altix L1 serial console support"
1164 depends on IA64_GENERIC || IA64_SGI_SN2 1128 depends on IA64_GENERIC || IA64_SGI_SN2
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 25efca5a7a1f..a6c4d744495e 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -1333,6 +1333,9 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev,
1333 if (ret) 1333 if (ret)
1334 return ret; 1334 return ret;
1335 1335
1336 /* initialize the device pointer for the port */
1337 pinfo->port.dev = &ofdev->dev;
1338
1336 return uart_add_one_port(&cpm_reg, &pinfo->port); 1339 return uart_add_one_port(&cpm_reg, &pinfo->port);
1337} 1340}
1338 1341
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 0f0aff06c596..1b94c56ec239 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -100,7 +100,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
100 mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); 100 mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
101 dma_addr = (u32)cpm_dpram_phys(mem_addr); 101 dma_addr = (u32)cpm_dpram_phys(mem_addr);
102 } else 102 } else
103 mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, 103 mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr,
104 GFP_KERNEL); 104 GFP_KERNEL);
105 105
106 if (mem_addr == NULL) { 106 if (mem_addr == NULL) {
@@ -127,8 +127,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
127 127
128void cpm_uart_freebuf(struct uart_cpm_port *pinfo) 128void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
129{ 129{
130 dma_free_coherent(NULL, L1_CACHE_ALIGN(pinfo->rx_nrfifos * 130 dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
131 pinfo->rx_fifosize) + 131 pinfo->rx_fifosize) +
132 L1_CACHE_ALIGN(pinfo->tx_nrfifos * 132 L1_CACHE_ALIGN(pinfo->tx_nrfifos *
133 pinfo->tx_fifosize), pinfo->mem_addr, 133 pinfo->tx_fifosize), pinfo->mem_addr,
134 pinfo->dma_addr); 134 pinfo->dma_addr);
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index b8db4d3eed36..141c0a3333ad 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -136,7 +136,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
136 dma_addr = virt_to_bus(mem_addr); 136 dma_addr = virt_to_bus(mem_addr);
137 } 137 }
138 else 138 else
139 mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, 139 mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr,
140 GFP_KERNEL); 140 GFP_KERNEL);
141 141
142 if (mem_addr == NULL) { 142 if (mem_addr == NULL) {
@@ -163,8 +163,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
163 163
164void cpm_uart_freebuf(struct uart_cpm_port *pinfo) 164void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
165{ 165{
166 dma_free_coherent(NULL, L1_CACHE_ALIGN(pinfo->rx_nrfifos * 166 dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
167 pinfo->rx_fifosize) + 167 pinfo->rx_fifosize) +
168 L1_CACHE_ALIGN(pinfo->tx_nrfifos * 168 L1_CACHE_ALIGN(pinfo->tx_nrfifos *
169 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr, 169 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,
170 pinfo->dma_addr); 170 pinfo->dma_addr);
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 36126070d9af..6117d3db0b66 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -72,13 +72,8 @@
72#include <linux/console.h> 72#include <linux/console.h>
73#include <linux/delay.h> 73#include <linux/delay.h>
74#include <linux/io.h> 74#include <linux/io.h>
75
76#if defined(CONFIG_PPC_MERGE)
77#include <linux/of.h> 75#include <linux/of.h>
78#include <linux/of_platform.h> 76#include <linux/of_platform.h>
79#else
80#include <linux/platform_device.h>
81#endif
82 77
83#include <asm/mpc52xx.h> 78#include <asm/mpc52xx.h>
84#include <asm/mpc512x.h> 79#include <asm/mpc512x.h>
@@ -107,12 +102,11 @@ static struct uart_port mpc52xx_uart_ports[MPC52xx_PSC_MAXNUM];
107 * it's cleared, then a memset(...,0,...) should be added to 102 * it's cleared, then a memset(...,0,...) should be added to
108 * the console_init 103 * the console_init
109 */ 104 */
110#if defined(CONFIG_PPC_MERGE) 105
111/* lookup table for matching device nodes to index numbers */ 106/* lookup table for matching device nodes to index numbers */
112static struct device_node *mpc52xx_uart_nodes[MPC52xx_PSC_MAXNUM]; 107static struct device_node *mpc52xx_uart_nodes[MPC52xx_PSC_MAXNUM];
113 108
114static void mpc52xx_uart_of_enumerate(void); 109static void mpc52xx_uart_of_enumerate(void);
115#endif
116 110
117 111
118#define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase)) 112#define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
@@ -255,17 +249,12 @@ static void mpc52xx_psc_cw_restore_ints(struct uart_port *port)
255/* Search for bus-frequency property in this node or a parent */ 249/* Search for bus-frequency property in this node or a parent */
256static unsigned long mpc52xx_getuartclk(void *p) 250static unsigned long mpc52xx_getuartclk(void *p)
257{ 251{
258#if defined(CONFIG_PPC_MERGE)
259 /* 252 /*
260 * 5200 UARTs have a / 32 prescaler 253 * 5200 UARTs have a / 32 prescaler
261 * but the generic serial code assumes 16 254 * but the generic serial code assumes 16
262 * so return ipb freq / 2 255 * so return ipb freq / 2
263 */ 256 */
264 return mpc52xx_find_ipb_freq(p) / 2; 257 return mpc52xx_find_ipb_freq(p) / 2;
265#else
266 pr_debug("unexpected call to mpc52xx_getuartclk with arch/ppc\n");
267 return NULL;
268#endif
269} 258}
270 259
271static struct psc_ops mpc52xx_psc_ops = { 260static struct psc_ops mpc52xx_psc_ops = {
@@ -886,10 +875,6 @@ mpc52xx_console_get_options(struct uart_port *port,
886 875
887 /* CT{U,L}R are write-only ! */ 876 /* CT{U,L}R are write-only ! */
888 *baud = CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD; 877 *baud = CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD;
889#if !defined(CONFIG_PPC_MERGE)
890 if (__res.bi_baudrate)
891 *baud = __res.bi_baudrate;
892#endif
893 878
894 /* Parse them */ 879 /* Parse them */
895 switch (mr1 & MPC52xx_PSC_MODE_BITS_MASK) { 880 switch (mr1 & MPC52xx_PSC_MODE_BITS_MASK) {
@@ -946,42 +931,6 @@ mpc52xx_console_write(struct console *co, const char *s, unsigned int count)
946 psc_ops->cw_restore_ints(port); 931 psc_ops->cw_restore_ints(port);
947} 932}
948 933
949#if !defined(CONFIG_PPC_MERGE)
950static int __init
951mpc52xx_console_setup(struct console *co, char *options)
952{
953 struct uart_port *port = &mpc52xx_uart_ports[co->index];
954
955 int baud = CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD;
956 int bits = 8;
957 int parity = 'n';
958 int flow = 'n';
959
960 if (co->index < 0 || co->index >= MPC52xx_PSC_MAXNUM)
961 return -EINVAL;
962
963 /* Basic port init. Needed since we use some uart_??? func before
964 * real init for early access */
965 spin_lock_init(&port->lock);
966 port->uartclk = __res.bi_ipbfreq / 2; /* Look at CTLR doc */
967 port->ops = &mpc52xx_uart_ops;
968 port->mapbase = MPC52xx_PA(MPC52xx_PSCx_OFFSET(co->index+1));
969
970 /* We ioremap ourself */
971 port->membase = ioremap(port->mapbase, MPC52xx_PSC_SIZE);
972 if (port->membase == NULL)
973 return -EINVAL;
974
975 /* Setup the port parameters accoding to options */
976 if (options)
977 uart_parse_options(options, &baud, &parity, &bits, &flow);
978 else
979 mpc52xx_console_get_options(port, &baud, &parity, &bits, &flow);
980
981 return uart_set_options(port, co, baud, parity, bits, flow);
982}
983
984#else
985 934
986static int __init 935static int __init
987mpc52xx_console_setup(struct console *co, char *options) 936mpc52xx_console_setup(struct console *co, char *options)
@@ -1053,7 +1002,6 @@ mpc52xx_console_setup(struct console *co, char *options)
1053 1002
1054 return uart_set_options(port, co, baud, parity, bits, flow); 1003 return uart_set_options(port, co, baud, parity, bits, flow);
1055} 1004}
1056#endif /* defined(CONFIG_PPC_MERGE) */
1057 1005
1058 1006
1059static struct uart_driver mpc52xx_uart_driver; 1007static struct uart_driver mpc52xx_uart_driver;
@@ -1072,9 +1020,7 @@ static struct console mpc52xx_console = {
1072static int __init 1020static int __init
1073mpc52xx_console_init(void) 1021mpc52xx_console_init(void)
1074{ 1022{
1075#if defined(CONFIG_PPC_MERGE)
1076 mpc52xx_uart_of_enumerate(); 1023 mpc52xx_uart_of_enumerate();
1077#endif
1078 register_console(&mpc52xx_console); 1024 register_console(&mpc52xx_console);
1079 return 0; 1025 return 0;
1080} 1026}
@@ -1100,115 +1046,6 @@ static struct uart_driver mpc52xx_uart_driver = {
1100 .cons = MPC52xx_PSC_CONSOLE, 1046 .cons = MPC52xx_PSC_CONSOLE,
1101}; 1047};
1102 1048
1103
1104#if !defined(CONFIG_PPC_MERGE)
1105/* ======================================================================== */
1106/* Platform Driver */
1107/* ======================================================================== */
1108
1109static int __devinit
1110mpc52xx_uart_probe(struct platform_device *dev)
1111{
1112 struct resource *res = dev->resource;
1113
1114 struct uart_port *port = NULL;
1115 int i, idx, ret;
1116
1117 /* Check validity & presence */
1118 idx = dev->id;
1119 if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
1120 return -EINVAL;
1121
1122 if (!mpc52xx_match_psc_function(idx, "uart"))
1123 return -ENODEV;
1124
1125 /* Init the port structure */
1126 port = &mpc52xx_uart_ports[idx];
1127
1128 spin_lock_init(&port->lock);
1129 port->uartclk = __res.bi_ipbfreq / 2; /* Look at CTLR doc */
1130 port->fifosize = 512;
1131 port->iotype = UPIO_MEM;
1132 port->flags = UPF_BOOT_AUTOCONF |
1133 (uart_console(port) ? 0 : UPF_IOREMAP);
1134 port->line = idx;
1135 port->ops = &mpc52xx_uart_ops;
1136 port->dev = &dev->dev;
1137
1138 /* Search for IRQ and mapbase */
1139 for (i = 0 ; i < dev->num_resources ; i++, res++) {
1140 if (res->flags & IORESOURCE_MEM)
1141 port->mapbase = res->start;
1142 else if (res->flags & IORESOURCE_IRQ)
1143 port->irq = res->start;
1144 }
1145 if (!port->irq || !port->mapbase)
1146 return -EINVAL;
1147
1148 /* Add the port to the uart sub-system */
1149 ret = uart_add_one_port(&mpc52xx_uart_driver, port);
1150 if (!ret)
1151 platform_set_drvdata(dev, (void *)port);
1152
1153 return ret;
1154}
1155
1156static int
1157mpc52xx_uart_remove(struct platform_device *dev)
1158{
1159 struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev);
1160
1161 platform_set_drvdata(dev, NULL);
1162
1163 if (port)
1164 uart_remove_one_port(&mpc52xx_uart_driver, port);
1165
1166 return 0;
1167}
1168
1169#ifdef CONFIG_PM
1170static int
1171mpc52xx_uart_suspend(struct platform_device *dev, pm_message_t state)
1172{
1173 struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev);
1174
1175 if (port)
1176 uart_suspend_port(&mpc52xx_uart_driver, port);
1177
1178 return 0;
1179}
1180
1181static int
1182mpc52xx_uart_resume(struct platform_device *dev)
1183{
1184 struct uart_port *port = (struct uart_port *) platform_get_drvdata(dev);
1185
1186 if (port)
1187 uart_resume_port(&mpc52xx_uart_driver, port);
1188
1189 return 0;
1190}
1191#endif
1192
1193/* work with hotplug and coldplug */
1194MODULE_ALIAS("platform:mpc52xx-psc");
1195
1196static struct platform_driver mpc52xx_uart_platform_driver = {
1197 .probe = mpc52xx_uart_probe,
1198 .remove = mpc52xx_uart_remove,
1199#ifdef CONFIG_PM
1200 .suspend = mpc52xx_uart_suspend,
1201 .resume = mpc52xx_uart_resume,
1202#endif
1203 .driver = {
1204 .owner = THIS_MODULE,
1205 .name = "mpc52xx-psc",
1206 },
1207};
1208#endif /* !defined(CONFIG_PPC_MERGE) */
1209
1210
1211#if defined(CONFIG_PPC_MERGE)
1212/* ======================================================================== */ 1049/* ======================================================================== */
1213/* OF Platform Driver */ 1050/* OF Platform Driver */
1214/* ======================================================================== */ 1051/* ======================================================================== */
@@ -1402,7 +1239,6 @@ static struct of_platform_driver mpc52xx_uart_of_driver = {
1402 .name = "mpc52xx-psc-uart", 1239 .name = "mpc52xx-psc-uart",
1403 }, 1240 },
1404}; 1241};
1405#endif /* defined(CONFIG_PPC_MERGE) */
1406 1242
1407 1243
1408/* ======================================================================== */ 1244/* ======================================================================== */
@@ -1423,7 +1259,6 @@ mpc52xx_uart_init(void)
1423 return ret; 1259 return ret;
1424 } 1260 }
1425 1261
1426#if defined(CONFIG_PPC_MERGE)
1427 mpc52xx_uart_of_enumerate(); 1262 mpc52xx_uart_of_enumerate();
1428 1263
1429 ret = of_register_platform_driver(&mpc52xx_uart_of_driver); 1264 ret = of_register_platform_driver(&mpc52xx_uart_of_driver);
@@ -1433,16 +1268,6 @@ mpc52xx_uart_init(void)
1433 uart_unregister_driver(&mpc52xx_uart_driver); 1268 uart_unregister_driver(&mpc52xx_uart_driver);
1434 return ret; 1269 return ret;
1435 } 1270 }
1436#else
1437 psc_ops = &mpc52xx_psc_ops;
1438 ret = platform_driver_register(&mpc52xx_uart_platform_driver);
1439 if (ret) {
1440 printk(KERN_ERR "%s: platform_driver_register failed (%i)\n",
1441 __FILE__, ret);
1442 uart_unregister_driver(&mpc52xx_uart_driver);
1443 return ret;
1444 }
1445#endif
1446 1271
1447 return 0; 1272 return 0;
1448} 1273}
@@ -1450,11 +1275,7 @@ mpc52xx_uart_init(void)
1450static void __exit 1275static void __exit
1451mpc52xx_uart_exit(void) 1276mpc52xx_uart_exit(void)
1452{ 1277{
1453#if defined(CONFIG_PPC_MERGE)
1454 of_unregister_platform_driver(&mpc52xx_uart_of_driver); 1278 of_unregister_platform_driver(&mpc52xx_uart_of_driver);
1455#else
1456 platform_driver_unregister(&mpc52xx_uart_platform_driver);
1457#endif
1458 uart_unregister_driver(&mpc52xx_uart_driver); 1279 uart_unregister_driver(&mpc52xx_uart_driver);
1459} 1280}
1460 1281
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c
index 5c5d18dcb6ac..539c933b335f 100644
--- a/drivers/serial/ucc_uart.c
+++ b/drivers/serial/ucc_uart.c
@@ -1009,7 +1009,7 @@ static int qe_uart_request_port(struct uart_port *port)
1009 rx_size = L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize); 1009 rx_size = L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
1010 tx_size = L1_CACHE_ALIGN(qe_port->tx_nrfifos * qe_port->tx_fifosize); 1010 tx_size = L1_CACHE_ALIGN(qe_port->tx_nrfifos * qe_port->tx_fifosize);
1011 1011
1012 bd_virt = dma_alloc_coherent(NULL, rx_size + tx_size, &bd_dma_addr, 1012 bd_virt = dma_alloc_coherent(port->dev, rx_size + tx_size, &bd_dma_addr,
1013 GFP_KERNEL); 1013 GFP_KERNEL);
1014 if (!bd_virt) { 1014 if (!bd_virt) {
1015 dev_err(port->dev, "could not allocate buffer descriptors\n"); 1015 dev_err(port->dev, "could not allocate buffer descriptors\n");
@@ -1051,7 +1051,7 @@ static void qe_uart_release_port(struct uart_port *port)
1051 container_of(port, struct uart_qe_port, port); 1051 container_of(port, struct uart_qe_port, port);
1052 struct ucc_slow_private *uccs = qe_port->us_private; 1052 struct ucc_slow_private *uccs = qe_port->us_private;
1053 1053
1054 dma_free_coherent(NULL, qe_port->bd_size, qe_port->bd_virt, 1054 dma_free_coherent(port->dev, qe_port->bd_size, qe_port->bd_virt,
1055 qe_port->bd_dma_addr); 1055 qe_port->bd_dma_addr);
1056 1056
1057 ucc_slow_free(uccs); 1057 ucc_slow_free(uccs);