diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-07-22 16:57:38 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-07-22 16:57:38 -0700 |
| commit | 6bbbb136e761db39158852c9b42619c2438e9d45 (patch) | |
| tree | 4b48eba7be3ba0e7ffbddc0fee4988d26623099a /tty | |
| parent | 5caca10b163e38f1671c4be83c480581da4d90d6 (diff) | |
| download | patches-6bbbb136e761db39158852c9b42619c2438e9d45.tar.gz | |
lots of patches
Diffstat (limited to 'tty')
9 files changed, 942 insertions, 0 deletions
diff --git a/tty/serial-68328serial.c-remove-dead-alma_ans-dragonixvz-m68ez328ads.patch b/tty/serial-68328serial.c-remove-dead-alma_ans-dragonixvz-m68ez328ads.patch new file mode 100644 index 00000000000000..51005db027d2bc --- /dev/null +++ b/tty/serial-68328serial.c-remove-dead-alma_ans-dragonixvz-m68ez328ads.patch @@ -0,0 +1,50 @@ +From: Christoph Egger <siccegge@cs.fau.de> +Message-Id: <201007202226.o6KMQsmU021541@imap1.linux-foundation.org> +Subject: serial: 68328serial.c: remove dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS) +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, akpm@linux-foundation.org, + siccegge@cs.fau.de, gerg@uclinux.org +From: akpm@linux-foundation.org +Date: Tue, 20 Jul 2010 15:26:54 -0700 + +From: Christoph Egger <siccegge@cs.fau.de> + +(ALMA_ANS | DRAGONIXVZ | M68EZ328ADS) doesn't exist in Kconfig, therefore +remove all references to it from the source code. + +Signed-off-by: Christoph Egger <siccegge@cs.fau.de> +Acked-by: Greg Ungerer <gerg@uclinux.org> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/68328serial.c | 16 +++++----------- + 1 file changed, 5 insertions(+), 11 deletions(-) + +--- a/drivers/serial/68328serial.c ++++ b/drivers/serial/68328serial.c +@@ -98,19 +98,13 @@ static void change_speed(struct m68k_ser + * Setup for console. Argument comes from the boot command line. + */ + +-#if defined(CONFIG_M68EZ328ADS) || defined(CONFIG_ALMA_ANS) || defined(CONFIG_DRAGONIXVZ) +-#define CONSOLE_BAUD_RATE 115200 +-#define DEFAULT_CBAUD B115200 +-#else +- /* (es) */ +- /* note: this is messy, but it works, again, perhaps defined somewhere else?*/ +- #ifdef CONFIG_M68VZ328 +- #define CONSOLE_BAUD_RATE 19200 +- #define DEFAULT_CBAUD B19200 +- #endif +- /* (/es) */ ++/* note: this is messy, but it works, again, perhaps defined somewhere else?*/ ++#ifdef CONFIG_M68VZ328 ++#define CONSOLE_BAUD_RATE 19200 ++#define DEFAULT_CBAUD B19200 + #endif + ++ + #ifndef CONSOLE_BAUD_RATE + #define CONSOLE_BAUD_RATE 9600 + #define DEFAULT_CBAUD B9600 diff --git a/tty/serial-altera_uart-simplify-altera_uart_console_putc-checkpatch-fixes.patch b/tty/serial-altera_uart-simplify-altera_uart_console_putc-checkpatch-fixes.patch new file mode 100644 index 00000000000000..846ab53462ce74 --- /dev/null +++ b/tty/serial-altera_uart-simplify-altera_uart_console_putc-checkpatch-fixes.patch @@ -0,0 +1,47 @@ +From akpm@linux-foundation.org Thu Jul 22 15:54:30 2010 +Message-Id: <201007202226.o6KMQAWX021501@imap1.linux-foundation.org> +Subject: serial: "altera_uart: simplify altera_uart_console_putc()" checkpatch fixes +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, akpm@linux-foundation.org, + tklauser@distanz.ch +From: akpm@linux-foundation.org +Date: Tue, 20 Jul 2010 15:26:10 -0700 + +From: Andrew Morton <akpm@linux-foundation.org> + +ERROR: code indent should use tabs where possible +#32: FILE: drivers/serial/altera_uart.c:397: ++^I ALTERA_UART_STATUS_TRDY_MSK))$ + +total: 1 errors, 0 warnings, 39 lines checked + +./patches/altera_uart-simplify-altera_uart_console_putc.patch has style problems, please review. If any of these errors +are false positives report them to the maintainer, see +CHECKPATCH in MAINTAINERS. + +Please run checkpatch prior to sending patches + + +This fix got lost when someone merged "altera_uart: simplify +altera_uart_console_putc()". Please don't lose fixes. Please don't write +of mere patches which have trivial checkpatch errors. + +Cc: Tobias Klauser <tklauser@distanz.ch> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/altera_uart.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/serial/altera_uart.c ++++ b/drivers/serial/altera_uart.c +@@ -394,7 +394,7 @@ int __init early_altera_uart_setup(struc + static void altera_uart_console_putc(struct uart_port *port, const char c) + { + while (!(readl(port->membase + ALTERA_UART_STATUS_REG) & +- ALTERA_UART_STATUS_TRDY_MSK)) ++ ALTERA_UART_STATUS_TRDY_MSK)) + cpu_relax(); + + writel(c, port->membase + ALTERA_UART_TXDATA_REG); diff --git a/tty/serial-crisv10-formatting-of-pointers-in-printk.patch b/tty/serial-crisv10-formatting-of-pointers-in-printk.patch new file mode 100644 index 00000000000000..39b33064f9d73b --- /dev/null +++ b/tty/serial-crisv10-formatting-of-pointers-in-printk.patch @@ -0,0 +1,33 @@ +From segooon@gmail.com Thu Jul 22 15:52:47 2010 +From: Kulikov Vasiliy <segooon@gmail.com> +To: kernel-janitors@vger.kernel.org +Cc: Greg Kroah-Hartman <gregkh@suse.de>, + Arnd Bergmann <arnd@arndb.de>, + Jesper Nilsson <jesper.nilsson@axis.com>, + Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org +Subject: serial: crisv10: formatting of pointers in printk() +Date: Wed, 14 Jul 2010 22:04:42 +0400 +Message-Id: <1279130682-13704-1-git-send-email-segooon@gmail.com> + +Use %p instead of %08x in printk(). + +Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/crisv10.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/serial/crisv10.c ++++ b/drivers/serial/crisv10.c +@@ -4522,8 +4522,8 @@ static int __init rs_init(void) + INIT_WORK(&info->work, do_softint); + + if (info->enabled) { +- printk(KERN_INFO "%s%d at 0x%x is a builtin UART with DMA\n", +- serial_driver->name, info->line, (unsigned int)info->ioport); ++ printk(KERN_INFO "%s%d at %p is a builtin UART with DMA\n", ++ serial_driver->name, info->line, info->ioport); + } + } + #ifdef CONFIG_ETRAX_FAST_TIMER diff --git a/tty/serial-fix-missing-bit-coverage-of-async_flags.patch b/tty/serial-fix-missing-bit-coverage-of-async_flags.patch new file mode 100644 index 00000000000000..37606cd57df538 --- /dev/null +++ b/tty/serial-fix-missing-bit-coverage-of-async_flags.patch @@ -0,0 +1,52 @@ +From akpm@linux-foundation.org Thu Jul 22 15:55:03 2010 +Message-Id: <201007202226.o6KMQkLd021523@imap1.linux-foundation.org> +Subject: serial: fix missing bit coverage of ASYNC_FLAGS +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, akpm@linux-foundation.org, + jvillalo@redhat.com, alan@lxorguk.ukuu.org.uk, + john.l.villalovos@intel.com +From: akpm@linux-foundation.org +Date: Tue, 20 Jul 2010 15:26:46 -0700 + +From: John Villalovos <jvillalo@redhat.com> + +It seems that currently ASYNC_FLAGS is one bit short of covering all the +bits of the ASYNC user flags. In particular it does not cover the +ASYNC_AUTOPROBE bit. + +ASYNCB_LAST_USER and ASYNCB_AUTOPROBE are both equal to 15. + +Therefore: +ASYNC_AUTOPROBE = 1000 0000 0000 0000 +ASYNC_FLAGS = 0111 1111 1111 1111 + +So ASYNC_FLAGS is not covering the ASYNC_AUTOPROBE bit. + +This patch fixes the issue and with the patch the values will be: +ASYNC_AUTOPROBE = 1000 0000 0000 0000 +ASYNC_FLAGS = 1111 1111 1111 1111 + +As a side note, doing a "git grep" I didn't find any use of +ASYNC_AUTOPROBE or ASYNCB_AUTOPROBE in the kernel, besides this include +file. + +Signed-off-by: John Villalovos <john.l.villalovos@intel.com> +Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + include/linux/serial.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/serial.h ++++ b/include/linux/serial.h +@@ -151,7 +151,7 @@ struct serial_uart_config { + #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) + #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) + +-#define ASYNC_FLAGS ((1U << ASYNCB_LAST_USER) - 1) ++#define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1) + #define ASYNC_USR_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI| \ + ASYNC_CALLOUT_NOHUP|ASYNC_SPD_SHI|ASYNC_LOW_LATENCY) + #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) diff --git a/tty/serial-general-fixes-in-the-serial_rs485-structure.patch b/tty/serial-general-fixes-in-the-serial_rs485-structure.patch new file mode 100644 index 00000000000000..667d3d66f4baac --- /dev/null +++ b/tty/serial-general-fixes-in-the-serial_rs485-structure.patch @@ -0,0 +1,83 @@ +From akpm@linux-foundation.org Thu Jul 22 15:55:22 2010 +Message-Id: <201007202226.o6KMQl2n021527@imap1.linux-foundation.org> +Subject: serial: general fixes in the serial_rs485 structure +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, akpm@linux-foundation.org, + claudio@evidence.eu.com, alan@lxorguk.ukuu.org.uk, br@pwrnet.de, + phdm@macqel.be +From: akpm@linux-foundation.org +Date: Tue, 20 Jul 2010 15:26:47 -0700 + +From: Claudio Scordino <claudio@evidence.eu.com> + +Fix several issues related to the RS485 interface: + + - It adds the flag SER_RS485_RTS_BEFORE_SEND that was missing from the + serial_rs485 structure (even if "delay_rts_before_send" was existing) + + - It adds a further "delay_rts_after_send" field for those drivers that + can have a delay after send (e.g., atmel_serial) + + - It fixes the usage of the structure in the atmel_serial driver (where + "delay_rts_before_send" should be used instead of "delay_rts_after_send"). + +Signed-off-by: Claudio Scordino <claudio@evidence.eu.com> +Signed-off-by: Bernhard Roth <br@pwrnet.de> +Cc: Philippe De Muyter <phdm@macqel.be> +Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/atmel_serial.c | 11 ++++++++--- + include/linux/serial.h | 4 +++- + 2 files changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/serial/atmel_serial.c ++++ b/drivers/serial/atmel_serial.c +@@ -217,7 +217,8 @@ void atmel_config_rs485(struct uart_port + if (rs485conf->flags & SER_RS485_ENABLED) { + dev_dbg(port->dev, "Setting UART to RS485\n"); + atmel_port->tx_done_mask = ATMEL_US_TXEMPTY; +- UART_PUT_TTGR(port, rs485conf->delay_rts_before_send); ++ if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND) ++ UART_PUT_TTGR(port, rs485conf->delay_rts_after_send); + mode |= ATMEL_US_USMODE_RS485; + } else { + dev_dbg(port->dev, "Setting UART to RS232\n"); +@@ -292,7 +293,9 @@ static void atmel_set_mctrl(struct uart_ + + if (atmel_port->rs485.flags & SER_RS485_ENABLED) { + dev_dbg(port->dev, "Setting UART to RS485\n"); +- UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send); ++ if (atmel_port->rs485.flags & SER_RS485_RTS_AFTER_SEND) ++ UART_PUT_TTGR(port, ++ atmel_port->rs485.delay_rts_after_send); + mode |= ATMEL_US_USMODE_RS485; + } else { + dev_dbg(port->dev, "Setting UART to RS232\n"); +@@ -1211,7 +1214,9 @@ static void atmel_set_termios(struct uar + + if (atmel_port->rs485.flags & SER_RS485_ENABLED) { + dev_dbg(port->dev, "Setting UART to RS485\n"); +- UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send); ++ if (atmel_port->rs485.flags & SER_RS485_RTS_AFTER_SEND) ++ UART_PUT_TTGR(port, ++ atmel_port->rs485.delay_rts_after_send); + mode |= ATMEL_US_USMODE_RS485; + } else { + dev_dbg(port->dev, "Setting UART to RS232\n"); +--- a/include/linux/serial.h ++++ b/include/linux/serial.h +@@ -210,8 +210,10 @@ struct serial_rs485 { + #define SER_RS485_ENABLED (1 << 0) + #define SER_RS485_RTS_ON_SEND (1 << 1) + #define SER_RS485_RTS_AFTER_SEND (1 << 2) ++#define SER_RS485_RTS_BEFORE_SEND (1 << 3) + __u32 delay_rts_before_send; /* Milliseconds */ +- __u32 padding[6]; /* Memory is cheap, new structs ++ __u32 delay_rts_after_send; /* Milliseconds */ ++ __u32 padding[5]; /* Memory is cheap, new structs + are a royal PITA .. */ + }; + diff --git a/tty/serial-mcf-don-t-take-spinlocks-in-already-protected-functions.patch b/tty/serial-mcf-don-t-take-spinlocks-in-already-protected-functions.patch new file mode 100644 index 00000000000000..4694b7fd29b273 --- /dev/null +++ b/tty/serial-mcf-don-t-take-spinlocks-in-already-protected-functions.patch @@ -0,0 +1,133 @@ +From akpm@linux-foundation.org Thu Jul 22 15:55:47 2010 +Message-Id: <201007202226.o6KMQpNm021530@imap1.linux-foundation.org> +Subject: serial: mcf: don't take spinlocks in already protected functions +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, akpm@linux-foundation.org, + ygeorgie@gmail.com, alan@lxorguk.ukuu.org.uk, gerg@uclinux.org +From: akpm@linux-foundation.org +Date: Tue, 20 Jul 2010 15:26:50 -0700 + +From: Yury Georgievskiy <ygeorgie@gmail.com> + +Don't take the port spinlock in uart functions where the serial core +already takes care of locking/unlocking them. + +The code would actually lock up on architectures where spinlocks are +implemented. + +Also protect calling mcf_rx_chars/mcf_tx_chars in the interrupt handler by +the port spinlock and use IRQ_RETVAL to return from isr. + +[akpm@linux-foundation.org: make irq-handler return value more explicit] +Signed-off-by: Yury Georgievskiy <ygeorgie@gmail.com> +Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> +Acked-by: Greg Ungerer <gerg@uclinux.org> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/mcf.c | 31 +++++++++++++------------------ + 1 file changed, 13 insertions(+), 18 deletions(-) + +--- a/drivers/serial/mcf.c ++++ b/drivers/serial/mcf.c +@@ -70,16 +70,14 @@ static unsigned int mcf_tx_empty(struct + static unsigned int mcf_get_mctrl(struct uart_port *port) + { + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); +- unsigned long flags; + unsigned int sigs; + +- spin_lock_irqsave(&port->lock, flags); + sigs = (readb(port->membase + MCFUART_UIPR) & MCFUART_UIPR_CTS) ? + 0 : TIOCM_CTS; + sigs |= (pp->sigs & TIOCM_RTS); + sigs |= (mcf_getppdcd(port->line) ? TIOCM_CD : 0); + sigs |= (mcf_getppdtr(port->line) ? TIOCM_DTR : 0); +- spin_unlock_irqrestore(&port->lock, flags); ++ + return sigs; + } + +@@ -88,16 +86,13 @@ static unsigned int mcf_get_mctrl(struct + static void mcf_set_mctrl(struct uart_port *port, unsigned int sigs) + { + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); +- unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); + pp->sigs = sigs; + mcf_setppdtr(port->line, (sigs & TIOCM_DTR)); + if (sigs & TIOCM_RTS) + writeb(MCFUART_UOP_RTS, port->membase + MCFUART_UOP1); + else + writeb(MCFUART_UOP_RTS, port->membase + MCFUART_UOP0); +- spin_unlock_irqrestore(&port->lock, flags); + } + + /****************************************************************************/ +@@ -105,12 +100,9 @@ static void mcf_set_mctrl(struct uart_po + static void mcf_start_tx(struct uart_port *port) + { + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); +- unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); + pp->imr |= MCFUART_UIR_TXREADY; + writeb(pp->imr, port->membase + MCFUART_UIMR); +- spin_unlock_irqrestore(&port->lock, flags); + } + + /****************************************************************************/ +@@ -118,12 +110,9 @@ static void mcf_start_tx(struct uart_por + static void mcf_stop_tx(struct uart_port *port) + { + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); +- unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); + pp->imr &= ~MCFUART_UIR_TXREADY; + writeb(pp->imr, port->membase + MCFUART_UIMR); +- spin_unlock_irqrestore(&port->lock, flags); + } + + /****************************************************************************/ +@@ -131,12 +120,9 @@ static void mcf_stop_tx(struct uart_port + static void mcf_stop_rx(struct uart_port *port) + { + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); +- unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); + pp->imr &= ~MCFUART_UIR_RXREADY; + writeb(pp->imr, port->membase + MCFUART_UIMR); +- spin_unlock_irqrestore(&port->lock, flags); + } + + /****************************************************************************/ +@@ -366,13 +352,22 @@ static irqreturn_t mcf_interrupt(int irq + struct uart_port *port = data; + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); + unsigned int isr; ++ irqreturn_t ret = IRQ_NONE; + + isr = readb(port->membase + MCFUART_UISR) & pp->imr; +- if (isr & MCFUART_UIR_RXREADY) ++ ++ spin_lock(&port->lock); ++ if (isr & MCFUART_UIR_RXREADY) { + mcf_rx_chars(pp); +- if (isr & MCFUART_UIR_TXREADY) ++ ret = IRQ_HANDLED; ++ } ++ if (isr & MCFUART_UIR_TXREADY) { + mcf_tx_chars(pp); +- return IRQ_HANDLED; ++ ret = IRQ_HANDLED; ++ } ++ spin_unlock(&port->lock); ++ ++ return ret; + } + + /****************************************************************************/ diff --git a/tty/serial-mmio32-support-for-8250_early.c.patch b/tty/serial-mmio32-support-for-8250_early.c.patch new file mode 100644 index 00000000000000..541cbe1379c14a --- /dev/null +++ b/tty/serial-mmio32-support-for-8250_early.c.patch @@ -0,0 +1,154 @@ +From akpm@linux-foundation.org Thu Jul 22 15:56:05 2010 +Message-Id: <201007202226.o6KMQpFh021533@imap1.linux-foundation.org> +Subject: serial: MMIO32 support for 8250_early.c +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, akpm@linux-foundation.org, + _deepfire@feelingofgreen.ru, kosaki.motohiro@jp.fujitsu.com, + randy.dunlap@oracle.com +From: akpm@linux-foundation.org +Date: Tue, 20 Jul 2010 15:26:51 -0700 + +From: Samium Gromoff <_deepfire@feelingofgreen.ru> + +Provide MMIO32 support in 8250_early (aka earlycon) + +[randy.dunlap@oracle.com: fix printk format warnings] +[akpm@linux-foundation.org: fix printk args some more] +Signed-off-by: Samium Gromoff <_deepfire@feelingofgreen.ru> +Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> +Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/kernel-parameters.txt | 3 + + drivers/serial/8250_early.c | 57 ++++++++++++++++++++++++++---------- + 2 files changed, 45 insertions(+), 15 deletions(-) + +--- a/Documentation/kernel-parameters.txt ++++ b/Documentation/kernel-parameters.txt +@@ -686,8 +686,11 @@ and is between 256 and 4096 characters. + earlycon= [KNL] Output early console device and options. + uart[8250],io,<addr>[,options] + uart[8250],mmio,<addr>[,options] ++ uart[8250],mmio32,<addr>[,options] + Start an early, polled-mode console on the 8250/16550 + UART at the specified I/O port or MMIO address. ++ MMIO inter-register address stride is either 8bit (mmio) ++ or 32bit (mmio32). + The options are the same as for ttyS, above. + + earlyprintk= [X86,SH,BLACKFIN] +--- a/drivers/serial/8250_early.c ++++ b/drivers/serial/8250_early.c +@@ -19,9 +19,11 @@ + * The user can specify the device directly, e.g., + * earlycon=uart8250,io,0x3f8,9600n8 + * earlycon=uart8250,mmio,0xff5e0000,115200n8 ++ * earlycon=uart8250,mmio32,0xff5e0000,115200n8 + * or + * console=uart8250,io,0x3f8,9600n8 + * console=uart8250,mmio,0xff5e0000,115200n8 ++ * console=uart8250,mmio32,0xff5e0000,115200n8 + */ + + #include <linux/tty.h> +@@ -48,18 +50,31 @@ static struct early_serial8250_device ea + + static unsigned int __init serial_in(struct uart_port *port, int offset) + { +- if (port->iotype == UPIO_MEM) ++ switch (port->iotype) { ++ case UPIO_MEM: + return readb(port->membase + offset); +- else ++ case UPIO_MEM32: ++ return readl(port->membase + (offset << 2)); ++ case UPIO_PORT: + return inb(port->iobase + offset); ++ default: ++ return 0; ++ } + } + + static void __init serial_out(struct uart_port *port, int offset, int value) + { +- if (port->iotype == UPIO_MEM) ++ switch (port->iotype) { ++ case UPIO_MEM: + writeb(value, port->membase + offset); +- else ++ break; ++ case UPIO_MEM32: ++ writel(value, port->membase + (offset << 2)); ++ break; ++ case UPIO_PORT: + outb(value, port->iobase + offset); ++ break; ++ } + } + + #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) +@@ -137,15 +152,21 @@ static int __init parse_options(struct e + char *options) + { + struct uart_port *port = &device->port; +- int mmio, length; ++ int mmio, mmio32, length; + + if (!options) + return -ENODEV; + + port->uartclk = BASE_BAUD * 16; +- if (!strncmp(options, "mmio,", 5)) { +- port->iotype = UPIO_MEM; +- port->mapbase = simple_strtoul(options + 5, &options, 0); ++ ++ mmio = !strncmp(options, "mmio,", 5); ++ mmio32 = !strncmp(options, "mmio32,", 7); ++ if (mmio || mmio32) { ++ port->iotype = (mmio ? UPIO_MEM : UPIO_MEM32); ++ port->mapbase = simple_strtoul(options + (mmio ? 5 : 7), ++ &options, 0); ++ if (mmio32) ++ port->regshift = 2; + #ifdef CONFIG_FIX_EARLYCON_MEM + set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, + port->mapbase & PAGE_MASK); +@@ -157,11 +178,10 @@ static int __init parse_options(struct e + if (!port->membase) { + printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n", + __func__, +- (unsigned long long)port->mapbase); ++ (unsigned long long) port->mapbase); + return -ENOMEM; + } + #endif +- mmio = 1; + } else if (!strncmp(options, "io,", 3)) { + port->iotype = UPIO_PORT; + port->iobase = simple_strtoul(options + 3, &options, 0); +@@ -181,11 +201,18 @@ static int __init parse_options(struct e + device->baud); + } + +- printk(KERN_INFO "Early serial console at %s 0x%llx (options '%s')\n", +- mmio ? "MMIO" : "I/O port", +- mmio ? (unsigned long long) port->mapbase +- : (unsigned long long) port->iobase, +- device->options); ++ if (mmio || mmio32) ++ printk(KERN_INFO ++ "Early serial console at MMIO%s 0x%llu (options '%s')\n", ++ mmio32 ? "32" : "", ++ (unsigned long long)port->mapbase, ++ device->options); ++ else ++ printk(KERN_INFO ++ "Early serial console at I/O port 0x%lu (options '%s')\n", ++ port->iobase, ++ device->options); ++ + return 0; + } + diff --git a/tty/timbuart-use-__devinit-and-__devexit-macros-for-probe-and-remove.patch b/tty/timbuart-use-__devinit-and-__devexit-macros-for-probe-and-remove.patch new file mode 100644 index 00000000000000..eb14dfe2e99d3e --- /dev/null +++ b/tty/timbuart-use-__devinit-and-__devexit-macros-for-probe-and-remove.patch @@ -0,0 +1,50 @@ +From: Richard R�jfors <richard.rojfors@pelagicore.com> +Message-Id: <201007202226.o6KMQrG8021538@imap1.linux-foundation.org> +Subject: timbuart: use __devinit and __devexit macros for probe and remove +To: greg@kroah.com +Cc: linux-serial@vger.kernel.org, akpm@linux-foundation.org, + richard.rojfors@pelagicore.com +From: akpm@linux-foundation.org +Date: Tue, 20 Jul 2010 15:26:53 -0700 + +From: Richard R�jfors <richard.rojfors@pelagicore.com> + +Move the probe and remove functions to the devinit and devexit sections. + +Signed-off-by: Richard R�jfors <richard.rojfors@pelagicore.com> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/timbuart.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/serial/timbuart.c ++++ b/drivers/serial/timbuart.c +@@ -423,7 +423,7 @@ static struct uart_driver timbuart_drive + .nr = 1 + }; + +-static int timbuart_probe(struct platform_device *dev) ++static int __devinit timbuart_probe(struct platform_device *dev) + { + int err, irq; + struct timbuart_port *uart; +@@ -489,7 +489,7 @@ err_mem: + return err; + } + +-static int timbuart_remove(struct platform_device *dev) ++static int __devexit timbuart_remove(struct platform_device *dev) + { + struct timbuart_port *uart = platform_get_drvdata(dev); + +@@ -507,7 +507,7 @@ static struct platform_driver timbuart_p + .owner = THIS_MODULE, + }, + .probe = timbuart_probe, +- .remove = timbuart_remove, ++ .remove = __devexit_p(timbuart_remove), + }; + + /*--------------------------------------------------------------------------*/ diff --git a/tty/u6715-8250-serial-like-driver.patch b/tty/u6715-8250-serial-like-driver.patch new file mode 100644 index 00000000000000..a6a45bd69f9ee5 --- /dev/null +++ b/tty/u6715-8250-serial-like-driver.patch @@ -0,0 +1,340 @@ +From philippe.langlais@stericsson.com Thu Jul 22 15:53:24 2010 +From: Philippe Langlais <philippe.langlais@stericsson.com> +To: <linux-kernel@vger.kernel.org> +Cc: <gregkh@suse.de>, <ludovic.barre@stericsson.com>, + Philippe Langlais <philippe.langlais@stericsson.com> +Subject: U6715 8250 serial like driver +Date: Mon, 19 Jul 2010 11:27:40 +0200 +Message-ID: <1279531660-16317-1-git-send-email-philippe.langlais@stericsson.com> + +UART Features extract from STEricsson U6715 datasheet (arm926 SoC for mobile phone): +* Fully compatible with industry standard 16C550 and 16C450 from various +manufacturers +* RX and TX 64 byte FIFO reduces CPU interrupts +* Full double buffering +* Modem control signals include CTS, RTS, (and DSR, DTR on UART1 only) +* Automatic baud rate selection +* Manual or automatic RTS/CTS smart hardware flow control +* Programmable serial characteristics: +– Baud rate generation (50 to 3.25M baud) +– 5, 6, 7 or 8-bit characters +– Even, odd or no-parity bit generation and detection +– 1, 1.5 or 2 stop bit generation +* Independent control of transmit, receive, line status, data set interrupts and FIFOs +* Full status-reporting capabilities +* Separate DMA signalling for RX and TX +* Timed interrupt to spread receive interrupt on known duration +* DMA time-out interrupt to allow detection of end of reception +* Carkit pulse coding and decoding compliant with USB carkit control interface [40] + +This UART IP is auto-detected as a 16550A type + +Clock specificities: + It's parent clock depend on baud rate. + The UART port can be used before u6xxx clock framework initialization + +Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/8250.c | 26 ++++++ + drivers/serial/8250_u6.c | 179 ++++++++++++++++++++++++++++++++++++++++++++ + drivers/serial/Kconfig | 19 ++++ + drivers/serial/Makefile | 1 + include/linux/serial_8250.h | 8 + + 5 files changed, 232 insertions(+), 1 deletion(-) + +--- a/drivers/serial/8250.c ++++ b/drivers/serial/8250.c +@@ -199,10 +199,16 @@ static const struct serial8250_config ua + }, + [PORT_16550A] = { + .name = "16550A", ++#if defined(CONFIG_SERIAL_8250_U6XXX) ++ .fifo_size = 64, ++ .tx_loadsz = 64, ++ .flags = UART_CAP_FIFO | UART_CAP_AFE, ++#else + .fifo_size = 16, + .tx_loadsz = 16, +- .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, + .flags = UART_CAP_FIFO, ++#endif ++ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, + }, + [PORT_CIRRUS] = { + .name = "Cirrus", +@@ -2268,6 +2274,13 @@ serial8250_set_termios(struct uart_port + /* + * Ask the core to calculate the divisor for us. + */ ++#ifdef CONFIG_SERIAL_8250_CUSTOM_CLOCK ++ baud = uart_get_baud_rate(port, termios, old, 0, ++ CONFIG_SERIAL_8250_CUSTOM_MAX_BAUDRATE); ++ /* Calculate the new uart clock frequency if it is tunable */ ++ port->uartclk = serial8250_get_custom_clock(port, baud); ++#endif ++ + baud = uart_get_baud_rate(port, termios, old, + port->uartclk / 16 / 0xffff, + port->uartclk / 16); +@@ -2298,6 +2311,13 @@ serial8250_set_termios(struct uart_port + up->mcr &= ~UART_MCR_AFE; + if (termios->c_cflag & CRTSCTS) + up->mcr |= UART_MCR_AFE; ++#if defined(CONFIG_SERIAL_8250_U6XXX) ++ /** ++ * When AFE is active, let the HW handle the stop/restart TX ++ * upon CTS change. It reacts much quicker than the SW driver. ++ */ ++ port->flags &= ~ASYNC_CTS_FLOW; ++#endif + } + + /* +@@ -2383,6 +2403,10 @@ serial8250_set_termios(struct uart_port + serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ + } + ++#ifdef CONFIG_SERIAL_8250_CUSTOM_CLOCK ++ /* set the new uart clock frequency if it is tunable */ ++ serial8250_set_custom_clock(port); ++#endif + serial_dl_write(up, quot); + + /* +--- /dev/null ++++ b/drivers/serial/8250_u6.c +@@ -0,0 +1,179 @@ ++/* ++ * linux/drivers/serial/8250_pnx.c ++ * ++ * Copyright (C) ST-Ericsson SA 2010 ++ * Author: Ludovic Barre <ludovic.barre@stericsson.com> for ST-Ericsson. ++ * License terms: GNU General Public License (GPL), version 2 ++ */ ++ ++#include <linux/serial_core.h> ++#include <linux/io.h> ++#include <linux/clk.h> ++#include <linux/interrupt.h> ++#include <linux/irq.h> ++ ++#include <mach/serial.h> ++#include <mach/hardware.h> ++#include <mach/clock.h> ++ ++/* Register description for FDIV_CTRL */ ++/* UART FDIV_CTRL Register (8 bits) */ ++#define UARTX_FDIV_CTRL_OFFSET 0xC00 ++/* UART FDIV_M Register (16 bits) */ ++#define UARTX_FDIV_M_OFFSET 0xC04 ++/* UART FDIV_N Register (16 bits) */ ++#define UARTX_FDIV_N_OFFSET 0xC08 ++ ++/* Bits definition for register UARTX_FDIV_CTRL */ ++#define UARTX_FDIV_ENABLE_SHIFT 7 ++#define UARTX_FDIV_ENABLE_FIELD (0xFFFFFFFF - (0x1UL<<UARTX_FDIV_ENABLE_SHIFT)) ++#define UARTX_FDIV_ENABLE_OFF (0x0UL<<UARTX_FDIV_ENABLE_SHIFT) ++#define UARTX_FDIV_ENABLE_ON (0x1UL<<UARTX_FDIV_ENABLE_SHIFT) ++#define UARTX_FDIV_ENABLE (0x1UL<<UARTX_FDIV_ENABLE_SHIFT) ++#define UARTX_CLKSEL_SHIFT 0 ++#define UARTX_CLKSEL_FIELD (0xFFFFFFFF - (0x3UL<<UARTX_CLKSEL_SHIFT)) ++#define UARTX_CLKSEL_PCLK (0x0UL<<UARTX_CLKSEL_SHIFT) ++#define UARTX_CLKSEL_13M (0x1UL<<UARTX_CLKSEL_SHIFT) ++#define UARTX_CLKSEL_26M (0x2UL<<UARTX_CLKSEL_SHIFT) ++#define UARTX_CLKSEL_3 (0x3UL<<UARTX_CLKSEL_SHIFT) ++ ++/* ++ * console and pctools has needed to start before serial_init ++ * (with cgu interface) ++ */ ++static int uart_enable_clock(struct uart_port *port) ++{ ++ u32 v; ++ v = readl(CGU_GATESC1_REG); ++ ++ if (port->irq == IRQ_UART1) ++ v |= CGU_UART1EN_1; ++ else if (port->irq == IRQ_UART2) ++ v |= CGU_UART2EN_1; ++ ++ writel(v, CGU_GATESC1_REG); ++ ++ return 0; ++} ++ ++static int uart_disable_clock(struct uart_port *port) ++{ ++ u32 v; ++ v = readl(CGU_GATESC1_REG); ++ ++ if (port->irq == IRQ_UART1) ++ v &= ~CGU_UART1EN_0; ++ else if (port->irq == IRQ_UART2) ++ v &= ~CGU_UART2EN_0; ++ ++ writel(v, CGU_GATESC1_REG); ++ ++ return 0; ++} ++ ++unsigned int serial8250_enable_clock(struct uart_port *port) ++{ ++ struct u6_uart *uart_u6 = port->private_data; ++ ++ if (!uart_u6) ++ return uart_enable_clock(port); ++ ++ if (IS_ERR(uart_u6->uartClk)) { ++ printk(KERN_WARNING "%s - uart clock failed error:%ld\n", ++ __func__, PTR_ERR(uart_u6->uartClk)); ++ return PTR_ERR(uart_u6->uartClk); ++ } ++ ++ if (clk_get_usecount(uart_u6->uartClk) == 0) ++ clk_enable(uart_u6->uartClk); ++ return 0; ++} ++ ++unsigned int serial8250_disable_clock(struct uart_port *port) ++{ ++ struct u6_uart *uart_u6 = port->private_data; ++ ++ if (!uart_u6) ++ return uart_disable_clock(port); ++ ++ if (IS_ERR(uart_u6->uartClk)) { ++ printk(KERN_WARNING "%s - uart clk error :%ld\n", __func__, ++ PTR_ERR(uart_u6->uartClk)); ++ return PTR_ERR(uart_u6->uartClk); ++ } ++ if (clk_get_usecount(uart_u6->uartClk) >= 1) ++ clk_disable(uart_u6->uartClk); ++ ++ return 0; ++} ++ ++unsigned int serial8250_get_custom_clock(struct uart_port *port, ++ unsigned int baud) ++{ ++ switch (baud) { ++ case 3250000: ++ return 52000000; ++ case 2000000: ++ return 32000000; ++ case 1843200: ++ return 29491200; ++ case 921600: ++ return 14745600; ++ default: ++ return 7372800; ++ } ++} ++ ++void serial8250_set_custom_clock(struct uart_port *port) ++{ ++ u32 fdiv_m = 0x5F37; ++ u32 fdiv_n = 0x3600; ++ u32 fdiv_ctrl = UARTX_FDIV_ENABLE_ON; ++ struct u6_uart *uart_u6 = port->private_data; ++ ++ switch (port->uartclk) { ++ case 7372800: /* clk=13MHz */ ++ fdiv_ctrl |= UARTX_CLKSEL_13M; ++ break; ++ case 14745600: /* clk=26MHz */ ++ fdiv_ctrl |= UARTX_CLKSEL_26M; ++ break; ++ case 29491200: /* clk=pclk */ ++ fdiv_ctrl |= UARTX_CLKSEL_PCLK; ++ break; ++ case 32000000: /* clk=pclk */ ++ fdiv_n = 0x3A98; ++ fdiv_ctrl |= UARTX_CLKSEL_PCLK; ++ break; ++ case 52000000: /* clk=pclk */ ++ fdiv_n = 0x5F37; ++ fdiv_ctrl |= UARTX_CLKSEL_PCLK; ++ break; ++ } ++ ++ if (uart_u6 != NULL && !IS_ERR(uart_u6->uartClk)) { ++ /* if cgu interface is ready and u6_serial_init */ ++ struct clk *parentClk; ++ ++ if (fdiv_ctrl & UARTX_CLKSEL_26M) ++ parentClk = clk_get(NULL, "clk26m_ck"); ++ else if (fdiv_ctrl & UARTX_CLKSEL_PCLK) ++ parentClk = clk_get(NULL, "pclk2_ck"); ++ else ++ parentClk = clk_get(NULL, "clk13m_ck"); ++ ++ if (!IS_ERR(parentClk)) { ++ serial8250_disable_clock(port); ++ ++ if (clk_set_parent(uart_u6->uartClk, parentClk) != 0) ++ printk(KERN_WARNING "%s: set parent failed\n", __func__); ++ ++ serial8250_enable_clock(port); ++ clk_put(parentClk); ++ } ++ } ++ ++ writel(fdiv_m, port->membase + UARTX_FDIV_M_OFFSET); ++ writel(fdiv_n, port->membase + UARTX_FDIV_N_OFFSET); ++ writel(fdiv_ctrl, port->membase + UARTX_FDIV_CTRL_OFFSET); ++} +--- a/drivers/serial/Kconfig ++++ b/drivers/serial/Kconfig +@@ -163,6 +163,25 @@ config SERIAL_8250_MANY_PORTS + say N here to save some memory. You can also say Y if you have an + "intelligent" multiport card such as Cyclades, Digiboards, etc. + ++config SERIAL_8250_U6XXX ++ bool ++ depends on SERIAL_8250_EXTENDED && PLAT_U6XXX ++ default y ++ ++config SERIAL_8250_CUSTOM_CLOCK ++ bool "Support serial ports with tunable input clock frequency" ++ depends on SERIAL_8250_EXTENDED && SERIAL_8250_U6XXX ++ default y ++ help ++ Say Y here if your platform has specific registers to change UART clock frequency. ++ ++config SERIAL_8250_CUSTOM_MAX_BAUDRATE ++ int "Maximal reachable baudrate" ++ depends on SERIAL_8250_CUSTOM_CLOCK ++ default "3250000" ++ help ++ The value of the maximal reachable baudrate when tuning UART clock frequency (default value: 3.25MBds). ++ + # + # Multi-port serial cards + # +--- a/drivers/serial/Makefile ++++ b/drivers/serial/Makefile +@@ -28,6 +28,7 @@ obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_b + obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o + obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o + obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o ++obj-$(CONFIG_SERIAL_8250_U6XXX) += 8250_u6.o + obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o + obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o + obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o +--- a/include/linux/serial_8250.h ++++ b/include/linux/serial_8250.h +@@ -72,4 +72,12 @@ extern int serial8250_find_port(struct u + extern int serial8250_find_port_for_earlycon(void); + extern int setup_early_serial8250_console(char *cmdline); + ++#ifdef CONFIG_SERIAL_8250_CUSTOM_CLOCK ++unsigned int serial8250_enable_clock(struct uart_port *port); ++unsigned int serial8250_disable_clock(struct uart_port *port); ++unsigned int serial8250_get_custom_clock(struct uart_port *port, ++ unsigned int baud); ++void serial8250_set_custom_clock(struct uart_port *port); ++#endif ++ + #endif |
