From 3ec9c59449744dcc390d593a017d30671546fd9e Mon Sep 17 00:00:00 2001 From: Andrey Panin Date: Thu, 2 Feb 2006 20:15:09 +0000 Subject: [SERIAL] SIIG 8-port serial boards support This patch adds support for SIIG 8-port boards. These boards have 4 ports in separate bars and another 4 ports in the single bar. Because of this strange port arrangement these cards need special setup function. Fortunately no other SIIG cards have more than 4 port, so this setup function could be used for them too. Signed-off-by: Andrey Panin Signed-off-by: Russell King --- drivers/serial/8250_pci.c | 25 ++++++++++++++++++++++++- include/linux/pci_ids.h | 3 +++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index 2a912153321e..bb9ec28ccc2b 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c @@ -439,6 +439,20 @@ static int pci_siig_init(struct pci_dev *dev) return -ENODEV; } +static int pci_siig_setup(struct serial_private *priv, + struct pciserial_board *board, + struct uart_port *port, int idx) +{ + unsigned int bar = FL_GET_BASE(board->flags) + idx, offset = 0; + + if (idx > 3) { + bar = 4; + offset = (idx - 4) * 8; + } + + return setup_port(priv, port, bar, offset, 0); +} + /* * Timedia has an explosion of boards, and to avoid the PCI table from * growing *huge*, we use this function to collapse some 70 entries @@ -748,7 +762,7 @@ static struct pci_serial_quirk pci_serial_quirks[] = { .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, .init = pci_siig_init, - .setup = pci_default_setup, + .setup = pci_siig_setup, }, /* * Titan cards @@ -2141,6 +2155,15 @@ static struct pci_device_id serial_pci_tbl[] = { { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_4S_20x_850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b0_bt_4_921600 }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_550, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b0_bt_8_921600 }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_650, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b0_bt_8_921600 }, + { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_8S_20x_850, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b0_bt_8_921600 }, /* * Computone devices submitted by Doug McNash dmcnash@computone.com diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b0b908f583c5..92a619ba163f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1670,6 +1670,9 @@ #define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060 #define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 #define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 +#define PCI_DEVICE_ID_SIIG_8S_20x_550 0x2080 +#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 +#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 #define PCI_VENDOR_ID_RADISYS 0x1331 -- cgit v1.2.3 From 9c0f4755bd5a117595761c95b93c29e8d9ca07b5 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Thu, 2 Feb 2006 20:53:39 +0000 Subject: [SERIAL] initialize spinlock for port failed to setup console It seems serial_core intend to initialize port->lock just once for each ports. This is done in uart_set_options() for console, and in uart_add_one_port() for other ports. But there is a case the port->lock is not initialized by serial_core. If the setup function for the console was failed, it will not call uart_set_options() but the port is marked as console (uart_console(port) returns 1). It can happen if console was PCI port which can not detected at the time of register_console. This patch is to initialize port->lock for such console port. With this change, most of spin_lock_init() (some of them are labeled "Temporary fix.") in low-level serial drivers can be omitted. Signed-off-by: Atsushi Nemoto Signed-off-by: Andrew Morton Signed-off-by: Russell King --- drivers/serial/serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 0717abfdae06..95fb4939c675 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -2237,7 +2237,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) * If this port is a console, then the spinlock is already * initialised. */ - if (!uart_console(port)) + if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) spin_lock_init(&port->lock); uart_configure_port(drv, state, port); -- cgit v1.2.3 From 9a8ffccf3d282ee749210232465f61e1c48b7a86 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 3 Feb 2006 22:05:42 +0000 Subject: [SERIAL] 8250: limit range of runtime ports Prevent SERIAL_8250_RUNTIME_UARTS being larger than SERIAL_8250_NR_UARTS. Signed-off-by: Russell King --- drivers/serial/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 0d38f0f2ae29..42d1de155292 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -98,6 +98,7 @@ config SERIAL_8250_NR_UARTS config SERIAL_8250_RUNTIME_UARTS int "Number of 8250/16550 serial ports to register at runtime" depends on SERIAL_8250 + range 0 SERIAL_8250_NR_UARTS default "4" help Set this to the maximum number of serial ports you want -- cgit v1.2.3