aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-29 23:04:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-29 23:04:53 -0400
commit9ff9a26b786c35ee8d2a66222924a807ec851a9f (patch)
treedb432a17bccca1ca2c16907f0ee83ac449ed4012 /drivers/serial
parent0a3108beea9143225119d5e7c72a8e2c64f3eb7d (diff)
parent0d34fb8e93ceba7b6dad0062dbb4a0813bacd75b (diff)
Merge commit 'origin/master' into next
Manual merge of: arch/powerpc/include/asm/elf.h drivers/i2c/busses/i2c-mpc.c
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/21285.c2
-rw-r--r--drivers/serial/Kconfig2
-rw-r--r--drivers/serial/clps711x.c2
-rw-r--r--drivers/serial/imx.c2
-rw-r--r--drivers/serial/pxa.c30
-rw-r--r--drivers/serial/sa1100.c2
-rw-r--r--drivers/serial/sh-sci.c12
-rw-r--r--drivers/serial/sh-sci.h15
-rw-r--r--drivers/serial/sunzilog.c4
9 files changed, 37 insertions, 34 deletions
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c
index f31c6698419c..cb6d85d7ff43 100644
--- a/drivers/serial/21285.c
+++ b/drivers/serial/21285.c
@@ -14,8 +14,8 @@
14#include <linux/tty_flip.h> 14#include <linux/tty_flip.h>
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16#include <linux/serial.h> 16#include <linux/serial.h>
17#include <linux/io.h>
17 18
18#include <asm/io.h>
19#include <asm/irq.h> 19#include <asm/irq.h>
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/hardware/dec21285.h> 21#include <asm/hardware/dec21285.h>
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 7d7f576da202..9be11b0963f2 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -628,7 +628,7 @@ config SERIAL_MPSC_CONSOLE
628 628
629config SERIAL_PXA 629config SERIAL_PXA
630 bool "PXA serial port support" 630 bool "PXA serial port support"
631 depends on ARM && ARCH_PXA 631 depends on ARCH_PXA || ARCH_MMP
632 select SERIAL_CORE 632 select SERIAL_CORE
633 help 633 help
634 If you have a machine based on an Intel XScale PXA2xx CPU you 634 If you have a machine based on an Intel XScale PXA2xx CPU you
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
index 459f3420a429..80e76426131d 100644
--- a/drivers/serial/clps711x.c
+++ b/drivers/serial/clps711x.c
@@ -38,9 +38,9 @@
38#include <linux/tty_flip.h> 38#include <linux/tty_flip.h>
39#include <linux/serial_core.h> 39#include <linux/serial_core.h>
40#include <linux/serial.h> 40#include <linux/serial.h>
41#include <linux/io.h>
41 42
42#include <mach/hardware.h> 43#include <mach/hardware.h>
43#include <asm/io.h>
44#include <asm/irq.h> 44#include <asm/irq.h>
45#include <asm/hardware/clps7111.h> 45#include <asm/hardware/clps7111.h>
46 46
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index a50954612b60..9f460b175c50 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -1129,7 +1129,7 @@ static int serial_imx_probe(struct platform_device *pdev)
1129 sport->timer.function = imx_timeout; 1129 sport->timer.function = imx_timeout;
1130 sport->timer.data = (unsigned long)sport; 1130 sport->timer.data = (unsigned long)sport;
1131 1131
1132 sport->clk = clk_get(&pdev->dev, "uart_clk"); 1132 sport->clk = clk_get(&pdev->dev, "uart");
1133 if (IS_ERR(sport->clk)) { 1133 if (IS_ERR(sport->clk)) {
1134 ret = PTR_ERR(sport->clk); 1134 ret = PTR_ERR(sport->clk);
1135 goto unmap; 1135 goto unmap;
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index f6e3b86bb0be..a48a8a13d87b 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -43,13 +43,7 @@
43#include <linux/tty_flip.h> 43#include <linux/tty_flip.h>
44#include <linux/serial_core.h> 44#include <linux/serial_core.h>
45#include <linux/clk.h> 45#include <linux/clk.h>
46 46#include <linux/io.h>
47#include <asm/io.h>
48#include <mach/hardware.h>
49#include <asm/irq.h>
50#include <mach/pxa-regs.h>
51#include <mach/regs-uart.h>
52
53 47
54struct uart_pxa_port { 48struct uart_pxa_port {
55 struct uart_port port; 49 struct uart_port port;
@@ -491,7 +485,7 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
491 * Ensure the port will be enabled. 485 * Ensure the port will be enabled.
492 * This is required especially for serial console. 486 * This is required especially for serial console.
493 */ 487 */
494 up->ier |= IER_UUE; 488 up->ier |= UART_IER_UUE;
495 489
496 /* 490 /*
497 * Update the per-port timeout. 491 * Update the per-port timeout.
@@ -784,19 +778,15 @@ static int serial_pxa_probe(struct platform_device *dev)
784 sport->port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; 778 sport->port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
785 sport->port.uartclk = clk_get_rate(sport->clk); 779 sport->port.uartclk = clk_get_rate(sport->clk);
786 780
787 /* 781 switch (dev->id) {
788 * Is it worth keeping this? 782 case 0: sport->name = "FFUART"; break;
789 */ 783 case 1: sport->name = "BTUART"; break;
790 if (mmres->start == __PREG(FFUART)) 784 case 2: sport->name = "STUART"; break;
791 sport->name = "FFUART"; 785 case 3: sport->name = "HWUART"; break;
792 else if (mmres->start == __PREG(BTUART)) 786 default:
793 sport->name = "BTUART";
794 else if (mmres->start == __PREG(STUART))
795 sport->name = "STUART";
796 else if (mmres->start == __PREG(HWUART))
797 sport->name = "HWUART";
798 else
799 sport->name = "???"; 787 sport->name = "???";
788 break;
789 }
800 790
801 sport->port.membase = ioremap(mmres->start, mmres->end - mmres->start + 1); 791 sport->port.membase = ioremap(mmres->start, mmres->end - mmres->start + 1);
802 if (!sport->port.membase) { 792 if (!sport->port.membase) {
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index b24a25ea6bc5..94530f01521e 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -36,8 +36,8 @@
36#include <linux/tty_flip.h> 36#include <linux/tty_flip.h>
37#include <linux/serial_core.h> 37#include <linux/serial_core.h>
38#include <linux/serial.h> 38#include <linux/serial.h>
39#include <linux/io.h>
39 40
40#include <asm/io.h>
41#include <asm/irq.h> 41#include <asm/irq.h>
42#include <mach/hardware.h> 42#include <mach/hardware.h>
43#include <asm/mach/serial_sa1100.h> 43#include <asm/mach/serial_sa1100.h>
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 557b54ab2f25..dbf5357a77b3 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -139,7 +139,7 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
139 } while (!(status & SCxSR_TDxE(port))); 139 } while (!(status & SCxSR_TDxE(port)));
140 140
141 sci_in(port, SCxSR); /* Dummy read */ 141 sci_in(port, SCxSR); /* Dummy read */
142 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 142 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port));
143 sci_out(port, SCxTDR, c); 143 sci_out(port, SCxTDR, c);
144} 144}
145#endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */ 145#endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */
@@ -263,6 +263,7 @@ static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
263#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 263#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
264 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 264 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
265 defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 265 defined(CONFIG_CPU_SUBTYPE_SH7785) || \
266 defined(CONFIG_CPU_SUBTYPE_SH7786) || \
266 defined(CONFIG_CPU_SUBTYPE_SHX3) 267 defined(CONFIG_CPU_SUBTYPE_SHX3)
267static inline void sci_init_pins(struct uart_port *port, unsigned int cflag) 268static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
268{ 269{
@@ -284,7 +285,8 @@ static inline void sci_init_pins(struct uart_port *port, unsigned int cflag)
284 285
285#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ 286#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
286 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 287 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
287 defined(CONFIG_CPU_SUBTYPE_SH7785) 288 defined(CONFIG_CPU_SUBTYPE_SH7785) || \
289 defined(CONFIG_CPU_SUBTYPE_SH7786)
288static inline int scif_txroom(struct uart_port *port) 290static inline int scif_txroom(struct uart_port *port)
289{ 291{
290 return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff); 292 return SCIF_TXROOM_MAX - (sci_in(port, SCTFDR) & 0xff);
@@ -1095,6 +1097,7 @@ static void serial_console_write(struct console *co, const char *s,
1095 unsigned count) 1097 unsigned count)
1096{ 1098{
1097 struct uart_port *port = &serial_console_port->port; 1099 struct uart_port *port = &serial_console_port->port;
1100 unsigned short bits;
1098 int i; 1101 int i;
1099 1102
1100 for (i = 0; i < count; i++) { 1103 for (i = 0; i < count; i++) {
@@ -1103,6 +1106,11 @@ static void serial_console_write(struct console *co, const char *s,
1103 1106
1104 sci_poll_put_char(port, *s++); 1107 sci_poll_put_char(port, *s++);
1105 } 1108 }
1109
1110 /* wait until fifo is empty and last bit has been transmitted */
1111 bits = SCxSR_TDxE(port) | SCxSR_TEND(port);
1112 while ((sci_in(port, SCxSR) & bits) != bits)
1113 cpu_relax();
1106} 1114}
1107 1115
1108static int __init serial_console_setup(struct console *co, char *options) 1116static int __init serial_console_setup(struct console *co, char *options)
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index 022e89ffec1d..d0aa82d7fce0 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -1,6 +1,6 @@
1#include <linux/serial_core.h> 1#include <linux/serial_core.h>
2#include <asm/io.h> 2#include <asm/io.h>
3#include <asm/gpio.h> 3#include <linux/gpio.h>
4 4
5#if defined(CONFIG_H83007) || defined(CONFIG_H83068) 5#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
6#include <asm/regs306x.h> 6#include <asm/regs306x.h>
@@ -126,7 +126,8 @@
126# define SCSPTR1 0xffe10024 /* 16 bit SCIF */ 126# define SCSPTR1 0xffe10024 /* 16 bit SCIF */
127# define SCIF_ORER 0x0001 /* Overrun error bit */ 127# define SCIF_ORER 0x0001 /* Overrun error bit */
128# define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 128# define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
129#elif defined(CONFIG_CPU_SUBTYPE_SH7785) 129#elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \
130 defined(CONFIG_CPU_SUBTYPE_SH7786)
130# define SCSPTR0 0xffea0024 /* 16 bit SCIF */ 131# define SCSPTR0 0xffea0024 /* 16 bit SCIF */
131# define SCSPTR1 0xffeb0024 /* 16 bit SCIF */ 132# define SCSPTR1 0xffeb0024 /* 16 bit SCIF */
132# define SCSPTR2 0xffec0024 /* 16 bit SCIF */ 133# define SCSPTR2 0xffec0024 /* 16 bit SCIF */
@@ -182,6 +183,7 @@
182 defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 183 defined(CONFIG_CPU_SUBTYPE_SH7763) || \
183 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 184 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
184 defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 185 defined(CONFIG_CPU_SUBTYPE_SH7785) || \
186 defined(CONFIG_CPU_SUBTYPE_SH7786) || \
185 defined(CONFIG_CPU_SUBTYPE_SHX3) 187 defined(CONFIG_CPU_SUBTYPE_SHX3)
186#define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */ 188#define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */
187#else 189#else
@@ -413,7 +415,8 @@ SCIx_FNS(SCxRDR, 0x0a, 8, 0x14, 8, 0x0A, 8, 0x14, 8, 0x05, 8)
413SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16) 415SCIF_FNS(SCFCR, 0x0c, 8, 0x18, 16)
414#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \ 416#if defined(CONFIG_CPU_SUBTYPE_SH7760) || \
415 defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 417 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
416 defined(CONFIG_CPU_SUBTYPE_SH7785) 418 defined(CONFIG_CPU_SUBTYPE_SH7785) || \
419 defined(CONFIG_CPU_SUBTYPE_SH7786)
417SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16) 420SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16)
418SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16) 421SCIF_FNS(SCTFDR, 0x0e, 16, 0x1C, 16)
419SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16) 422SCIF_FNS(SCRFDR, 0x0e, 16, 0x20, 16)
@@ -644,7 +647,8 @@ static inline int sci_rxd_in(struct uart_port *port)
644 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */ 647 return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; /* SCIF */
645 return 1; 648 return 1;
646} 649}
647#elif defined(CONFIG_CPU_SUBTYPE_SH7785) 650#elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \
651 defined(CONFIG_CPU_SUBTYPE_SH7786)
648static inline int sci_rxd_in(struct uart_port *port) 652static inline int sci_rxd_in(struct uart_port *port)
649{ 653{
650 if (port->mapbase == 0xffea0000) 654 if (port->mapbase == 0xffea0000)
@@ -746,7 +750,8 @@ static inline int sci_rxd_in(struct uart_port *port)
746 */ 750 */
747 751
748#if defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 752#if defined(CONFIG_CPU_SUBTYPE_SH7780) || \
749 defined(CONFIG_CPU_SUBTYPE_SH7785) 753 defined(CONFIG_CPU_SUBTYPE_SH7785) || \
754 defined(CONFIG_CPU_SUBTYPE_SH7786)
750#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1) 755#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1)
751#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 756#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
752 defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 757 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 45a299f35617..e09d3cebb4fb 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1438,12 +1438,12 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
1438 } else { 1438 } else {
1439 printk(KERN_INFO "%s: Keyboard at MMIO 0x%llx (irq = %d) " 1439 printk(KERN_INFO "%s: Keyboard at MMIO 0x%llx (irq = %d) "
1440 "is a %s\n", 1440 "is a %s\n",
1441 op->dev.bus_id, 1441 dev_name(&op->dev),
1442 (unsigned long long) up[0].port.mapbase, 1442 (unsigned long long) up[0].port.mapbase,
1443 op->irqs[0], sunzilog_type(&up[0].port)); 1443 op->irqs[0], sunzilog_type(&up[0].port));
1444 printk(KERN_INFO "%s: Mouse at MMIO 0x%llx (irq = %d) " 1444 printk(KERN_INFO "%s: Mouse at MMIO 0x%llx (irq = %d) "
1445 "is a %s\n", 1445 "is a %s\n",
1446 op->dev.bus_id, 1446 dev_name(&op->dev),
1447 (unsigned long long) up[1].port.mapbase, 1447 (unsigned long long) up[1].port.mapbase,
1448 op->irqs[0], sunzilog_type(&up[1].port)); 1448 op->irqs[0], sunzilog_type(&up[1].port));
1449 kbm_inst++; 1449 kbm_inst++;