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

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/03/30 12:48:17-08:00 akpm@bix.(none) 
#   Merge bk://bk.arm.linux.org.uk/linux-2.6-serial
#   into bix.(none):/usr/src/bk-serial
# 
# drivers/serial/8250.c
#   2005/03/30 12:48:12-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2005/03/30 12:22:42+01:00 rmk@flint.arm.linux.org.uk 
#   [SERIAL] Remove serial8250_late_console_init
#   
#   The serial core will try to register the console each time a port
#   is registered with it.  This makes serial8250_late_console_init
#   redundant, so remove it.
#   
#   Signed-off-by: Russell King <rmk@arm.linux.org.uk>
# 
# drivers/serial/8250.c
#   2005/03/30 12:14:23+01:00 rmk@flint.arm.linux.org.uk +0 -8
#   Remove serial8250_late_console_init
# 
# ChangeSet
#   2005/03/30 09:49:58+01:00 takata@org.rmk.(none) 
#   [SERIAL] m32r_sio driver update
#   
#   Patch from Hirokazu Takata
#   
#   m32r_sio driver updates:
#   - Move m32r_sio specific description from asm-m32r/serial.h to
#     driver/serial/m32r_sio.c.
#   - Remove __register_m32r_sio, register_m32r_sio and unregister_m32r_sio
#     from driver/serial/m32r_sio.c.
#   
#   Signed-off-by: Hirokazu Takata
# 
# drivers/serial/m32r_sio.c
#   2005/03/30 09:34:32+01:00 takata@org.rmk.(none) +29 -102
#   [PATCH] m32r_sio driver update
# 
# include/asm-m32r/serial.h
#   2005/03/30 09:34:15+01:00 takata@org.rmk.(none) +2 -39
#   [PATCH] m32r_sio driver update
# 
diff -Nru a/drivers/serial/8250.c b/drivers/serial/8250.c
--- a/drivers/serial/8250.c	2005-03-30 17:39:03 -08:00
+++ b/drivers/serial/8250.c	2005-03-30 17:39:03 -08:00
@@ -2194,14 +2194,6 @@
 }
 console_initcall(serial8250_console_init);
 
-static int __init serial8250_late_console_init(void)
-{
-	if (!(serial8250_console.flags & CON_ENABLED))
-		register_console(&serial8250_console);
-	return 0;
-}
-late_initcall(serial8250_late_console_init);
-
 static int __init find_port(struct uart_port *p)
 {
 	int line;
diff -Nru a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
--- a/drivers/serial/m32r_sio.c	2005-03-30 17:39:03 -08:00
+++ b/drivers/serial/m32r_sio.c	2005-03-30 17:39:03 -08:00
@@ -54,13 +54,6 @@
 #include "m32r_sio_reg.h"
 
 /*
- * Configuration:
- *   share_irqs - whether we pass SA_SHIRQ to request_irq().  This option
- *                is unsafe when used on edge-triggered interrupts.
- */
-unsigned int share_irqs_sio = M32R_SIO_SHARE_IRQS;
-
-/*
  * Debugging.
  */
 #if 0
@@ -86,15 +79,36 @@
 
 #include <asm/serial.h>
 
+/* Standard COM flags */
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
 /*
  * SERIAL_PORT_DFNS tells us about built-in ports that have no
  * standard enumeration mechanism.   Platforms that can find all
  * serial ports via mechanisms like ACPI or PCI need not supply it.
  */
-#ifndef SERIAL_PORT_DFNS
-#define SERIAL_PORT_DFNS
+#undef SERIAL_PORT_DFNS
+#if defined(CONFIG_PLAT_USRV)
+
+#define SERIAL_PORT_DFNS						\
+       /* UART  CLK     PORT   IRQ            FLAGS */			\
+	{ 0, BASE_BAUD, 0x3F8, PLD_IRQ_UART0, STD_COM_FLAGS }, /* ttyS0 */ \
+	{ 0, BASE_BAUD, 0x2F8, PLD_IRQ_UART1, STD_COM_FLAGS }, /* ttyS1 */
+
+#else /* !CONFIG_PLAT_USRV */
+
+#if defined(CONFIG_SERIAL_M32R_PLDSIO)
+#define SERIAL_PORT_DFNS						\
+	{ 0, BASE_BAUD, ((unsigned long)PLD_ESIO0CR), PLD_IRQ_SIO0_RCV,	\
+	  STD_COM_FLAGS }, /* ttyS0 */
+#else
+#define SERIAL_PORT_DFNS						\
+	{ 0, BASE_BAUD, M32R_SIO_OFFSET, M32R_IRQ_SIO0_R,		\
+	  STD_COM_FLAGS }, /* ttyS0 */
 #endif
 
+#endif /* !CONFIG_PLAT_USRV */
+
 static struct old_serial_port old_serial_port[] = {
 	SERIAL_PORT_DFNS	/* defined in asm/serial.h */
 };
@@ -581,10 +595,7 @@
 }
 
 /*
- * This function is used to handle ports that do not have an
- * interrupt.  This doesn't work very well for 16450's, but gives
- * barely passable results for a 16550A.  (Although at the expense
- * of much CPU overhead).
+ * This function is used to handle ports that do not have an interrupt.
  */
 static void m32r_sio_timeout(unsigned long data)
 {
@@ -966,7 +977,7 @@
 
 static struct uart_sio_port m32r_sio_ports[UART_NR];
 
-static void __init m32r_sio_isa_init_ports(void)
+static void __init m32r_sio_init_ports(void)
 {
 	struct uart_sio_port *up;
 	static int first = 1;
@@ -986,8 +997,6 @@
 		up->port.iotype   = old_serial_port[i].io_type;
 		up->port.regshift = old_serial_port[i].iomem_reg_shift;
 		up->port.ops      = &m32r_sio_pops;
-		if (share_irqs_sio)
-			up->port.flags |= UPF_SHARE_IRQ;
 	}
 }
 
@@ -995,7 +1004,7 @@
 {
 	int i;
 
-	m32r_sio_isa_init_ports();
+	m32r_sio_init_ports();
 
 	for (i = 0; i < UART_NR; i++) {
 		struct uart_sio_port *up = &m32r_sio_ports[i];
@@ -1129,7 +1138,7 @@
 {
 	sio_reset();
 	sio_init();
-	m32r_sio_isa_init_ports();
+	m32r_sio_init_ports();
 	register_console(&m32r_sio_console);
 	return 0;
 }
@@ -1151,81 +1160,6 @@
 	.cons			= M32R_SIO_CONSOLE,
 };
 
-/*
- * register_serial and unregister_serial allows for 16x50 serial ports to be
- * configured at run-time, to support PCMCIA modems.
- */
-
-static int __register_m32r_sio(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 (share_irqs_sio)
-		port.flags |= UPF_SHARE_IRQ;
-
-	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(&m32r_sio_reg, &port);
-}
-
-/**
- *	register_m32r_sio - 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_m32r_sio(struct serial_struct *req)
-{
-	return __register_m32r_sio(req, -1);
-}
-
-int __init early_serial_setup(struct uart_port *port)
-{
-	m32r_sio_isa_init_ports();
- 	m32r_sio_ports[port->line].port = *port;
-	m32r_sio_ports[port->line].port.ops = &m32r_sio_pops;
-
-	return 0;
-}
-
-/**
- *	unregister_m32r_sio - remove a 16x50 serial port at runtime
- *	@line: serial line number
- *
- *	Remove one serial port.  This may be called from interrupt
- *	context.
- */
-void unregister_m32r_sio(int line)
-{
-	uart_unregister_port(&m32r_sio_reg, line);
-}
-
 /**
  *	m32r_sio_suspend_port - suspend one serial port
  *	@line: serial line number
@@ -1252,8 +1186,7 @@
 {
 	int ret, i;
 
-	printk(KERN_INFO "Serial: M32R SIO driver $Revision: 1.9 $ "
-		"IRQ sharing %sabled\n", share_irqs_sio ? "en" : "dis");
+	printk(KERN_INFO "Serial: M32R SIO driver $Revision: 1.11 $ ");
 
 	for (i = 0; i < NR_IRQS; i++)
 		spin_lock_init(&irq_lists[i].lock);
@@ -1278,14 +1211,8 @@
 module_init(m32r_sio_init);
 module_exit(m32r_sio_exit);
 
-EXPORT_SYMBOL(register_m32r_sio);
-EXPORT_SYMBOL(unregister_m32r_sio);
 EXPORT_SYMBOL(m32r_sio_suspend_port);
 EXPORT_SYMBOL(m32r_sio_resume_port);
 
 MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Generic M32R SIO serial driver $Revision: 1.9 $");
-
-module_param(share_irqs_sio, bool, 0400);
-MODULE_PARM_DESC(share_irqs_sio, "Share IRQs with other non-M32R SIO devices"
-	" (unsafe)");
+MODULE_DESCRIPTION("Generic M32R SIO serial driver $Revision: 1.11 $");
diff -Nru a/include/asm-m32r/serial.h b/include/asm-m32r/serial.h
--- a/include/asm-m32r/serial.h	2005-03-30 17:39:03 -08:00
+++ b/include/asm-m32r/serial.h	2005-03-30 17:39:03 -08:00
@@ -1,47 +1,10 @@
 #ifndef _ASM_M32R_SERIAL_H
 #define _ASM_M32R_SERIAL_H
 
-/*
- * include/asm-m32r/serial.h
- */
+/* include/asm-m32r/serial.h */
 
 #include <linux/config.h>
-#include <asm/m32r.h>
 
-/*
- * This assumes you have a 1.8432 MHz clock for your UART.
- *
- * It'd be nice if someone built a serial card with a 24.576 MHz
- * clock, since the 16550A is capable of handling a top speed of 1.5
- * megabits/second; but this requires the faster clock.
- */
-#define BASE_BAUD ( 1843200 / 16 )
-
-/* Standard COM flags */
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-
-/* Standard PORT definitions */
-#if defined(CONFIG_PLAT_USRV)
-
-#define STD_SERIAL_PORT_DEFNS						\
-       /* UART  CLK     PORT   IRQ            FLAGS */			\
-	{ 0, BASE_BAUD, 0x3F8, PLD_IRQ_UART0, STD_COM_FLAGS }, /* ttyS0 */ \
-	{ 0, BASE_BAUD, 0x2F8, PLD_IRQ_UART1, STD_COM_FLAGS }, /* ttyS1 */
-
-#else /* !CONFIG_PLAT_USRV */
-
-#if defined(CONFIG_SERIAL_M32R_PLDSIO)
-#define STD_SERIAL_PORT_DEFNS						\
-	{ 0, BASE_BAUD, ((unsigned long)PLD_ESIO0CR), PLD_IRQ_SIO0_RCV,	\
-	  STD_COM_FLAGS }, /* ttyS0 */
-#else
-#define STD_SERIAL_PORT_DEFNS						\
-	{ 0, BASE_BAUD, M32R_SIO_OFFSET, M32R_IRQ_SIO0_R,		\
-	  STD_COM_FLAGS }, /* ttyS0 */
-#endif
-
-#endif /* !CONFIG_PLAT_USRV */
-
-#define SERIAL_PORT_DFNS	STD_SERIAL_PORT_DEFNS
+#define BASE_BAUD	115200
 
 #endif  /* _ASM_M32R_SERIAL_H */
