From: James S. <jsi...@us...> - 2002-06-18 22:41:10
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv17900/drivers/serial Modified Files: ChangeLog Config.in Makefile serial_21285.c serial_8250.c serial_clps711x.c serial_core.c serial_sa1100.c Added Files: Config.help Log Message: Synced up with Russell Kings work fo rth enew serial stuff. --- NEW FILE: Config.help --- # $Id: Config.help,v 1.1 2002/06/18 22:41:07 jsimmons Exp $ CONFIG_SERIAL_8250 This selects whether you want to include the driver for the standard serial ports. The standard answer is Y. People who might say N here are those that are setting up dedicated Ethernet WWW/FTP servers, or users that have one of the various bus mice instead of a serial mouse and don't intend to use their machine's standard serial port for anything. (Note that the Cyclades and Stallion multi serial port drivers do not need this driver built in for them to work.) If you want to compile this driver as a module, say M here and read <file:Documentation/modules.txt>. The module will be called serial.o. [WARNING: Do not compile this driver as a module if you are using non-standard serial ports, since the configuration information will be lost when the driver is unloaded. This limitation may be lifted in the future.] BTW1: If you have a mouseman serial mouse which is not recognized by the X window system, try running gpm first. BTW2: If you intend to use a software modem (also called Winmodem) under Linux, forget it. These modems are crippled and require proprietary drivers which are only available under Windows. Most people will say Y or M here, so that they can use serial mice, modems and similar devices connecting to the standard serial ports. CONFIG_SERIAL_8250_CONSOLE If you say Y here, it will be possible to use a serial port as the system console (the system console is the device which receives all kernel messages and warnings and which allows logins in single user mode). This could be useful if some terminal or printer is connected to that serial port. Even if you say Y here, the currently visible virtual console (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyS1". (Try "man bootparam" or see the documentation of your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) If you don't have a VGA card installed and you say Y here, the kernel will automatically use the first serial line, /dev/ttyS0, as system console. If unsure, say N. CONFIG_SERIAL_8250_EXTENDED If you wish to use any non-standard features of the standard "dumb" driver, say Y here. This includes HUB6 support, shared serial interrupts, special multiport support, support for more than the four COM 1/2/3/4 boards, etc. Note that the answer to this question won't directly affect the kernel: saying N will just cause the configurator to skip all the questions about serial driver options. If unsure, say N. CONFIG_SERIAL_8250_MANY_PORTS Say Y here if you have dumb serial boards other than the four standard COM 1/2/3/4 ports. This may happen if you have an AST FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available from <http://www.linuxdoc.org/docs.html#howto>), or other custom serial port hardware which acts similar to standard serial port hardware. If you only use the standard COM 1/2/3/4 ports, you can 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_SHARE_IRQ Some serial boards have hardware support which allows multiple dumb serial ports on the same board to share a single IRQ. To enable support for this in the serial driver, say Y here. CONFIG_SERIAL_8250_DETECT_IRQ Say Y here if you want the kernel to try to guess which IRQ to use for your serial port. This is considered unsafe; it is far better to configure the IRQ in a boot script using the setserial command. If unsure, say N. CONFIG_SERIAL_8250_MULTIPORT Some multiport serial ports have special ports which are used to signal when there are any serial ports on the board which need servicing. Say Y here to enable the serial driver to take advantage of those special I/O ports. CONFIG_SERIAL_8250_RSA ::: To be written ::: CONFIG_SERIAL_ROCKETPORT This is a driver for the Comtrol Rocketport cards which provide multiple serial ports. You would need something like this to connect more than two modems to your Linux box, for instance in order to become a dial-in server. If you want to compile this driver as a module, say M here and read <file:Documentation/modules.txt>. The module will be called rocket.o. CONFIG_ATOMWIDE_SERIAL If you have an Atomwide Serial card for an Acorn system, say Y to this option. The driver can handle 1, 2, or 3 port cards. If unsure, say N. CONFIG_DUALSP_SERIAL If you have the Serial Port's dual serial card for an Acorn system, say Y to this option. If unsure, say N. CONFIG_SERIAL_ANAKIN ::: To be written ::: CONFIG_SERIAL_ANAKIN_CONSOLE ::: To be written ::: Even if you say Y here, the currently visible virtual console (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyAN0". (Try "man bootparam" or see the documentation of your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) CONFIG_ANAKIN_DEFAULT_BAUDRATE ::: To be written ::: CONFIG_SERIAL_AMBA This selects the ARM(R) AMBA(R) PrimeCell UART. If you have an Integrator platform, say Y or M here. If unsure, say N. CONFIG_SERIAL_AMBA_CONSOLE Say Y here if you wish to use an AMBA PrimeCell UART as the system console (the system console is the device which receives all kernel messages and warnings and which allows logins in single user mode). Even if you say Y here, the currently visible framebuffer console (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyAM0". (Try "man bootparam" or see the documentation of your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) CONFIG_SERIAL_CLPS711X ::: To be written ::: CONFIG_SERIAL_CLPS711X_CONSOLE ::: To be written ::: Even if you say Y here, the currently visible virtual console (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyCL1". (Try "man bootparam" or see the documentation of your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) CONFIG_SERIAL_CLPS711X_OLD_NAME ::: To be written ::: CONFIG_SERIAL_21285 If you have a machine based on a 21285 (Footbridge) StrongARM(R)/ PCI bridge you can enable its onboard serial port by enabling this option. CONFIG_SERIAL_21285_OLD Use the old /dev/ttyS name, major 4 minor 64. This is obsolete and will be removed during later 2.5 development. CONFIG_SERIAL_21285_CONSOLE If you have enabled the serial port on the 21285 footbridge you can make it the console by answering Y to this option. Even if you say Y here, the currently visible virtual console (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyFB". (Try "man bootparam" or see the documentation of your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) CONFIG_SERIAL_UART00 Say Y here if you want to use the hard logic uart on Excalibur. This driver also supports soft logic implentations of this uart core. CONFIG_SERIAL_UART00_CONSOLE Say Y here if you want to support a serial console on an Excalibur hard logic uart or uart00 IP core. Even if you say Y here, the currently visible virtual console (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttyS1". (Try "man bootparam" or see the documentation of your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) CONFIG_SERIAL_SA1100 If you have a machine based on a SA1100/SA1110 StrongARM(R) CPU you can enable its onboard serial port by enabling this option. Please read <file:Documentation/arm/SA1100/serial_UART> for further info. CONFIG_SERIAL_SA1100_CONSOLE If you have enabled the serial port on the SA1100/SA1110 StrongARM CPU you can make it the console by answering Y to this option. Even if you say Y here, the currently visible virtual console (/dev/tty0) will still be used as the system console by default, but you can alter that using a kernel command line option such as "console=ttySA0". (Try "man bootparam" or see the documentation of your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) #CONFIG_SERIAL_L7200 # If you have a LinkUp Systems L7200 board you can enable its two # onboard serial ports by enabling this option. The device numbers # are major ID 4 with minor 64 and 65 respectively. # #CONFIG_SERIAL_L7200_CONSOLE # If you have enabled the serial ports on the L7200 development board # you can make the first serial port the console by answering Y to # this option. Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ChangeLog 14 Mar 2002 20:03:25 -0000 1.5 +++ ChangeLog 18 Jun 2002 22:41:07 -0000 1.6 @@ -19,3 +19,7 @@ 2002-3-14 James Simmons <jsi...@us...> * Grabbed RMK latest work and placed it into CVS. I haven't had time to properly modify it for the input api. + +2002-6-18 James Simmons <jsi...@us...> + * Grabbed RMK latest work and placed it into CVS. I haven't had time + to properly modify it for the input api. Some day I will get to it. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/Config.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Config.in 1 Nov 2001 21:38:35 -0000 1.7 +++ Config.in 18 Jun 2002 22:41:07 -0000 1.8 @@ -6,55 +6,75 @@ mainmenu_option next_comment comment 'Serial drivers' -tristate 'Serial port support' CONFIG_UART -if [ "$CONFIG_UART" != "n" ]; then - if [ "$CONFIG_ARM" = "y" ]; then - dep_bool 'Anakin serial port support' CONFIG_SERIAL_ANAKIN $CONFIG_ARCH_ANAKIN - dep_bool ' Console on Anakin serial port' CONFIG_SERIAL_ANAKIN_CONSOLE $CONFIG_SERIAL_ANAKIN - if [ "$CONFIG_SERIAL_ANAKIN" = "y" ]; then - int ' Default Anakin serial baudrate' CONFIG_ANAKIN_DEFAULT_BAUDRATE 9600 - fi +# +# The new 8250/16550 serial drivers +dep_tristate '8250/16550 and compatible serial support (EXPERIMENTAL)' CONFIG_SERIAL_8250 $CONFIG_EXPERIMENTAL +dep_bool ' Console on 8250/16550 and compatible serial port (EXPERIMENTAL)' CONFIG_SERIAL_8250_CONSOLE $CONFIG_SERIAL_8250 $CONFIG_EXPERIMENTAL - dep_tristate 'ARM AMBA serial port support' CONFIG_SERIAL_AMBA $CONFIG_ARCH_INTEGRATOR - dep_bool ' Support for console on AMBA serial port' CONFIG_SERIAL_AMBA_CONSOLE $CONFIG_SERIAL_AMBA - if [ "$CONFIG_SERIAL_AMBA" = "y" ]; then - define_bool CONFIG_SERIAL_INTEGRATOR y - fi +dep_mbool 'Extended 8250/16550 serial driver options' CONFIG_SERIAL_8250_EXTENDED $CONFIG_SERIAL_8250 +dep_bool ' Support more than 4 serial ports' CONFIG_SERIAL_8250_MANY_PORTS $CONFIG_SERIAL_8250_EXTENDED +dep_bool ' Support for sharing serial interrupts' CONFIG_SERIAL_8250_SHARE_IRQ $CONFIG_SERIAL_8250_EXTENDED +dep_bool ' Autodetect IRQ on standard ports (unsafe)' CONFIG_SERIAL_8250_DETECT_IRQ $CONFIG_SERIAL_8250_EXTENDED +dep_bool ' Support special multiport boards' CONFIG_SERIAL_8250_MULTIPORT $CONFIG_SERIAL_8250_EXTENDED +dep_bool ' Support RSA serial ports' CONFIG_SERIAL_8250_RSA $CONFIG_SERIAL_8250_EXTENDED - dep_tristate 'CLPS711X serial port support' CONFIG_SERIAL_CLPS711X $CONFIG_ARCH_CLPS711X - dep_bool ' Support for console on CLPS711X serial port' CONFIG_SERIAL_CLPS711X_CONSOLE $CONFIG_SERIAL_CLPS711X +comment 'Non-8250 serial port support' - dep_bool 'DC21285 serial port support' CONFIG_SERIAL_21285 $CONFIG_FOOTBRIDGE - dep_bool ' Use /dev/ttyS0 device (OBSOLETE)' CONFIG_SERIAL_21285_OLD $CONFIG_SERIAL_21285 $CONFIG_OBSOLETE - dep_bool ' Console on DC21285 serial port' CONFIG_SERIAL_21285_CONSOLE $CONFIG_SERIAL_21285 +#if [ "$CONFIG_PCI" = "y" -o "$CONFIG_ISA" = "y" ]; then +# dep_tristate 'Comtrol Rocketport support' CONFIG_SERIAL_ROCKETPORT +#fi - dep_bool 'Excalibur serial port (uart00) support' CONFIG_SERIAL_UART00 $CONFIG_ARCH_CAMELOT - dep_bool ' Support for console on Excalibur serial port' CONFIG_SERIAL_UART00_CONSOLE $CONFIG_SERIAL_UART00 +if [ "$CONFIG_ARM" = "y" ]; then + dep_tristate 'Acorn Atomwide 16550 serial port support' CONFIG_ATOMWIDE_SERIAL $CONFIG_ARCH_ACORN $CONFIG_SERIAL_8250 + dep_tristate 'Acorn Dual 16550 serial port support' CONFIG_DUALSP_SERIAL $CONFIG_ARCH_ACORN $CONFIG_SERIAL_8250 + dep_bool 'Anakin serial port support' CONFIG_SERIAL_ANAKIN $CONFIG_ARCH_ANAKIN + dep_bool ' Console on Anakin serial port' CONFIG_SERIAL_ANAKIN_CONSOLE $CONFIG_SERIAL_ANAKIN + if [ "$CONFIG_SERIAL_ANAKIN" = "y" ]; then + int ' Default Anakin serial baudrate' CONFIG_ANAKIN_DEFAULT_BAUDRATE 9600 + fi - dep_bool 'SA1100 serial port support' CONFIG_SERIAL_SA1100 $CONFIG_ARCH_SA1100 - dep_bool ' Console on SA1100 serial port' CONFIG_SERIAL_SA1100_CONSOLE $CONFIG_SERIAL_SA1100 - if [ "$CONFIG_ARCH_SA1100" = "y" ]; then - int ' Default SA1100 serial baudrate' CONFIG_SA1100_DEFAULT_BAUDRATE 9600 - fi - fi -# -# The new 8250/16550 serial drivers - dep_tristate '8250/16550 and compatible serial support (EXPERIMENTAL)' CONFIG_SERIAL_8250 $CONFIG_EXPERIMENTAL - dep_bool ' Console on 8250/16550 and compatible serial port (EXPERIMENTAL)' CONFIG_SERIAL_8250_CONSOLE $CONFIG_SERIAL_8250 $CONFIG_EXPERIMENTAL + dep_tristate 'ARM AMBA serial port support' CONFIG_SERIAL_AMBA $CONFIG_ARCH_INTEGRATOR + dep_bool ' Support for console on AMBA serial port' CONFIG_SERIAL_AMBA_CONSOLE $CONFIG_SERIAL_AMBA + if [ "$CONFIG_SERIAL_AMBA" = "y" ]; then + define_bool CONFIG_SERIAL_INTEGRATOR y + fi - dep_mbool 'Extended 8250/16550 serial driver options' CONFIG_SERIAL_8250_EXTENDED $CONFIG_SERIAL_8250 - dep_bool ' Support more than 4 serial ports' CONFIG_SERIAL_8250_MANY_PORTS $CONFIG_SERIAL_8250_EXTENDED - dep_bool ' Support for sharing serial interrupts' CONFIG_SERIAL_8250_SHARE_IRQ $CONFIG_SERIAL_8250_EXTENDED - dep_bool ' Autodetect IRQ on standard ports (unsafe)' CONFIG_SERIAL_8250_DETECT_IRQ $CONFIG_SERIAL_8250_EXTENDED - dep_bool ' Support special multiport boards' CONFIG_SERIAL_8250_MULTIPORT $CONFIG_SERIAL_8250_EXTENDED - dep_bool ' Support Bell Technologies HUB6 card' CONFIG_SERIAL_8250_HUB6 $CONFIG_SERIAL_8250_EXTENDED + dep_tristate 'CLPS711X serial port support' CONFIG_SERIAL_CLPS711X $CONFIG_ARCH_CLPS711X + dep_bool ' Support for console on CLPS711X serial port' CONFIG_SERIAL_CLPS711X_CONSOLE $CONFIG_SERIAL_CLPS711X + dep_bool ' Use the old 2.4 names for CLPS711X serial port' CONFIG_SERIAL_CLPS711X_OLD_NAME $CONFIG_SERIAL_CLPS711X - if [ "$CONFIG_SERIAL_AMBA_CONSOLE" = "y" -o \ - "$CONFIG_SERIAL_CLPS711X_CONSOLE" = "y" -o \ - "$CONFIG_SERIAL_SA1100_CONSOLE" = "y" -o \ - "$CONFIG_SERIAL_ANAKIN_CONSOLE" = "y" -o \ - "$CONFIG_SERIAL_8250_CONSOLE" = "y" ]; then - define_bool CONFIG_SERIAL_CORE_CONSOLE y - fi + dep_tristate 'DC21285 serial port support' CONFIG_SERIAL_21285 $CONFIG_FOOTBRIDGE + dep_bool ' Use /dev/ttyS0 device (OBSOLETE)' CONFIG_SERIAL_21285_OLD $CONFIG_SERIAL_21285 $CONFIG_OBSOLETE + dep_bool ' Console on DC21285 serial port' CONFIG_SERIAL_21285_CONSOLE $CONFIG_SERIAL_21285 + + dep_bool 'Excalibur serial port (uart00) support' CONFIG_SERIAL_UART00 $CONFIG_ARCH_CAMELOT + dep_bool ' Support for console on Excalibur serial port' CONFIG_SERIAL_UART00_CONSOLE $CONFIG_SERIAL_UART00 + + dep_bool 'SA1100 serial port support' CONFIG_SERIAL_SA1100 $CONFIG_ARCH_SA1100 + dep_bool ' Console on SA1100 serial port' CONFIG_SERIAL_SA1100_CONSOLE $CONFIG_SERIAL_SA1100 +fi + +if [ "$CONFIG_SERIAL_AMBA" = "y" -o "$CONFIG_SERIAL_CLPS711X" = "y" -o \ + "$CONFIG_SERIAL_21285" = "y" -o "$CONFIG_SERIAL_SA1100" = "y" -o \ + "$CONFIG_SERIAL_ANAKIN" = "y" -o "$CONFIG_SERIAL_UART00" = "y" -o \ + "$CONFIG_SERIAL_8250" = "y" -o "$CONFIG_SERIAL_ROCKETPORT" = "y" ]; then + define_bool CONFIG_SERIAL_CORE y +else + if [ "$CONFIG_SERIAL_AMBA" = "m" -o "$CONFIG_SERIAL_CLPS711X" = "m" -o \ + "$CONFIG_SERIAL_21285" = "m" -o "$CONFIG_SERIAL_SA1100" = "m" -o \ + "$CONFIG_SERIAL_ANAKIN" = "m" -o "$CONFIG_SERIAL_UART00" = "m" -o \ + "$CONFIG_SERIAL_8250" = "m" -o "$CONFIG_SERIAL_ROCKETPORT" = "m" ]; then + define_bool CONFIG_SERIAL_CORE m + fi fi +if [ "$CONFIG_SERIAL_AMBA_CONSOLE" = "y" -o \ + "$CONFIG_SERIAL_CLPS711X_CONSOLE" = "y" -o \ + "$CONFIG_SERIAL_21285_CONSOLE" = "y" -o \ + "$CONFIG_SERIAL_SA1100_CONSOLE" = "y" -o \ + "$CONFIG_SERIAL_ANAKIN_CONSOLE" = "y" -o \ + "$CONFIG_SERIAL_UART00_CONSOLE" = "y" -o \ + "$CONFIG_SERIAL_8250_CONSOLE" = "y" ]; then + define_bool CONFIG_SERIAL_CORE_CONSOLE y +fi + endmenu Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile 12 Apr 2002 21:19:31 -0000 1.10 +++ Makefile 18 Jun 2002 22:41:07 -0000 1.11 @@ -1,25 +1,11 @@ # # Makefile for the kernel serial device drivers. # -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# -# Note 2! The CFLAGS definitions are now inherited from the -# parent makes.. -# # $Id$ # -O_TARGET := serial.o - export-objs := serial_core.o serial_8250.o -obj-y := -obj-m := -obj-n := -obj- := -obj-$(CONFIG_UART) += serial_core.o serial-8250-y := serial-8250-$(CONFIG_PCI) += serial_8250_pci.o serial-8250-$(CONFIG_ISAPNP) += serial_8250_pnp.o @@ -31,8 +17,6 @@ obj-$(CONFIG_SERIAL_CLPS711X) += serial_clps711x.o obj-$(CONFIG_SERIAL_SA1100) += serial_sa1100.o obj-$(CONFIG_SERIAL_UART00) += serial_uart00.o +obj-$(CONFIG_SERIAL_ROCKET) += rocket.o include $(TOPDIR)/Rules.make - -fastdep: - Index: serial_21285.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_21285.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial_21285.c 14 Mar 2002 20:02:07 -0000 1.10 +++ serial_21285.c 18 Jun 2002 22:41:07 -0000 1.11 @@ -56,6 +56,9 @@ static struct tty_driver normal, callout; static const char serial21285_name[] = "Footbridge UART"; +#define tx_enabled(port) ((port)->unused[0]) +#define rx_enabled(port) ((port)->unused[1]) + /* * The documented expression for selecting the divisor is: * BAUD_BASE / baud - 1 @@ -70,18 +73,39 @@ static void serial21285_stop_tx(struct uart_port *port, unsigned int tty_stop) { - disable_irq(IRQ_CONTX); + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + if (tx_enabled(port)) { + disable_irq(IRQ_CONTX); + tx_enabled(port) = 0; + } + spin_unlock_irqrestore(&port->lock, flags); } static void serial21285_start_tx(struct uart_port *port, unsigned int tty_start) { - enable_irq(IRQ_CONTX); + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + if (!tx_enabled(port)) { + enable_irq(IRQ_CONTX); + tx_enabled(port) = 1; + } + spin_unlock_irqrestore(&port->lock, flags); } static void serial21285_stop_rx(struct uart_port *port) { - disable_irq(IRQ_CONRX); + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + if (rx_enabled(port)) { + disable_irq(IRQ_CONRX); + rx_enabled(port) = 0; + } + spin_unlock_irqrestore(&port->lock, flags); } static void serial21285_enable_ms(struct uart_port *port) @@ -95,7 +119,7 @@ unsigned int status, ch, rxs, max_count = 256; status = *CSR_UARTFLG; - while (status & 0x10 && max_count--) { + while (!(status & 0x10) && max_count--) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { tty->flip.tqueue.routine((void *)tty); if (tty->flip.count >= TTY_FLIPBUF_SIZE) { @@ -214,6 +238,9 @@ { int ret; + tx_enabled(port) = 1; + rx_enabled(port) = 1; + ret = request_irq(IRQ_CONRX, serial21285_rx_chars, 0, serial21285_name, port); if (ret == 0) { @@ -222,6 +249,7 @@ if (ret) free_irq(IRQ_CONRX, port); } + return ret; } @@ -282,6 +310,8 @@ if ((cflag & CREAD) == 0) port->ignore_status_mask |= RXSTAT_DUMMY_READ; + quot -= 1; + *CSR_UARTCON = 0; *CSR_L_UBRLCR = quot & 0xff; *CSR_M_UBRLCR = (quot >> 8) & 0x0f; @@ -358,7 +388,7 @@ static void serial21285_setup_ports(void) { - serial21285_port.uartclk = mem_fclk_21285 / 16; + serial21285_port.uartclk = mem_fclk_21285 / 4; } #ifdef CONFIG_SERIAL_21285_CONSOLE @@ -369,16 +399,16 @@ { int i; - disable_irq(IRQ_CONTX); for (i = 0; i < count; i++) { - while (*CSR_UARTFLG & 0x20); + while (*CSR_UARTFLG & 0x20) + barrier(); *CSR_UARTDR = s[i]; if (s[i] == '\n') { - while (*CSR_UARTFLG & 0x20); + while (*CSR_UARTFLG & 0x20) + barrier(); *CSR_UARTDR = '\r'; } } - enable_irq(IRQ_CONTX); } static kdev_t serial21285_console_device(struct console *c) @@ -390,6 +420,36 @@ serial21285_get_options(struct uart_port *port, int *baud, int *parity, int *bits) { + if (*CSR_UARTCON == 1) { + unsigned int tmp; + + tmp = *CSR_H_UBRLCR; + switch (tmp & 0x60) { + case 0x00: + *bits = 5; + break; + case 0x20: + *bits = 6; + break; + case 0x40: + *bits = 7; + break; + default: + case 0x60: + *bits = 8; + break; + } + + if (tmp & H_UBRLCR_PARENB) { + *parity = 'o'; + if (tmp & H_UBRLCR_PAREVN) + *parity = 'e'; + } + + tmp = *CSR_L_UBRLCR | (*CSR_M_UBRLCR << 8); + + *baud = port->uartclk / (16 * (tmp + 1)); + } } static int __init serial21285_console_setup(struct console *co, char *options) Index: serial_8250.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serial_8250.c 14 Mar 2002 20:02:07 -0000 1.15 +++ serial_8250.c 18 Jun 2002 22:41:07 -0000 1.16 @@ -1108,18 +1108,18 @@ */ serial_outp(up, UART_LCR, UART_LCR_WLEN8); - spin_lock_irqsave(&port->lock, flags); + spin_lock_irqsave(&up->port.lock, flags); if (up->port.flags & ASYNC_FOURPORT) { if (!is_real_interrupt(up->port.irq)) - port->mctrl |= TIOCM_OUT1; + up->port.mctrl |= TIOCM_OUT1; } else /* * Most PC uarts need OUT2 raised to enable interrupts. */ if (is_real_interrupt(up->port.irq)) - port->mctrl |= TIOCM_OUT2; + up->port.mctrl |= TIOCM_OUT2; - serial8250_set_mctrl(&up->port, port->mctrl); + serial8250_set_mctrl(&up->port, up->port.mctrl); spin_unlock_irqrestore(&up->port.lock, flags); /* @@ -1162,15 +1162,15 @@ up->ier = 0; serial_outp(up, UART_IER, 0); - spin_lock_irqsave(&port->lock, flags); + spin_lock_irqsave(&up->port.lock, flags); if (up->port.flags & ASYNC_FOURPORT) { /* reset interrupts on the AST Fourport board */ inb((up->port.iobase & 0xfe0) | 0x1f); - port->mctrl |= TIOCM_OUT1; + up->port.mctrl |= TIOCM_OUT1; } else - port->mctrl &= ~TIOCM_OUT2; + up->port.mctrl &= ~TIOCM_OUT2; - serial8250_set_mctrl(&up->port, port->mctrl); + serial8250_set_mctrl(&up->port, up->port.mctrl); spin_unlock_irqrestore(&up->port.lock, flags); /* @@ -1631,8 +1631,6 @@ serial8250_ports[i].port.uartclk = old_serial_port[i].base_baud * 16; serial8250_ports[i].port.flags = old_serial_port[i].flags; serial8250_ports[i].port.ops = &serial8250_pops; - init_timer(&serial8250_ports[i].timer); - serial8250_ports[i].timer.function = serial8250_timeout; } } @@ -1644,6 +1642,9 @@ for (i = 0; i < UART_NR; i++) { serial8250_ports[i].port.line = i; + serial8250_ports[i].port.ops = &serial8250_pops; + init_timer(&serial8250_ports[i].timer); + serial8250_ports[i].timer.function = serial8250_timeout; uart_add_one_port(drv, &serial8250_ports[i].port); } } Index: serial_clps711x.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_clps711x.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serial_clps711x.c 14 Mar 2002 20:02:07 -0000 1.13 +++ serial_clps711x.c 18 Jun 2002 22:41:07 -0000 1.14 @@ -45,6 +45,7 @@ #include <linux/serial.h> #include <linux/console.h> #include <linux/sysrq.h> +#include <linux/spinlock.h> #include <asm/bitops.h> #include <asm/hardware.h> @@ -63,6 +64,7 @@ #define UART_NR 2 +#ifndef CONFIG_SERIAL_CLPS711X_OLD_NAME #define SERIAL_CLPS711X_NAME "ttyCL" #define SERIAL_CLPS711X_MAJOR 204 #define SERIAL_CLPS711X_MINOR 40 @@ -72,6 +74,18 @@ #define CALLOUT_CLPS711X_MAJOR 205 #define CALLOUT_CLPS711X_MINOR 40 #define CALLOUT_CLPS711X_NR UART_NR +#else +#warning The old names/device number for this driver if compatabity is needed +#define SERIAL_CLPS711X_NAME "ttyAM" +#define SERIAL_CLPS711X_MAJOR 204 +#define SERIAL_CLPS711X_MINOR 16 +#define SERIAL_CLPS711X_NR UART_NR + +#define CALLOUT_CLPS711X_NAME "cuaam" +#define CALLOUT_CLPS711X_MAJOR 205 +#define CALLOUT_CLPS711X_MINOR 16 +#define CALLOUT_CLPS711X_NR UART_NR +#endif static struct tty_driver normal, callout; @@ -88,16 +102,32 @@ #define UART_ANY_ERR (UARTDR_FRMERR | UARTDR_PARERR | UARTDR_OVERR) +#define tx_enabled(port) ((port)->unused[0]) + static void clps711xuart_stop_tx(struct uart_port *port, unsigned int tty_stop) { - disable_irq(TX_IRQ(port)); + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + if (tx_enabled(port)) { + disable_irq(TX_IRQ(port)); + tx_enabled(port) = 0; + } + spin_unlock_irqrestore(&port->lock, flags); } static void clps711xuart_start_tx(struct uart_port *port, unsigned int tty_start) { - enable_irq(TX_IRQ(port)); + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + if (!tx_enabled(port)) { + enable_irq(TX_IRQ(port)); + tx_enabled(port) = 1; + } + spin_unlock_irqrestore(&port->lock, flags); } static void clps711xuart_stop_rx(struct uart_port *port) @@ -268,6 +298,8 @@ { unsigned int syscon; int retval; + + tx_enabled(port) = 1; /* * Allocate the IRQs Index: serial_core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_core.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- serial_core.c 12 Apr 2002 21:28:20 -0000 1.21 +++ serial_core.c 18 Jun 2002 22:41:07 -0000 1.22 @@ -538,9 +538,13 @@ struct uart_info *info = tty->driver_data; struct uart_port *port = info->port; - port->x_char = ch; - if (ch) - port->ops->start_tx(port, 0); + if (port->ops->send_xchar) + port->ops->send_xchar(port, ch); + else { + port->x_char = ch; + if (ch) + port->ops->start_tx(port, 0); + } } static void uart_throttle(struct tty_struct *tty) @@ -1844,6 +1848,26 @@ *flow = *s; } +struct baud_rates { + unsigned int rate; + unsigned int cflag; +}; + +static struct baud_rates baud_rates[] = { + { 921600, B921600 }, + { 460800, B460800 }, + { 230400, B230400 }, + { 115200, B115200 }, + { 57600, B57600 }, + { 38400, B38400 }, + { 19200, B19200 }, + { 9600, B9600 }, + { 4800, B4800 }, + { 2400, B2400 }, + { 1200, B1200 }, + { 0, B38400 } +}; + /** * uart_set_options - setup the serial console parameters * @port: pointer to the serial ports uart_port structure @@ -1859,43 +1883,16 @@ { unsigned int cflag = CREAD | HUPCL | CLOCAL; unsigned int quot; + int i; /* * Construct a cflag setting. */ - switch (baud) { - case 1200: - cflag |= B1200; - break; - case 2400: - cflag |= B2400; - break; - case 4800: - cflag |= B4800; - break; - case 9600: - cflag |= B9600; - break; - case 19200: - cflag |= B19200; - break; - default: - cflag |= B38400; - baud = 38400; - break; - case 57600: - cflag |= B57600; - break; - case 115200: - cflag |= B115200; - break; - case 230400: - cflag |= B230400; - break; - case 460800: - cflag |= B460800; - break; - } + for (i = 0; baud_rates[i].rate; i++) + if (baud_rates[i].rate <= baud) + break; + + cflag |= baud_rates[i].cflag; if (bits == 7) cflag |= CS7; @@ -2573,8 +2570,6 @@ EXPORT_SYMBOL(uart_unregister_driver); EXPORT_SYMBOL(uart_register_port); EXPORT_SYMBOL(uart_unregister_port); -EXPORT_SYMBOL(uart_remove_one_port); -EXPORT_SYMBOL(uart_add_one_port); MODULE_DESCRIPTION("Serial driver core"); MODULE_LICENSE("GPL"); Index: serial_sa1100.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_sa1100.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- serial_sa1100.c 14 Mar 2002 20:02:07 -0000 1.18 +++ serial_sa1100.c 18 Jun 2002 22:41:07 -0000 1.19 @@ -803,7 +803,7 @@ sa1100_console_setup(struct console *co, char *options) { struct sa1100_port *sport; - int baud = CONFIG_SA1100_DEFAULT_BAUDRATE; + int baud = 9600; int bits = 8; int parity = 'n'; int flow = 'n'; |