bk://bk.arm.linux.org.uk/linux-2.6-serial
rmk@flint.arm.linux.org.uk|ChangeSet|20050324211051|14553 rmk

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/24 21:10:51+00:00 rmk@flint.arm.linux.org.uk 
#   [SERIAL] Remove SERIAL_INLINE, and move debug macro to 8250_pci.c
#   
#   This removes the unnecessary SERIAL_INLINE macro, and moves
#   SERIAL_DEBUG_PCI to 8250_pci.c
#   
#   Signed-off-by: Russell King <rmk@arm.linux.org.uk>
# 
# drivers/serial/8250_pci.c
#   2005/03/24 21:05:59+00:00 rmk@flint.arm.linux.org.uk +2 -0
#   Add SERIAL_DEBUG_PCI from drivers/serial/8250.h
# 
# drivers/serial/8250.h
#   2005/03/24 21:05:59+00:00 rmk@flint.arm.linux.org.uk +0 -6
#   Remove SERIAL_INLINE.
#   Move SERIAL_DEBUG_PCI to drivers/serial/8250_pci.c
# 
# ChangeSet
#   2005/03/24 16:22:25+00:00 rmk@flint.arm.linux.org.uk 
#   [SERIAL] Add UART_CAP_UUE
#   
#   Rather than relying on port->type == PORT_XSCALE, determine when we
#   need to set UUE via a capability.
#   
#   Signed-off-by: Russell King <rmk@arm.linux.org.uk>
# 
# drivers/serial/8250.h
#   2005/03/24 16:16:39+00:00 rmk@flint.arm.linux.org.uk +1 -0
#   Add UART_CAP_UUE
# 
# drivers/serial/8250.c
#   2005/03/24 16:16:39+00:00 rmk@flint.arm.linux.org.uk +4 -3
#   Add UART_CAP_UUE for Xscale UARTs, to enable UART_IER_UUE as
#   appropriate.
# 
# ChangeSet
#   2005/03/24 12:18:28+00:00 rmk@flint.arm.linux.org.uk 
#   [SERIAL] au1x00_uart: remove duplicate serial registration functions
#   
#   au1x00_uart doesn't need to provide duplicated 8250 registration
#   functions.  Remove them.
#   
#   Signed-off-by: Russell King <rmk@arm.linux.org.uk>
# 
# drivers/serial/au1x00_uart.c
#   2005/03/24 12:08:52+00:00 rmk@flint.arm.linux.org.uk +0 -65
#   Remove duplicate __register_serial/register_serial/unregister_serial
# 
# ChangeSet
#   2005/03/24 11:58:57+00:00 rmk@flint.arm.linux.org.uk 
#   [SERIAL] Set port.dev to PCMCIA device.
#   
#   Since serial_cs provides power management callbacks, we should not use
#   the fallback methods in 8250.c.  We tell 8250.c about this when we
#   associate a struct device with the port, and, since we now have such
#   a beast, use it.
#   
#   This also makes sysfs indicate which port is associated with which
#   PCMCIA device.
#   
#   Signed-off-by: Russell King <rmk@arm.linux.org.uk>
# 
# drivers/serial/serial_cs.c
#   2005/03/24 11:53:01+00:00 rmk@flint.arm.linux.org.uk +9 -7
#   Set port.dev to PCMCIA device.
# 
# ChangeSet
#   2005/03/24 11:34:14+00:00 rmk@flint.arm.linux.org.uk 
#   [SERIAL] Allow drivers to use uart_match_port
#   
#   This removes the duplicate of uart_match_port in 8250.c
#   
#   Signed-off-by: Russell King <rmk@arm.linux.org.uk>
# 
# include/linux/serial_core.h
#   2005/03/24 11:28:52+00:00 rmk@flint.arm.linux.org.uk +1 -0
#   Add uart_match_port prototype
# 
# drivers/serial/serial_core.c
#   2005/03/24 11:28:52+00:00 rmk@flint.arm.linux.org.uk +2 -1
#   Export uart_match_port
# 
# drivers/serial/8250.c
#   2005/03/24 11:28:51+00:00 rmk@flint.arm.linux.org.uk +0 -20
#   Remove local copy of uart_match_port()
# 
# ChangeSet
#   2005/03/19 18:26:40+00:00 dick@com.rmk.(none) 
#   [SERIAL] sealevel 8 port RS-232/RS-422/RS-485 board
#   
#   Patch from Dick Hollenbeck
#   
#   Vendor Sealevel suggested these changes for its new board.  Tried
#   them, they work with the card.  Please apply the patch below, which
#   was made from 2.6.10 but can be applied to 2.6.11.2 without errors.
# 
# include/linux/pci_ids.h
#   2005/03/19 18:20:34+00:00 dick@com.rmk.(none) +1 -0
#   [PATCH] sealevel 8 port RS-232/RS-422/RS-485 board
# 
# drivers/serial/8250_pci.c
#   2005/03/19 18:20:34+00:00 dick@com.rmk.(none) +3 -0
#   [PATCH] sealevel 8 port RS-232/RS-422/RS-485 board
# 
# drivers/pci/pci.ids
#   2005/03/19 18:20:32+00:00 dick@com.rmk.(none) +1 -0
#   [PATCH] sealevel 8 port RS-232/RS-422/RS-485 board
# 
# ChangeSet
#   2005/03/19 16:22:50+00:00 afong@org.rmk.(none) 
#   [SERIAL] 8250/sbc8560 bug/fix
#   
#   Patch from Amy Fong
#   
#   On the sbc8560 platform, changes were introduced as of 2.6.10-rc2
#   which caused the sbc8560 to splutter noise all over the serial
#   console.  It seems that ALPHA_KLUDGE_MCR was mulitply and differently
#   defined in both drivers/serial/8250.h and include/linux/serialP.h
#    
#   Below is a patch that clones the definition of ALPHA_KLUDGE_MCR from
#   serialP.h, it has been tested and works on the sbc8560.
# 
# drivers/serial/8250.h
#   2005/03/19 16:17:38+00:00 afong@org.rmk.(none) +7 -0
#   [PATCH] 8250/sbc8560 bug/fix
# 
# ChangeSet
#   2005/03/19 16:11:36+00:00 alex.williamson@com.rmk.(none) 
#   [SERIAL] new hp diva console port
#   
#   Patch from Alex Williamson
#   
#   The patch below adds IDs and setup for a new PCI Diva console port.
#   This device provides a single UART described by PCI Bar 1.  ID already
#   submitted to pciids.sf.net.
#   
#   Signed-off-by: Alex Williamson
# 
# include/linux/pci_ids.h
#   2005/03/19 16:06:09+00:00 alex.williamson@com.rmk.(none) +1 -0
#   [PATCH] new hp diva console port
# 
# drivers/serial/8250_pci.c
#   2005/03/19 16:06:08+00:00 alex.williamson@com.rmk.(none) +3 -0
#   [PATCH] new hp diva console port
# 
# drivers/pci/pci.ids
#   2005/03/19 16:06:07+00:00 alex.williamson@com.rmk.(none) +1 -0
#   [PATCH] new hp diva console port
# 
diff -Nru a/drivers/pci/pci.ids b/drivers/pci/pci.ids
--- a/drivers/pci/pci.ids	2005-03-24 18:19:24 -08:00
+++ b/drivers/pci/pci.ids	2005-03-24 18:19:24 -08:00
@@ -1812,6 +1812,7 @@
 		103c 1226  Keystone SP2
 		103c 1227  Powerbar SP2
 		103c 1282  Everest SP2
+		103c 1301  Diva RMP3
 	1054  PCI Local Bus Adapter
 	1064  79C970 PCnet Ethernet Controller
 	108b  Visualize FXe
@@ -6304,6 +6305,7 @@
 	7401  Four Port RS-232 Interface
 	7402  Four Port RS-422/485 Interface
 	7801  Eight Port RS-232 Interface
+	7804  Eight Port RS-232/422/485 Interface
 	8001  8001 Digital I/O Adapter
 135f  I-Data International A-S
 1360  Meinberg Funkuhren
diff -Nru a/drivers/serial/8250.c b/drivers/serial/8250.c
--- a/drivers/serial/8250.c	2005-03-24 18:19:24 -08:00
+++ b/drivers/serial/8250.c	2005-03-24 18:19:24 -08:00
@@ -261,7 +261,7 @@
 		.fifo_size	= 32,
 		.tx_loadsz	= 32,
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
-		.flags		= UART_CAP_FIFO,
+		.flags		= UART_CAP_FIFO | UART_CAP_UUE,
 	},
 };
 
@@ -762,6 +762,7 @@
 			 */
 			DEBUG_AUTOCONF("Xscale ");
 			up->port.type = PORT_XSCALE;
+			up->capabilities |= UART_CAP_UUE;
 			return;
 		}
 	} else {
@@ -1750,7 +1751,7 @@
 	up->ier &= ~UART_IER_MSI;
 	if (UART_ENABLE_MS(&up->port, termios->c_cflag))
 		up->ier |= UART_IER_MSI;
-	if (up->port.type == PORT_XSCALE)
+	if (up->capabilities & UART_CAP_UUE)
 		up->ier |= UART_IER_UUE | UART_IER_RTOIE;
 
 	serial_out(up, UART_IER, up->ier);
@@ -2119,7 +2120,7 @@
 	 */
 	ier = serial_in(up, UART_IER);
 
-	if (up->port.type == PORT_XSCALE)
+	if (up->capabilities & UART_CAP_UUE)
 		serial_out(up, UART_IER, UART_IER_UUE);
 	else
 		serial_out(up, UART_IER, 0);
@@ -2387,26 +2388,6 @@
  * modems and PCI multiport cards.
  */
 static DECLARE_MUTEX(serial_sem);
-
-/*
- *	Are the two ports equivalent?
- */
-static int uart_match_port(struct uart_port *port1, struct uart_port *port2)
-{
-	if (port1->iotype != port2->iotype)
-		return 0;
-
-	switch (port1->iotype) {
-	case UPIO_PORT:
-		return (port1->iobase == port2->iobase);
-	case UPIO_HUB6:
-		return (port1->iobase == port2->iobase) &&
-		       (port1->hub6   == port2->hub6);
-	case UPIO_MEM:
-		return (port1->membase == port2->membase);
-	}
-	return 0;
-}
 
 static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *port)
 {
diff -Nru a/drivers/serial/8250.h b/drivers/serial/8250.h
--- a/drivers/serial/8250.h	2005-03-24 18:19:24 -08:00
+++ b/drivers/serial/8250.h	2005-03-24 18:19:24 -08:00
@@ -49,14 +49,9 @@
 #define UART_CAP_EFR	(1 << 9)	/* UART has EFR */
 #define UART_CAP_SLEEP	(1 << 10)	/* UART has IER sleep */
 #define UART_CAP_AFE	(1 << 11)	/* MCR-based hw flow control */
-
-#undef SERIAL_DEBUG_PCI
+#define UART_CAP_UUE	(1 << 12)	/* UART needs IER bit 6 set (Xscale) */
 
 #if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
-#define SERIAL_INLINE
-#endif
-  
-#ifdef SERIAL_INLINE
 #define _INLINE_ inline
 #else
 #define _INLINE_
@@ -80,6 +75,13 @@
  * is cleared, the machine locks up with endless interrupts.
  */
 #define ALPHA_KLUDGE_MCR  (UART_MCR_OUT2 | UART_MCR_OUT1)
+#elif defined(CONFIG_SBC8560)
+/*
+ * WindRiver did something similarly broken on their SBC8560 board. The
+ * UART tristates its IRQ output while OUT2 is clear, but they pulled
+ * the interrupt line _up_ instead of down, so if we register the IRQ
+ * while the UART is in that state, we die in an IRQ storm. */
+#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
 #else
 #define ALPHA_KLUDGE_MCR 0
 #endif
diff -Nru a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
--- a/drivers/serial/8250_pci.c	2005-03-24 18:19:24 -08:00
+++ b/drivers/serial/8250_pci.c	2005-03-24 18:19:24 -08:00
@@ -31,6 +31,8 @@
 
 #include "8250.h"
 
+#undef SERIAL_DEBUG_PCI
+
 /*
  * Definitions for PCI support.
  */
@@ -1877,6 +1879,9 @@
 	{	PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 		pbn_b2_8_115200 },
+	{	PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+		pbn_b2_8_115200 },
 
 	{	PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
@@ -2184,6 +2189,9 @@
 	/*
 	 * HP Diva card
 	 */
+	{	PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
+		PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA_RMP3, 0, 0,
+		pbn_b1_1_115200 },
 	{	PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_DIVA,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b0_5_115200 },
diff -Nru a/drivers/serial/au1x00_uart.c b/drivers/serial/au1x00_uart.c
--- a/drivers/serial/au1x00_uart.c	2005-03-24 18:19:24 -08:00
+++ b/drivers/serial/au1x00_uart.c	2005-03-24 18:19:24 -08:00
@@ -1242,57 +1242,6 @@
 	.cons			= SERIAL8250_CONSOLE,
 };
 
-/*
- * register_serial and unregister_serial allows for 16x50 serial ports to be
- * configured at run-time, to support PCMCIA modems.
- */
-
-static int __register_serial(struct serial_struct *req, int line)
-{
-	struct uart_port port;
-
-	port.iobase   = req->port;
-	port.membase  = req->iomem_base;
-	port.irq      = req->irq;
-	port.uartclk  = req->baud_base * 16;
-	port.fifosize = req->xmit_fifo_size;
-	port.regshift = req->iomem_reg_shift;
-	port.iotype   = req->io_type;
-	port.flags    = req->flags | UPF_BOOT_AUTOCONF;
-	port.mapbase  = req->iomap_base;
-	port.line     = line;
-
-	if (HIGH_BITS_OFFSET)
-		port.iobase |= (long) req->port_high << HIGH_BITS_OFFSET;
-
-	/*
-	 * If a clock rate wasn't specified by the low level
-	 * driver, then default to the standard clock rate.
-	 */
-	if (port.uartclk == 0)
-		port.uartclk = BASE_BAUD * 16;
-
-	return uart_register_port(&serial8250_reg, &port);
-}
-
-/**
- *	register_serial - configure a 16x50 serial port at runtime
- *	@req: request structure
- *
- *	Configure the serial port specified by the request. If the
- *	port exists and is in use an error is returned. If the port
- *	is not currently in the table it is added.
- *
- *	The port is then probed and if necessary the IRQ is autodetected
- *	If this fails an error is returned.
- *
- *	On success the port is ready to use and the line number is returned.
- */
-int register_serial(struct serial_struct *req)
-{
-	return __register_serial(req, -1);
-}
-
 int __init early_serial_setup(struct uart_port *port)
 {
 	serial8250_isa_init_ports();
@@ -1302,18 +1251,6 @@
 }
 
 /**
- *	unregister_serial - remove a 16x50 serial port at runtime
- *	@line: serial line number
- *
- *	Remove one serial port.  This may be called from interrupt
- *	context.
- */
-void unregister_serial(int line)
-{
-	uart_unregister_port(&serial8250_reg, line);
-}
-
-/**
  *	serial8250_suspend_port - suspend one serial port
  *	@line:  serial line number
  *      @level: the level of port suspension, as per uart_suspend_port
@@ -1366,8 +1303,6 @@
 module_init(serial8250_init);
 module_exit(serial8250_exit);
 
-EXPORT_SYMBOL(register_serial);
-EXPORT_SYMBOL(unregister_serial);
 EXPORT_SYMBOL(serial8250_suspend_port);
 EXPORT_SYMBOL(serial8250_resume_port);
 
diff -Nru a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
--- a/drivers/serial/serial_core.c	2005-03-24 18:19:24 -08:00
+++ b/drivers/serial/serial_core.c	2005-03-24 18:19:24 -08:00
@@ -2233,7 +2233,7 @@
 /*
  *	Are the two ports equivalent?
  */
-static int uart_match_port(struct uart_port *port1, struct uart_port *port2)
+int uart_match_port(struct uart_port *port1, struct uart_port *port2)
 {
 	if (port1->iotype != port2->iotype)
 		return 0;
@@ -2249,6 +2249,7 @@
 	}
 	return 0;
 }
+EXPORT_SYMBOL(uart_match_port);
 
 /*
  *	Try to find an unused uart_state slot for a port.
diff -Nru a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
--- a/drivers/serial/serial_cs.c	2005-03-24 18:19:24 -08:00
+++ b/drivers/serial/serial_cs.c	2005-03-24 18:19:24 -08:00
@@ -289,7 +289,8 @@
 
 /*====================================================================*/
 
-static int setup_serial(struct serial_info * info, kio_addr_t iobase, int irq)
+static int setup_serial(client_handle_t handle, struct serial_info * info,
+			kio_addr_t iobase, int irq)
 {
 	struct uart_port port;
 	int line;
@@ -299,6 +300,7 @@
 	port.irq = irq;
 	port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
 	port.uartclk = 1843200;
+	port.dev = &handle_to_dev(handle);
 	if (buggy_uart)
 		port.flags |= UPF_BUGGY_UART;
 	line = serial8250_register_port(&port);
@@ -376,7 +378,7 @@
 			info->slave = 1;
 		}
 		if (info->slave)
-			return setup_serial(info, port, config.AssignedIRQ);
+			return setup_serial(handle, info, port, config.AssignedIRQ);
 	}
 	link->conf.Vcc = config.Vcc;
 
@@ -451,7 +453,7 @@
 		return -1;
 	}
 
-	return setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ);
+	return setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ);
 }
 
 static int multi_config(dev_link_t * link)
@@ -546,21 +548,21 @@
 	   8 registers are for the UART, the others are extra registers */
 	if (info->manfid == MANFID_OXSEMI) {
 		if (cf->index == 1 || cf->index == 3) {
-			setup_serial(info, base2, link->irq.AssignedIRQ);
+			setup_serial(handle, info, base2, link->irq.AssignedIRQ);
 			outb(12, link->io.BasePort1 + 1);
 		} else {
-			setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ);
+			setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ);
 			outb(12, base2 + 1);
 		}
 		return 0;
 	}
 
-	setup_serial(info, link->io.BasePort1, link->irq.AssignedIRQ);
+	setup_serial(handle, info, link->io.BasePort1, link->irq.AssignedIRQ);
 	/* The Nokia cards are not really multiport cards */
 	if (info->manfid == MANFID_NOKIA)
 		return 0;
 	for (i = 0; i < info->multi - 1; i++)
-		setup_serial(info, base2 + (8 * i), link->irq.AssignedIRQ);
+		setup_serial(handle, info, base2 + (8 * i), link->irq.AssignedIRQ);
 
 	return 0;
 }
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	2005-03-24 18:19:24 -08:00
+++ b/include/linux/pci_ids.h	2005-03-24 18:19:24 -08:00
@@ -709,6 +709,7 @@
 #define PCI_DEVICE_ID_HP_SX1000_IOC	0x127c
 #define PCI_DEVICE_ID_HP_DIVA_EVEREST	0x1282
 #define PCI_DEVICE_ID_HP_DIVA_AUX	0x1290
+#define PCI_DEVICE_ID_HP_DIVA_RMP3	0x1301
 #define PCI_DEVICE_ID_HP_CISSA		0x3220
 #define PCI_DEVICE_ID_HP_CISSB		0x3230
 #define PCI_DEVICE_ID_HP_ZX2_IOC	0x4031
@@ -1908,6 +1909,7 @@
 #define PCI_DEVICE_ID_SEALEVEL_UCOMM232	0x7202
 #define PCI_DEVICE_ID_SEALEVEL_COMM4	0x7401
 #define PCI_DEVICE_ID_SEALEVEL_COMM8	0x7801
+#define PCI_DEVICE_ID_SEALEVEL_UCOMM8	0x7804
 
 #define PCI_VENDOR_ID_HYPERCOPE		0x1365
 #define PCI_DEVICE_ID_HYPERCOPE_PLX	0x9050
diff -Nru a/include/linux/serial_core.h b/include/linux/serial_core.h
--- a/include/linux/serial_core.h	2005-03-24 18:19:24 -08:00
+++ b/include/linux/serial_core.h	2005-03-24 18:19:24 -08:00
@@ -357,6 +357,7 @@
 int uart_register_port(struct uart_driver *reg, struct uart_port *port);
 int uart_add_one_port(struct uart_driver *reg, struct uart_port *port);
 int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port);
+int uart_match_port(struct uart_port *port1, struct uart_port *port2);
 
 /*
  * Power Management