Commit 33c0d1b0 authored by Russell King's avatar Russell King Committed by Linus Torvalds

[PATCH] Serial driver stuff

The serial layer is restructured to allow less code duplication (and
hence bug duplication) across various serial drivers.  Since ARM adds
six extra serial drivers, maintaining six copies of serial.c was not
my idea of fun.

Therefore, we've ended up with a core serial driver, which knows about
the interactions with the tty layer, and low-level hardware drivers,
which know all about the hardware.  The interface between the two is
described in "Documentation/serial/driver".

This patch completely removes the old serial.c driver and its associated
configuration options, as you requested at KS2002.  We keep a certain
amount of configuration compatibility with the per-architecture serial.h
file for the moment; this *will* be killed in the next round of patches.
The biggest user of this is x86, and since I don't have an x86 box to
test this stuff on, I think the changes are best kept separate.
parent ae86a80a
Low Level Serial API
--------------------
$Id: driver,v 1.9 2002/07/06 16:51:43 rmk Exp $
This document is meant as a brief overview of some aspects of the new serial
driver. It is not complete, any questions you have should be directed to
<rmk@arm.linux.org.uk>
The reference implementation is contained within serial_amba.c.
Low Level Serial Hardware Driver
--------------------------------
The low level serial hardware driver is responsible for supplying port
information (defined by uart_port) and a set of control methods (defined
by uart_ops) to the core serial driver. The low level driver is also
responsible for handling interrupts for the port, and providing any
console support.
Console Support
---------------
The serial core provides a few helper functions. This includes identifing
the correct port structure (via uart_get_console) and decoding command line
arguments (uart_parse_options).
Locking
-------
It is the responsibility of the low level hardware driver to perform the
necessary locking using port->lock. There are some exceptions (which
are described in the uart_ops listing below.)
There are three locks. A per-port spinlock, a per-port tmpbuf semaphore,
and an overall semaphore.
From the core driver perspective, the port->lock locks the following
data:
port->mctrl
port->icount
info->xmit.head (circ->head)
info->xmit.tail (circ->tail)
The low level driver is free to use this lock to provide any additional
locking.
The core driver uses the info->tmpbuf_sem lock to prevent multi-threaded
access to the info->tmpbuf bouncebuffer used for port writes.
The port_sem semaphore is used to protect against ports being added/
removed or reconfigured at inappropriate times.
uart_ops
--------
The uart_ops structure is the main interface between serial_core and the
hardware specific driver. It contains all the methods to control the
hardware.
tx_empty(port)
This function tests whether the transmitter fifo and shifter
for the port described by 'port' is empty. If it is empty,
this function should return TIOCSER_TEMT, otherwise return 0.
If the port does not support this operation, then it should
return TIOCSER_TEMT.
Locking: none.
Interrupts: caller dependent.
This call must not sleep
set_mctrl(port, mctrl)
This function sets the modem control lines for port described
by 'port' to the state described by mctrl. The relevant bits
of mctrl are:
- TIOCM_RTS RTS signal.
- TIOCM_DTR DTR signal.
- TIOCM_OUT1 OUT1 signal.
- TIOCM_OUT2 OUT2 signal.
If the appropriate bit is set, the signal should be driven
active. If the bit is clear, the signal should be driven
inactive.
Locking: port->lock taken.
Interrupts: locally disabled.
This call must not sleep
get_mctrl(port)
Returns the current state of modem control inputs. The state
of the outputs should not be returned, since the core keeps
track of their state. The state information should include:
- TIOCM_DCD state of DCD signal
- TIOCM_CTS state of CTS signal
- TIOCM_DSR state of DSR signal
- TIOCM_RI state of RI signal
The bit is set if the signal is currently driven active. If
the port does not support CTS, DCD or DSR, the driver should
indicate that the signal is permanently active. If RI is
not available, the signal should not be indicated as active.
Locking: none.
Interrupts: caller dependent.
This call must not sleep
stop_tx(port,tty_stop)
Stop transmitting characters. This might be due to the CTS
line becoming inactive or the tty layer indicating we want
to stop transmission.
tty_stop: 1 if this call is due to the TTY layer issuing a
TTY stop to the driver (equiv to rs_stop).
Locking: none.
Interrupts: caller dependent.
This call must not sleep
start_tx(port,tty_start)
start transmitting characters. (incidentally, nonempty will
always be nonzero, and shouldn't be used - it will be dropped).
tty_start: 1 if this call was due to the TTY layer issuing
a TTY start to the driver (equiv to rs_start)
Locking: port->lock taken.
Interrupts: locally disabled.
This call must not sleep
stop_rx(port)
Stop receiving characters; the port is in the process of
being closed.
Locking: none.
Interrupts: caller dependent.
This call must not sleep
enable_ms(port)
Enable the modem status interrupts.
Locking: none.
Interrupts: caller dependent.
break_ctl(port,ctl)
Control the transmission of a break signal. If ctl is
nonzero, the break signal should be transmitted. The signal
should be terminated when another call is made with a zero
ctl.
Locking: none.
Interrupts: caller dependent.
This call must not sleep
startup(port)
Grab any interrupt resources and initialise any low level driver
state. Enable the port for reception. It should not activate
RTS nor DTR; this will be done via a separate call to set_mctrl.
Locking: port_sem taken.
Interrupts: globally disabled.
shutdown(port)
Disable the port, disable any break condition that may be in
effect, and free any interrupt resources. It should not disable
RTS nor DTR; this will have already been done via a separate
call to set_mctrl.
Locking: port_sem taken.
Interrupts: caller dependent.
change_speed(port,cflag,iflag,quot)
Change the port parameters, including word length, parity, stop
bits. Update read_status_mask and ignore_status_mask to indicate
the types of events we are interested in receiving. Relevant
cflag bits are:
CSIZE - word size
CSTOPB - 2 stop bits
PARENB - parity enable
PARODD - odd parity (when PARENB is in force)
CREAD - enable reception of characters (if not set,
still receive characters from the port, but
throw them away.
CRTSCTS - if set, enable CTS status change reporting
CLOCAL - if not set, enable modem status change
reporting.
Relevant iflag bits are:
INPCK - enable frame and parity error events to be
passed to the TTY layer.
BRKINT
PARMRK - both of these enable break events to be
passed to the TTY layer.
IGNPAR - ignore parity and framing errors
IGNBRK - ignore break errors, If IGNPAR is also
set, ignore overrun errors as well.
The interaction of the iflag bits is as follows (parity error
given as an example):
Parity error INPCK IGNPAR
None n/a n/a character received
Yes n/a 0 character discarded
Yes 0 1 character received, marked as
TTY_NORMAL
Yes 1 1 character received, marked as
TTY_PARITY
Locking: none.
Interrupts: caller dependent.
This call must not sleep
pm(port,state,oldstate)
perform any power management related activities on the specified
port. state indicates the new state (defined by ACPI D0-D3),
oldstate indicates the previous state. Essentially, D0 means
fully on, D3 means powered down.
This function should not be used to grab any resources.
Locking: none.
Interrupts: caller dependent.
type(port)
Return a pointer to a string constant describing the specified
port, or return NULL, in which case the string 'unknown' is
substituted.
Locking: none.
Interrupts: caller dependent.
release_port(port)
Release any memory and IO region resources currently in use by
the port.
Locking: none.
Interrupts: caller dependent.
request_port(port)
Request any memory and IO region resources required by the port.
If any fail, no resources should be registered when this function
returns, and it should return -EBUSY on failure.
Locking: none.
Interrupts: caller dependent.
config_port(port,type)
Perform any autoconfiguration steps required for the port. `type`
contains a bit mask of the required configuration. UART_CONFIG_TYPE
indicates that the port requires detection and identification.
port->type should be set to the type found, or PORT_UNKNOWN if
no port was detected.
UART_CONFIG_IRQ indicates autoconfiguration of the interrupt signal,
which should be probed using standard kernel autoprobing techniques.
This is not necessary on platforms where ports have interrupts
internally hard wired (eg, system on a chip implementations).
Locking: none.
Interrupts: caller dependent.
verify_port(port,serinfo)
Verify the new serial port information contained within serinfo is
suitable for this port type.
Locking: none.
Interrupts: caller dependent.
ioctl(port,cmd,arg)
Perform any port specific IOCTLs. IOCTL commands must be defined
using the standard numbering system found in <asm/ioctl.h>
Locking: none.
Interrupts: caller dependent.
Other notes
-----------
It is intended some day to drop the 'unused' entries from uart_port, and
allow low level drivers to register their own individual uart_port's with
the core. This will allow drivers to use uart_port as a pointer to a
structure containing both the uart_port entry with their own extensions,
thus:
struct my_port {
struct uart_port port;
int my_stuff;
};
Todo
----
Please see the BUGS file in CVS at
http://cvs.arm.linux.org.uk/cgi/viewcvs.cgi/serial/BUGS
...@@ -212,7 +212,7 @@ export MODLIB ...@@ -212,7 +212,7 @@ export MODLIB
CPPFLAGS := -D__KERNEL__ -I$(HPATH) CPPFLAGS := -D__KERNEL__ -I$(HPATH)
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -g \
-fomit-frame-pointer -fno-strict-aliasing -fno-common -fomit-frame-pointer -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
obj-$(CONFIG_PCI) += pci/ obj-$(CONFIG_PCI) += pci/
obj-$(CONFIG_ACPI) += acpi/ obj-$(CONFIG_ACPI) += acpi/
obj-$(CONFIG_PARPORT) += parport/ obj-$(CONFIG_PARPORT) += parport/
obj-y += base/ char/ block/ misc/ net/ media/ obj-y += base/ serial/ char/ block/ misc/ net/ media/
obj-$(CONFIG_NUBUS) += nubus/ obj-$(CONFIG_NUBUS) += nubus/
obj-$(CONFIG_ATM) += atm/ obj-$(CONFIG_ATM) += atm/
obj-$(CONFIG_IDE) += ide/ obj-$(CONFIG_IDE) += ide/
......
...@@ -8,25 +8,6 @@ bool 'Virtual terminal' CONFIG_VT ...@@ -8,25 +8,6 @@ bool 'Virtual terminal' CONFIG_VT
if [ "$CONFIG_VT" = "y" ]; then if [ "$CONFIG_VT" = "y" ]; then
bool ' Support for console on virtual terminal' CONFIG_VT_CONSOLE bool ' Support for console on virtual terminal' CONFIG_VT_CONSOLE
fi fi
tristate 'Standard/generic (8250/16550 and compatible UARTs) serial support' CONFIG_SERIAL
if [ "$CONFIG_SERIAL" = "y" ]; then
bool ' Support for console on serial port' CONFIG_SERIAL_CONSOLE
if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
tristate ' Atomwide serial port support' CONFIG_ATOMWIDE_SERIAL
tristate ' Dual serial port support' CONFIG_DUALSP_SERIAL
fi
fi
if [ "$CONFIG_ACPI" = "y" -a "$CONFIG_IA64" = "y" ]; then
bool ' Support for serial ports defined by ACPI tables' CONFIG_SERIAL_ACPI
fi
dep_mbool 'Extended dumb serial driver options' CONFIG_SERIAL_EXTENDED $CONFIG_SERIAL
if [ "$CONFIG_SERIAL_EXTENDED" = "y" ]; then
bool ' Support more than 4 serial ports' CONFIG_SERIAL_MANY_PORTS
bool ' Support for sharing serial interrupts' CONFIG_SERIAL_SHARE_IRQ
bool ' Autodetect IRQ on standard ports (unsafe)' CONFIG_SERIAL_DETECT_IRQ
bool ' Support special multiport boards' CONFIG_SERIAL_MULTIPORT
bool ' Support the Bell Technologies HUB6 card' CONFIG_HUB6
fi
bool 'Non-standard serial port support' CONFIG_SERIAL_NONSTANDARD bool 'Non-standard serial port support' CONFIG_SERIAL_NONSTANDARD
if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then
tristate ' Computone IntelliPort Plus serial support' CONFIG_COMPUTONE tristate ' Computone IntelliPort Plus serial support' CONFIG_COMPUTONE
...@@ -85,15 +66,9 @@ fi ...@@ -85,15 +66,9 @@ fi
if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ZORRO" = "y" ]; then if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_ZORRO" = "y" ]; then
tristate 'Commodore A2232 serial support (EXPERIMENTAL)' CONFIG_A2232 tristate 'Commodore A2232 serial support (EXPERIMENTAL)' CONFIG_A2232
fi fi
if [ "$CONFIG_FOOTBRIDGE" = "y" ]; then
bool 'DC21285 serial port support' CONFIG_SERIAL_21285 source drivers/serial/Config.in
if [ "$CONFIG_SERIAL_21285" = "y" ]; then
if [ "$CONFIG_OBSOLETE" = "y" ]; then
bool ' Use /dev/ttyS0 device (OBSOLETE)' CONFIG_SERIAL_21285_OLD
fi
bool ' Console on DC21285 serial port' CONFIG_SERIAL_21285_CONSOLE
fi
fi
bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256 int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256
......
...@@ -13,20 +13,18 @@ obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o raw.o pty.o misc.o random.o ...@@ -13,20 +13,18 @@ obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o raw.o pty.o misc.o random.o
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := busmouse.o console.o keyboard.o sysrq.o \ export-objs := busmouse.o console.o keyboard.o sysrq.o \
misc.o pty.o random.o selection.o serial.o \ misc.o pty.o random.o selection.o \
sonypi.o tty_io.o tty_ioctl.o generic_serial.o rtc.o \ sonypi.o tty_io.o tty_ioctl.o generic_serial.o rtc.o \
ip2main.o ip2main.o
KEYMAP =defkeymap.o KEYMAP =defkeymap.o
KEYBD =pc_keyb.o KEYBD =pc_keyb.o
CONSOLE =console.o CONSOLE =console.o
SERIAL =serial.o
ifeq ($(ARCH),s390) ifeq ($(ARCH),s390)
KEYMAP = KEYMAP =
KEYBD = KEYBD =
CONSOLE = CONSOLE =
SERIAL =
endif endif
ifeq ($(ARCH),mips) ifeq ($(ARCH),mips)
...@@ -39,7 +37,6 @@ ifeq ($(ARCH),s390x) ...@@ -39,7 +37,6 @@ ifeq ($(ARCH),s390x)
KEYMAP = KEYMAP =
KEYBD = KEYBD =
CONSOLE = CONSOLE =
SERIAL =
endif endif
ifeq ($(ARCH),m68k) ifeq ($(ARCH),m68k)
...@@ -48,7 +45,6 @@ ifeq ($(ARCH),m68k) ...@@ -48,7 +45,6 @@ ifeq ($(ARCH),m68k)
else else
KEYBD = KEYBD =
endif endif
SERIAL =
endif endif
ifeq ($(ARCH),arm) ifeq ($(ARCH),arm)
...@@ -96,15 +92,6 @@ endif ...@@ -96,15 +92,6 @@ endif
ifeq ($(CONFIG_BAGET_MIPS),y) ifeq ($(CONFIG_BAGET_MIPS),y)
KEYBD = KEYBD =
SERIAL =
endif
ifeq ($(CONFIG_NINO),y)
SERIAL =
endif
ifneq ($(CONFIG_SUN_SERIAL),)
SERIAL =
endif endif
ifeq ($(CONFIG_QTRONIX_KEYBOARD),y) ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)
...@@ -113,11 +100,7 @@ ifeq ($(CONFIG_QTRONIX_KEYBOARD),y) ...@@ -113,11 +100,7 @@ ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)
endif endif
obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o
obj-$(CONFIG_SERIAL) += $(SERIAL) #obj-$(CONFIG_SERIAL) += $(SERIAL) # Fix for decserial.o
obj-$(CONFIG_SERIAL_ACPI) += acpi_serial.o
obj-$(CONFIG_SERIAL_21285) += serial_21285.o
obj-$(CONFIG_SERIAL_SA1100) += serial_sa1100.o
obj-$(CONFIG_SERIAL_AMBA) += serial_amba.o
ifndef CONFIG_SUN_KEYBOARD ifndef CONFIG_SUN_KEYBOARD
obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD) obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
......
/*
* linux/drivers/char/acpi_serial.c
*
* Copyright (C) 2000 Hewlett-Packard Co.
* Copyright (C) 2000 Khalid Aziz <khalid_aziz@hp.com>
*
* Detect and initialize the headless console serial port defined in
* SPCR table and debug serial port defined in DBGP table
*
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/pm.h>
#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/serial.h>
#include <asm/serial.h>
#include <asm/io.h>
#include <linux/acpi_serial.h>
/*#include <asm/acpi-ext.h>*/
#undef SERIAL_DEBUG_ACPI
/*
* Query ACPI tables for a debug and a headless console serial
* port. If found, add them to rs_table[]. A pointer to either SPCR
* or DBGP table is passed as parameter. This function should be called
* before serial_console_init() is called to make sure the SPCR serial
* console will be available for use. IA-64 kernel calls this function
* from within acpi.c when it encounters SPCR or DBGP tables as it parses
* the ACPI 2.0 tables during bootup.
*
*/
void __init setup_serial_acpi(void *tablep)
{
acpi_ser_t *acpi_ser_p;
struct serial_struct serial_req;
unsigned long iobase;
int global_sys_irq;
#ifdef SERIAL_DEBUG_ACPI
printk("Entering setup_serial_acpi()\n");
#endif
/* Now get the table */
if (tablep == NULL) {
return;
}
acpi_ser_p = (acpi_ser_t *)tablep;
/*
* Perform a sanity check on the table. Table should have a
* signature of "SPCR" or "DBGP" and it should be atleast 52 bytes
* long.
*/
if ((strncmp(acpi_ser_p->signature, ACPI_SPCRT_SIGNATURE,
ACPI_SIG_LEN) != 0) &&
(strncmp(acpi_ser_p->signature, ACPI_DBGPT_SIGNATURE,
ACPI_SIG_LEN) != 0)) {
return;
}
if (acpi_ser_p->length < 52) {
return;
}
iobase = (((u64) acpi_ser_p->base_addr.addrh) << 32) | acpi_ser_p->base_addr.addrl;
global_sys_irq = (acpi_ser_p->global_int[3] << 24) |
(acpi_ser_p->global_int[2] << 16) |
(acpi_ser_p->global_int[1] << 8) |
acpi_ser_p->global_int[0];
#ifdef SERIAL_DEBUG_ACPI
printk("setup_serial_acpi(): table pointer = 0x%p\n", acpi_ser_p);
printk(" sig = '%c%c%c%c'\n",
acpi_ser_p->signature[0],
acpi_ser_p->signature[1],
acpi_ser_p->signature[2],
acpi_ser_p->signature[3]);
printk(" length = %d\n", acpi_ser_p->length);
printk(" Rev = %d\n", acpi_ser_p->rev);
printk(" Interface type = %d\n", acpi_ser_p->intfc_type);
printk(" Base address = 0x%lX\n", iobase);
printk(" IRQ = %d\n", acpi_ser_p->irq);
printk(" Global System Int = %d\n", global_sys_irq);
printk(" Baud rate = ");
switch (acpi_ser_p->baud) {
case ACPI_SERIAL_BAUD_9600:
printk("9600\n");
break;
case ACPI_SERIAL_BAUD_19200:
printk("19200\n");
break;
case ACPI_SERIAL_BAUD_57600:
printk("57600\n");
break;
case ACPI_SERIAL_BAUD_115200:
printk("115200\n");
break;
default:
printk("Huh (%d)\n", acpi_ser_p->baud);
break;
}
if (acpi_ser_p->base_addr.space_id == ACPI_SERIAL_PCICONF_SPACE) {
printk(" PCI serial port:\n");
printk(" Bus %d, Device %d, Vendor ID 0x%x, Dev ID 0x%x\n",
acpi_ser_p->pci_bus, acpi_ser_p->pci_dev,
acpi_ser_p->pci_vendor_id, acpi_ser_p->pci_dev_id);
}
#endif
/*
* Now build a serial_req structure to update the entry in
* rs_table for the headless console port.
*/
switch (acpi_ser_p->intfc_type) {
case ACPI_SERIAL_INTFC_16550:
serial_req.type = PORT_16550;
serial_req.baud_base = BASE_BAUD;
break;
case ACPI_SERIAL_INTFC_16450:
serial_req.type = PORT_16450;
serial_req.baud_base = BASE_BAUD;
break;
default:
serial_req.type = PORT_UNKNOWN;
break;
}
if (strncmp(acpi_ser_p->signature, ACPI_SPCRT_SIGNATURE,
ACPI_SIG_LEN) == 0) {
serial_req.line = ACPI_SERIAL_CONSOLE_PORT;
}
else if (strncmp(acpi_ser_p->signature, ACPI_DBGPT_SIGNATURE,
ACPI_SIG_LEN) == 0) {
serial_req.line = ACPI_SERIAL_DEBUG_PORT;
}
/*
* Check if this is an I/O mapped address or a memory mapped address
*/
if (acpi_ser_p->base_addr.space_id == ACPI_SERIAL_MEM_SPACE) {
serial_req.port = 0;
serial_req.port_high = 0;
serial_req.iomem_base = (void *)ioremap(iobase, 64);
serial_req.io_type = SERIAL_IO_MEM;
}
else if (acpi_ser_p->base_addr.space_id == ACPI_SERIAL_IO_SPACE) {
serial_req.port = (unsigned long) iobase & 0xffffffff;
serial_req.port_high = (unsigned long)(((u64)iobase) >> 32);
serial_req.iomem_base = NULL;
serial_req.io_type = SERIAL_IO_PORT;
}
else if (acpi_ser_p->base_addr.space_id == ACPI_SERIAL_PCICONF_SPACE) {
printk("WARNING: No support for PCI serial console\n");
return;
}
/*
* If the table does not have IRQ information, use 0 for IRQ.
* This will force rs_init() to probe for IRQ.
*/
if (acpi_ser_p->length < 53) {
serial_req.irq = 0;
}
else {
serial_req.flags = ASYNC_SKIP_TEST | ASYNC_BOOT_AUTOCONF |
ASYNC_AUTO_IRQ;
if (acpi_ser_p->int_type &
(ACPI_SERIAL_INT_APIC | ACPI_SERIAL_INT_SAPIC)) {
serial_req.irq = global_sys_irq;
}
else if (acpi_ser_p->int_type & ACPI_SERIAL_INT_PCAT) {
serial_req.irq = acpi_ser_p->irq;
}
else {
/*
* IRQ type not being set would mean UART will
* run in polling mode. Do not probe for IRQ in
* that case.
*/
serial_req.flags = ASYNC_SKIP_TEST|ASYNC_BOOT_AUTOCONF;
}
}
serial_req.xmit_fifo_size = serial_req.custom_divisor = 0;
serial_req.close_delay = serial_req.hub6 = serial_req.closing_wait = 0;
serial_req.iomem_reg_shift = 0;
if (early_serial_setup(&serial_req) < 0) {
printk("early_serial_setup() for ACPI serial console port failed\n");
return;
}
#ifdef SERIAL_DEBUG_ACPI
printk("Leaving setup_serial_acpi()\n");
#endif
}
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
mainmenu_option next_comment mainmenu_option next_comment
comment 'PCMCIA character devices' comment 'PCMCIA character devices'
dep_tristate 'PCMCIA serial device support' CONFIG_PCMCIA_SERIAL_CS $CONFIG_PCMCIA $CONFIG_SERIAL
dep_tristate 'SyncLink PC Card support' CONFIG_SYNCLINK_CS $CONFIG_PCMCIA dep_tristate 'SyncLink PC Card support' CONFIG_SYNCLINK_CS $CONFIG_PCMCIA
endmenu endmenu
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
# Makefile for the Linux PCMCIA char device drivers. # Makefile for the Linux PCMCIA char device drivers.
# #
obj-$(CONFIG_PCMCIA_SERIAL_CS) += serial_cs.o
obj-$(CONFIG_SYNCLINK_CS) += synclink_cs.o obj-$(CONFIG_SYNCLINK_CS) += synclink_cs.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
...@@ -150,8 +150,7 @@ extern void con3215_init(void); ...@@ -150,8 +150,7 @@ extern void con3215_init(void);
extern void tty3215_init(void); extern void tty3215_init(void);
extern void tub3270_con_init(void); extern void tub3270_con_init(void);
extern void tub3270_init(void); extern void tub3270_init(void);
extern void rs285_console_init(void); extern void uart_console_init(void);
extern void sa1100_rs_console_init(void);
extern void sgi_serial_console_init(void); extern void sgi_serial_console_init(void);
extern void sci_console_init(void); extern void sci_console_init(void);
extern void tx3912_console_init(void); extern void tx3912_console_init(void);
...@@ -2221,18 +2220,12 @@ void __init console_init(void) ...@@ -2221,18 +2220,12 @@ void __init console_init(void)
#ifdef CONFIG_STDIO_CONSOLE #ifdef CONFIG_STDIO_CONSOLE
stdio_console_init(); stdio_console_init();
#endif #endif
#ifdef CONFIG_SERIAL_21285_CONSOLE #ifdef CONFIG_SERIAL_CORE_CONSOLE
rs285_console_init(); uart_console_init();
#endif
#ifdef CONFIG_SERIAL_SA1100_CONSOLE
sa1100_rs_console_init();
#endif #endif
#ifdef CONFIG_ARC_CONSOLE #ifdef CONFIG_ARC_CONSOLE
arc_console_init(); arc_console_init();
#endif #endif
#ifdef CONFIG_SERIAL_AMBA_CONSOLE
ambauart_console_init();
#endif
#ifdef CONFIG_SERIAL_TX3912_CONSOLE #ifdef CONFIG_SERIAL_TX3912_CONSOLE
tx3912_console_init(); tx3912_console_init();
#endif #endif
......
# $Id: Config.help,v 1.5 2002/07/06 17:16:24 rmk 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_CS
Say Y here to enable support for 16-bit PCMCIA serial devices,
including serial port cards, modems, and the modem functions of
multi-function Ethernet/modem cards. (PCMCIA- or PC-cards are
credit-card size devices often used with laptops.)
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called serial_cs.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
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_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.
#
# Serial device configuration
#
# $Id: Config.in,v 1.15 2002/07/06 17:16:24 rmk Exp $
#
mainmenu_option next_comment
comment 'Serial drivers'
#
# 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 ' 8250/16550 PCMCIA device support' CONFIG_SERIAL_8250_CS $CONFIG_PCMCIA $CONFIG_SERIAL_8250
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
comment 'Non-8250 serial port support'
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_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_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
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
#
# Makefile for the kernel serial device drivers.
#
# $Id: Makefile,v 1.7 2002/07/06 17:16:24 rmk Exp $
#
export-objs := serial_core.o serial_8250.o
serial-8250-y :=
serial-8250-$(CONFIG_PCI) += serial_8250_pci.o
serial-8250-$(CONFIG_ISAPNP) += serial_8250_pnp.o
obj-$(CONFIG_SERIAL_CORE) += serial_core.o
obj-$(CONFIG_SERIAL_21285) += serial_21285.o
obj-$(CONFIG_SERIAL_8250) += serial_8250.o $(serial-8250-y)
obj-$(CONFIG_SERIAL_8250_CS) += serial_8250_cs.o
obj-$(CONFIG_SERIAL_ANAKIN) += serial_anakin.o
obj-$(CONFIG_SERIAL_AMBA) += serial_amba.o
obj-$(CONFIG_SERIAL_CLPS711X) += serial_clps711x.o
obj-$(CONFIG_SERIAL_SA1100) += serial_sa1100.o
obj-$(CONFIG_SERIAL_UART00) += serial_uart00.o
include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
/*
* linux/drivers/char/serial_8250.h
*
* Driver for 8250/16550-type serial ports
*
* Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
*
* Copyright (C) 2001 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* $Id: serial_8250.h,v 1.7 2002/07/06 16:24:46 rmk Exp $
*/
#include <linux/config.h>
struct serial8250_probe {
struct module *owner;
int (*pci_init_one)(struct pci_dev *dev);
void (*pci_remove_one)(struct pci_dev *dev);
void (*pnp_init)(void);
};
int serial8250_register_probe(struct serial8250_probe *probe);
void serial8250_unregister_probe(struct serial8250_probe *probe);
void serial8250_get_irq_map(unsigned int *map);
struct old_serial_port {
unsigned int uart;
unsigned int base_baud;
unsigned int port;
unsigned int irq;
unsigned int flags;
};
#undef SERIAL_DEBUG_PCI
#if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
#define SERIAL_INLINE
#endif
#ifdef SERIAL_INLINE
#define _INLINE_ inline
#else
#define _INLINE_
#endif
#define PROBE_RSA (1 << 0)
#define PROBE_ANY (~0)
#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
#ifdef CONFIG_SERIAL_8250_SHARE_IRQ
#define SERIAL8250_SHARE_IRQS 1
#else
#define SERIAL8250_SHARE_IRQS 0
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment