Blackfin serial driver Kconfig: depend on DMA not being enabled rather than a specific DMA size
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eaa854902aaeeade4a28cc8987de2b2ce182003b Commit: eaa854902aaeeade4a28cc8987de2b2ce182003b Parent: 1e5b24431b58d821502bb56e67af3e74854feaf2 Author: Mike Frysinger <[EMAIL PROTECTED]> AuthorDate: Sun Oct 21 22:30:01 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Sun Oct 21 22:30:01 2007 +0800 Blackfin serial driver Kconfig: depend on DMA not being enabled rather than a specific DMA size Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- drivers/serial/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 87665d7..ed438bc 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -624,7 +624,7 @@ choice config SERIAL_BFIN_DMA bool "DMA mode" - depends on DMA_UNCACHED_1M && !KGDB_UART + depends on !DMA_UNCACHED_NONE && !KGDB_UART help This driver works under DMA mode. If this option is selected, the blackfin simple dma driver is also enabled. - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Blackfin serial driver: pending a unique anomaly id, tie the break flood issue to ANOMALY_05000230
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bbf275f092b1b2a9bc8a504500ec387f9ddff859 Commit: bbf275f092b1b2a9bc8a504500ec387f9ddff859 Parent: 85a75996edd0e49477cc7c9eb4bac33f02b07685 Author: Mike Frysinger <[EMAIL PROTECTED]> AuthorDate: Sun Aug 5 16:48:08 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Sun Aug 5 16:48:08 2007 +0800 Blackfin serial driver: pending a unique anomaly id, tie the break flood issue to ANOMALY_05000230 pending a unique anomaly id, tie the break flood issue to ANOMALY_05000230 as when that was fixed, the fallout also fixed the break flood Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- drivers/serial/bfin_5xx.c | 43 +-- 1 files changed, 21 insertions(+), 22 deletions(-) diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 3f39e18..6f475b6 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -231,12 +231,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) { struct tty_struct *tty = uart->port.info->tty; unsigned int status, ch, flg; + static int in_break = 0; #ifdef CONFIG_KGDB_UART struct pt_regs *regs = get_irq_regs(); #endif -#ifdef BF533_FAMILY - static int in_break = 0; -#endif status = UART_GET_LSR(uart); ch = UART_GET_CHAR(uart); @@ -262,29 +260,30 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) } } #endif - -#ifdef BF533_FAMILY - /* The BF533 family of processors have a nice misbehavior where -* they continuously generate characters for a "single" break. -* We have to basically ignore this flood until the "next" valid -* character comes across. All other Blackfin families operate -* properly though. -*/ - if (in_break) { - if (ch != 0) { - in_break = 0; - ch = UART_GET_CHAR(uart); - if (bfin_revid() < 5) + + if (ANOMALY_05000230) { + /* The BF533 family of processors have a nice misbehavior where +* they continuously generate characters for a "single" break. +* We have to basically ignore this flood until the "next" valid +* character comes across. All other Blackfin families operate +* properly though. +* Note: While Anomaly 05000230 does not directly address this, +* the changes that went in for it also fixed this issue. +*/ + if (in_break) { + if (ch != 0) { + in_break = 0; + ch = UART_GET_CHAR(uart); + if (bfin_revid() < 5) + return; + } else return; - } else - return; + } } -#endif if (status & BI) { -#ifdef BF533_FAMILY - in_break = 1; -#endif + if (ANOMALY_05000230) + in_break = 1; uart->port.icount.brk++; if (uart_handle_break(&uart->port)) goto ignore_char; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Blackfin serial driver: use new GPIO API
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b99ab54d4f11141b2ef3e50c3543b7243d3f49fb Commit: b99ab54d4f11141b2ef3e50c3543b7243d3f49fb Parent: 8c61362377970cd35cc37960b5cbed03cecd57e7 Author: Michael Hennerich <[EMAIL PROTECTED]> AuthorDate: Thu Oct 11 10:57:54 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Thu Oct 11 10:57:54 2007 +0800 Blackfin serial driver: use new GPIO API Signed-off-by: Michael Hennerich <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- include/asm-blackfin/mach-bf548/bfin_serial_5xx.h | 39 ++--- 1 files changed, 19 insertions(+), 20 deletions(-) diff --git a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h index 2f4afc9..f21a162 100644 --- a/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h +++ b/include/asm-blackfin/mach-bf548/bfin_serial_5xx.h @@ -1,5 +1,6 @@ #include #include +#include #define NR_PORTS 4 @@ -143,50 +144,48 @@ struct bfin_serial_res bfin_serial_resource[] = { int nr_ports = ARRAY_SIZE(bfin_serial_resource); +#define DRIVER_NAME "bfin-uart" + static void bfin_serial_hw_init(struct bfin_serial_port *uart) { #ifdef CONFIG_SERIAL_BFIN_UART0 - /* Enable UART0 RX and TX on pin 7 & 8 of PORT E */ - bfin_write_PORTE_FER(0x180 | bfin_read_PORTE_FER()); - bfin_write_PORTE_MUX(0x3C000 | bfin_read_PORTE_MUX()); + peripheral_request(P_UART0_TX, DRIVER_NAME); + peripheral_request(P_UART0_RX, DRIVER_NAME); #endif #ifdef CONFIG_SERIAL_BFIN_UART1 - /* Enable UART1 RX and TX on pin 0 & 1 of PORT H */ - bfin_write_PORTH_FER(0x3 | bfin_read_PORTH_FER()); - bfin_write_PORTH_MUX(~0xF & bfin_read_PORTH_MUX()); + peripheral_request(P_UART1_TX, DRIVER_NAME); + peripheral_request(P_UART1_RX, DRIVER_NAME); + #ifdef CONFIG_BFIN_UART1_CTSRTS - /* Enable UART1 RTS and CTS on pin 9 & 10 of PORT E */ - bfin_write_PORTE_FER(0x600 | bfin_read_PORTE_FER()); - bfin_write_PORTE_MUX(~0x3C & bfin_read_PORTE_MUX()); + peripheral_request(P_UART1_RTS, DRIVER_NAME); + peripheral_request(P_UART1_CTS DRIVER_NAME); #endif #endif #ifdef CONFIG_SERIAL_BFIN_UART2 - /* Enable UART2 RX and TX on pin 4 & 5 of PORT B */ - bfin_write_PORTB_FER(0x30 | bfin_read_PORTB_FER()); - bfin_write_PORTB_MUX(~0xF00 & bfin_read_PORTB_MUX()); + peripheral_request(P_UART2_TX, DRIVER_NAME); + peripheral_request(P_UART2_RX, DRIVER_NAME); #endif #ifdef CONFIG_SERIAL_BFIN_UART3 - /* Enable UART3 RX and TX on pin 6 & 7 of PORT B */ - bfin_write_PORTB_FER(0xC0 | bfin_read_PORTB_FER()); - bfin_write_PORTB_MUX(~0xF000 | bfin_read_PORTB_MUX()); + peripheral_request(P_UART3_TX, DRIVER_NAME); + peripheral_request(P_UART3_RX, DRIVER_NAME); + #ifdef CONFIG_BFIN_UART3_CTSRTS - /* Enable UART3 RTS and CTS on pin 2 & 3 of PORT B */ - bfin_write_PORTB_FER(0xC | bfin_read_PORTB_FER()); - bfin_write_PORTB_MUX(~0xF0 | bfin_read_PORTB_MUX()); + peripheral_request(P_UART3_RTS, DRIVER_NAME); + peripheral_request(P_UART3_CTS DRIVER_NAME); #endif #endif SSYNC(); #ifdef CONFIG_SERIAL_BFIN_CTSRTS if (uart->cts_pin >= 0) { - gpio_request(uart->cts_pin, NULL); + gpio_request(uart->cts_pin, DRIVER_NAME); gpio_direction_input(uart->cts_pin); } if (uart->rts_pin >= 0) { - gpio_request(uart->rts_pin, NULL); + gpio_request(uart->rts_pin, DRIVER_NAME); gpio_direction_output(uart->rts_pin); } #endif - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Blackfin serial driver: supporting BF548-EZKIT serial port
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f4d640c9be1979a603ed017e1e03a16ba3a4d7a1 Commit: f4d640c9be1979a603ed017e1e03a16ba3a4d7a1 Parent: db83b991bce1b4792125d4b23bb108e8cfd5d366 Author: Roy Huang <[EMAIL PROTECTED]> AuthorDate: Thu Jul 12 16:43:46 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Thu Jul 12 16:43:46 2007 +0800 Blackfin serial driver: supporting BF548-EZKIT serial port Signed-off-by: Roy Huang <[EMAIL PROTECTED]> Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- drivers/serial/Kconfig| 46 +-- drivers/serial/bfin_5xx.c | 77 +++-- 2 files changed, 117 insertions(+), 6 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 71a4ac5..2adbed4 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -599,7 +599,7 @@ config UART0_RTS_PIN config SERIAL_BFIN_UART1 bool "Enable UART1" - depends on SERIAL_BFIN && (BF534 || BF536 || BF537) + depends on SERIAL_BFIN && (BF534 || BF536 || BF537 || BF54x) help Enable UART1 @@ -612,18 +612,58 @@ config BFIN_UART1_CTSRTS config UART1_CTS_PIN int "UART1 CTS pin" - depends on BFIN_UART1_CTSRTS + depends on BFIN_UART1_CTSRTS && (BF53x || BF561) default -1 help Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. config UART1_RTS_PIN int "UART1 RTS pin" - depends on BFIN_UART1_CTSRTS + depends on BFIN_UART1_CTSRTS && (BF53x || BF561) default -1 help Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. +config SERIAL_BFIN_UART2 + bool "Enable UART2" + depends on SERIAL_BFIN && (BF54x) + help + Enable UART2 + +config BFIN_UART2_CTSRTS + bool "Enable UART2 hardware flow control" + depends on SERIAL_BFIN_UART2 + help + Enable hardware flow control in the driver. Using GPIO emulate the CTS/RTS + signal. + +config UART2_CTS_PIN + int "UART2 CTS pin" + depends on BFIN_UART2_CTSRTS + default -1 + help + Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. + +config UART2_RTS_PIN + int "UART2 RTS pin" + depends on BFIN_UART2_CTSRTS + default -1 + help + Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. + +config SERIAL_BFIN_UART3 + bool "Enable UART3" + depends on SERIAL_BFIN && (BF54x) + help + Enable UART3 + +config BFIN_UART3_CTSRTS + bool "Enable UART3 hardware flow control" + depends on SERIAL_BFIN_UART3 + help + Enable hardware flow control in the driver. Using GPIO emulate the CTS/RTS + signal. + config SERIAL_IMX bool "IMX serial port support" depends on ARM && ARCH_IMX diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index f7926dc..66c92bc 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -86,15 +86,29 @@ static void bfin_serial_stop_tx(struct uart_port *port) { struct bfin_serial_port *uart = (struct bfin_serial_port *)port; +#ifdef CONFIG_BF54x + while (!(UART_GET_LSR(uart) & TEMT)) + continue; +#endif + #ifdef CONFIG_SERIAL_BFIN_DMA disable_dma(uart->tx_dma_channel); #else +#ifdef CONFIG_BF54x + /* Waiting for Transmission Finished */ + while (!(UART_GET_LSR(uart) & TFI)) + continue; + /* Clear TFI bit */ + UART_PUT_LSR(uart, TFI); + UART_CLEAR_IER(uart, ETBEI); +#else unsigned short ier; ier = UART_GET_IER(uart); ier &= ~ETBEI; UART_PUT_IER(uart, ier); #endif +#endif } /* @@ -107,12 +121,16 @@ static void bfin_serial_start_tx(struct uart_port *port) #ifdef CONFIG_SERIAL_BFIN_DMA bfin_serial_dma_tx_chars(uart); #else +#ifdef CONFIG_BF54x + UART_SET_IER(uart, ETBEI); +#else unsigned short ier; ier = UART_GET_IER(uart); ier |= ETBEI; UART_PUT_IER(uart, ier); bfin_serial_tx_chars(uart); #endif +#endif } /* @@ -121,6 +139,9 @@ static void bfin_serial_start_tx(struct uart_port *port) static void bfin_serial_stop_rx(struct uart_port *port) { struct bfin_serial_port *uart = (struct bfin_serial_port *)port; +#ifdef CONFIG_BF54x + UART_CLEAR_IER(uart, ERBFI); +#else unsigned short ier; ier = UART_GET_IER(uart); @@ -129,6 +150,7 @@ static void bfin_serial_stop_rx(struct uart_port *port) #endif ier &= ~ERBFI; UART_PUT_IER(uart, ier); +#endif } /* @@ -325,10 +347,21
Blackfin serial driver: ignore framing and parity errors
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9808901b6c63a1c850b072e624c228901a9eaf10 Commit: 9808901b6c63a1c850b072e624c228901a9eaf10 Parent: c16c3ca79abcb69a9e45f7c15f8358b3915c0e49 Author: Mike Frysinger <[EMAIL PROTECTED]> AuthorDate: Mon Jun 11 15:31:30 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Mon Jun 11 15:31:30 2007 +0800 Blackfin serial driver: ignore framing and parity errors if we get a break signal, we want to ignore framing and parity errors because those will always be set (by nature of the signal) Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- drivers/serial/bfin_5xx.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index aeb3cc2..9d356fc 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -185,6 +185,7 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) uart->port.icount.brk++; if (uart_handle_break(&uart->port)) goto ignore_char; + status &= ~(PE | FE); } if (status & PE) uart->port.icount.parity++; @@ -341,6 +342,7 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) uart->port.icount.brk++; if (uart_handle_break(&uart->port)) goto dma_ignore_char; + status &= ~(PE | FE); } if (status & PE) uart->port.icount.parity++; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Blackfin serial driver: actually implement the break_ctl() function
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cf68676222e54cd0a31efd968da00e65f9a0963f Commit: cf68676222e54cd0a31efd968da00e65f9a0963f Parent: 9808901b6c63a1c850b072e624c228901a9eaf10 Author: Mike Frysinger <[EMAIL PROTECTED]> AuthorDate: Mon Jun 11 16:12:49 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Mon Jun 11 16:12:49 2007 +0800 Blackfin serial driver: actually implement the break_ctl() function Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- drivers/serial/bfin_5xx.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 9d356fc..a9d2027 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -519,6 +519,14 @@ static void bfin_serial_mctrl_check(struct bfin_serial_port *uart) */ static void bfin_serial_break_ctl(struct uart_port *port, int break_state) { + struct bfin_serial_port *uart = (struct bfin_serial_port *)port; + u16 lcr = UART_GET_LCR(uart); + if (break_state) + lcr |= SB; + else + lcr &= ~SB; + UART_PUT_LCR(uart, lcr); + SSYNC(); } static int bfin_serial_startup(struct uart_port *port) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Blackfin serial driver: decouple PARODD and CMSPAR checking from PARENB
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=19aa6382e3c927b8ec5caec7b74c3dc555101146 Commit: 19aa6382e3c927b8ec5caec7b74c3dc555101146 Parent: cf68676222e54cd0a31efd968da00e65f9a0963f Author: Mike Frysinger <[EMAIL PROTECTED]> AuthorDate: Mon Jun 11 16:16:45 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Mon Jun 11 16:16:45 2007 +0800 Blackfin serial driver: decouple PARODD and CMSPAR checking from PARENB as the termios info does not stipulate that the former are dependent on the latter Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- drivers/serial/bfin_5xx.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index a9d2027..22569bd 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -635,13 +635,12 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, if (termios->c_cflag & CSTOPB) lcr |= STB; - if (termios->c_cflag & PARENB) { + if (termios->c_cflag & PARENB) lcr |= PEN; - if (!(termios->c_cflag & PARODD)) - lcr |= EPS; - if (termios->c_cflag & CMSPAR) - lcr |= STP; - } + if (!(termios->c_cflag & PARODD)) + lcr |= EPS; + if (termios->c_cflag & CMSPAR) + lcr |= STP; port->read_status_mask = OE; if (termios->c_iflag & INPCK) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Blackfin serial driver: hook up our UARTs STP bit with userspaces CMSPAR
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c16c3ca79abcb69a9e45f7c15f8358b3915c0e49 Commit: c16c3ca79abcb69a9e45f7c15f8358b3915c0e49 Parent: df30b1171714bbf0e55ffe02138be4b8447e4235 Author: Mike Frysinger <[EMAIL PROTECTED]> AuthorDate: Mon Jun 11 15:31:30 2007 +0800 Committer: Bryan Wu <[EMAIL PROTECTED]> CommitDate: Mon Jun 11 15:31:30 2007 +0800 Blackfin serial driver: hook up our UARTs STP bit with userspaces CMSPAR so we can now do spaced/marked parity Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> --- drivers/serial/bfin_5xx.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 787dc71..aeb3cc2 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -629,6 +629,8 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, lcr |= PEN; if (!(termios->c_cflag & PARODD)) lcr |= EPS; + if (termios->c_cflag & CMSPAR) + lcr |= STP; } port->read_status_mask = OE; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Blackfin serial driver: implement support for ignoring parity/break errors
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2ac5ee4738cbd9c146ccda53f02006eaf6a43352 Commit: 2ac5ee4738cbd9c146ccda53f02006eaf6a43352 Parent: 5c4e472b0af57553f9584e0b33c491b168ac1dff Author: Mike Frysinger <[EMAIL PROTECTED]> AuthorDate: Mon May 21 18:09:39 2007 +0800 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Mon May 21 09:50:23 2007 -0700 Blackfin serial driver: implement support for ignoring parity/break errors properly setting up and respecting the read_status_mask / ignore_status_mask fields of the serial core Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- drivers/serial/bfin_5xx.c | 97 - 1 files changed, 61 insertions(+), 36 deletions(-) diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index a8271d9..787dc71 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -6,8 +6,6 @@ * Created: * Description: Driver for blackfin 5xx serial ports * - * Rev: $Id: bfin_5xx.c,v 1.19 2006/09/24 02:33:53 aubrey Exp $ - * * Modified: * Copyright 2006 Analog Devices Inc. * @@ -152,7 +150,7 @@ static void local_put_char(struct bfin_serial_port *uart, char ch) static void bfin_serial_rx_chars(struct bfin_serial_port *uart) { - struct tty_struct *tty = uart->port.info?uart->port.info->tty:0; + struct tty_struct *tty = uart->port.info->tty; unsigned int status, ch, flg; #ifdef BF533_FAMILY static int in_break = 0; @@ -173,8 +171,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) if (ch != 0) { in_break = 0; ch = UART_GET_CHAR(uart); - } - return; + if (bfin_revid() < 5) + return; + } else + return; } #endif @@ -185,27 +185,32 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) uart->port.icount.brk++; if (uart_handle_break(&uart->port)) goto ignore_char; - flg = TTY_BREAK; - } else if (status & PE) { - flg = TTY_PARITY; + } + if (status & PE) uart->port.icount.parity++; - } else if (status & OE) { - flg = TTY_OVERRUN; + if (status & OE) uart->port.icount.overrun++; - } else if (status & FE) { - flg = TTY_FRAME; + if (status & FE) uart->port.icount.frame++; - } else + + status &= uart->port.read_status_mask; + + if (status & BI) + flg = TTY_BREAK; + else if (status & PE) + flg = TTY_PARITY; + else if (status & FE) + flg = TTY_FRAME; + else flg = TTY_NORMAL; if (uart_handle_sysrq_char(&uart->port, ch)) goto ignore_char; - if (tty) - uart_insert_char(&uart->port, status, 2, ch, flg); -ignore_char: - if (tty) - tty_flip_buffer_push(tty); + uart_insert_char(&uart->port, status, OE, ch, flg); + + ignore_char: + tty_flip_buffer_push(tty); } static void bfin_serial_tx_chars(struct bfin_serial_port *uart) @@ -254,7 +259,6 @@ static irqreturn_t bfin_serial_rx_int(int irq, void *dev_id) static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id) { struct bfin_serial_port *uart = dev_id; - unsigned short status; spin_lock(&uart->port.lock); while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_TX_READY) @@ -325,7 +329,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) spin_unlock_irqrestore(&uart->port.lock, flags); } -static void bfin_serial_dma_rx_chars(struct bfin_serial_port * uart) +static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) { struct tty_struct *tty = uart->port.info->tty; int i, flg, status; @@ -337,25 +341,32 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port * uart) uart->port.icount.brk++; if (uart_handle_break(&uart->port)) goto dma_ignore_char; - flg = TTY_BREAK; - } else if (status & PE) { - flg = TTY_PARITY; + } + if (status & PE) uart->port.icount.parity++; - } else if (status & OE) { - flg = TTY_OVERRUN; + if (status & OE) uart->port.icount.overrun++; - } else if (status & FE) {
Blackfin serial driver: fix overhead issue
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c4e472b0af57553f9584e0b33c491b168ac1dff Commit: 5c4e472b0af57553f9584e0b33c491b168ac1dff Parent: 9d7b6677ac35fdfee93e8f50589e04bcc95649c1 Author: Aubrey Li <[EMAIL PROTECTED]> AuthorDate: Mon May 21 18:09:38 2007 +0800 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Mon May 21 09:50:23 2007 -0700 Blackfin serial driver: fix overhead issue Signed-off-by: Aubrey Li <[EMAIL PROTECTED]> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- drivers/serial/bfin_5xx.c | 28 +--- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 408390f..a8271d9 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c @@ -240,24 +240,30 @@ static void bfin_serial_tx_chars(struct bfin_serial_port *uart) bfin_serial_stop_tx(&uart->port); } -static irqreturn_t bfin_serial_int(int irq, void *dev_id) +static irqreturn_t bfin_serial_rx_int(int irq, void *dev_id) +{ + struct bfin_serial_port *uart = dev_id; + + spin_lock(&uart->port.lock); + while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_RX_READY) + bfin_serial_rx_chars(uart); + spin_unlock(&uart->port.lock); + return IRQ_HANDLED; +} + +static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id) { struct bfin_serial_port *uart = dev_id; unsigned short status; spin_lock(&uart->port.lock); - status = UART_GET_IIR(uart); - do { - if ((status & IIR_STATUS) == IIR_TX_READY) - bfin_serial_tx_chars(uart); - if ((status & IIR_STATUS) == IIR_RX_READY) - bfin_serial_rx_chars(uart); - status = UART_GET_IIR(uart); - } while (status & (IIR_TX_READY | IIR_RX_READY)); + while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_TX_READY) + bfin_serial_tx_chars(uart); spin_unlock(&uart->port.lock); return IRQ_HANDLED; } + static void bfin_serial_do_work(struct work_struct *work) { struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue); @@ -545,14 +551,14 @@ static int bfin_serial_startup(struct uart_port *port) add_timer(&(uart->rx_dma_timer)); #else if (request_irq - (uart->port.irq, bfin_serial_int, IRQF_DISABLED, + (uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED, "BFIN_UART_RX", uart)) { printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n"); return -EBUSY; } if (request_irq - (uart->port.irq+1, bfin_serial_int, IRQF_DISABLED, + (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, "BFIN_UART_TX", uart)) { printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n"); free_irq(uart->port.irq, uart); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
blackfin: serial driver
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=194de5612777a9ff4f96dae1932f77a5a89e5f0a Commit: 194de5612777a9ff4f96dae1932f77a5a89e5f0a Parent: 1394f03221790a988afc3e4b3cb79f2e477246a9 Author: Bryan Wu <[EMAIL PROTECTED]> AuthorDate: Sun May 6 14:50:30 2007 -0700 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Mon May 7 12:12:58 2007 -0700 blackfin: serial driver This patch implements the driver necessary use the Analog Devices Blackfin processor's Serial Port. Signed-off-by: Bryan Wu <[EMAIL PROTECTED]> Cc: Alan Cox <[EMAIL PROTECTED]> Cc: Russell King <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- drivers/serial/Kconfig | 94 drivers/serial/Makefile |1 + drivers/serial/bfin_5xx.c | 1012 +++ include/linux/serial_core.h |3 + 4 files changed, 1110 insertions(+), 0 deletions(-) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index e9d927e..924e9bd 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -508,6 +508,100 @@ config SERIAL_SA1100_CONSOLE your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) +config SERIAL_BFIN + tristate "Blackfin serial port support" + depends on BFIN + select SERIAL_CORE + select SERIAL_BFIN_UART0 if (BF531 || BF532 || BF533 || BF561) + help + Add support for the built-in UARTs on the Blackfin. + + To compile this driver as a module, choose M here: the + module will be called bfin_5xx. + +config SERIAL_BFIN_CONSOLE + bool "Console on Blackfin serial port" + depends on SERIAL_BFIN + select SERIAL_CORE_CONSOLE + +choice + prompt "UART Mode" + depends on SERIAL_BFIN + default SERIAL_BFIN_DMA + help + This driver supports the built-in serial ports of the Blackfin family + of CPUs + +config SERIAL_BFIN_DMA + bool "DMA mode" + depends on DMA_UNCACHED_1M + help + This driver works under DMA mode. If this option is selected, the + blackfin simple dma driver is also enabled. + +config SERIAL_BFIN_PIO + bool "PIO mode" + help + This driver works under PIO mode. + +endchoice + +config SERIAL_BFIN_UART0 + bool "Enable UART0" + depends on SERIAL_BFIN + help + Enable UART0 + +config BFIN_UART0_CTSRTS + bool "Enable UART0 hardware flow control" + depends on SERIAL_BFIN_UART0 + help + Enable hardware flow control in the driver. Using GPIO emulate the CTS/RTS + signal. + +config UART0_CTS_PIN + int "UART0 CTS pin" + depends on BFIN_UART0_CTSRTS + default 23 + help + The default pin is GPIO_GP7. + Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. + +config UART0_RTS_PIN + int "UART0 RTS pin" + depends on BFIN_UART0_CTSRTS + default 22 + help + The default pin is GPIO_GP6. + Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. + +config SERIAL_BFIN_UART1 + bool "Enable UART1" + depends on SERIAL_BFIN && (BF534 || BF536 || BF537) + help + Enable UART1 + +config BFIN_UART1_CTSRTS + bool "Enable UART1 hardware flow control" + depends on SERIAL_BFIN_UART1 + help + Enable hardware flow control in the driver. Using GPIO emulate the CTS/RTS + signal. + +config UART1_CTS_PIN + int "UART1 CTS pin" + depends on BFIN_UART1_CTSRTS + default -1 + help + Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. + +config UART1_RTS_PIN + int "UART1 RTS pin" + depends on BFIN_UART1_CTSRTS + default -1 + help + Refer to ./include/asm-blackfin/gpio.h to see the GPIO map. + config SERIAL_IMX bool "IMX serial port support" depends on ARM && ARCH_IMX diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index 6b3560c..4959bcb 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -27,6 +27,7 @@ obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o obj-$(CONFIG_SERIAL_PXA) += pxa.o obj-$(CONFIG_SERIAL_PNX8XXX) += pnx8xxx_uart.o obj-$(CONFIG_SERIAL_SA1100) += sa1100.o +obj-$(CONFIG_SERIAL_BFIN) += bfin_5xx.o obj-$(CONFIG_SERIAL_S3C2410) += s3c2410.o obj-$(CONFIG_SERIAL_SUNCORE) += suncore.o obj-$(CONFIG_SERIAL_SUNHV) += sunhv.o diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c new file mode 100644 index 000..408390f --- /dev/null +++ b/drivers/serial/bfin_5xx.c @@ -0,0 +1,1012 @@ +/