Messages in this thread Patch in this message | | | Date | Mon, 24 Nov 1997 08:55:46 +0100 (MET) | From | Niels Kristian Bech Jensen <> | Subject | Re: Sharing IRQs between the first 4 serial ports. |
| |
On Mon, 24 Nov 1997, Isaac Connor wrote:
> it would be really nice if you could specify (on module load, or as kernel > params) the irqs etc of certain ports...that is, since we aren't supposed > to use setserial...I of course use it....flawlessly...but I have to not > have it as a module, since I would have to rerun setserial on each module > insertion, which is annoying... > You can do that in /etc/conf.modules. See 'man modprobe'.
> But anyways...My configs have always had sound cards at irq5, com3 at 10, > nic at 11, bt958 at 12..... > This patch let you configure irqs for com3 and com4 during 'make config'. Let me know if it works. It should be the 'final version'.
Niels Kristian
diff -urN linux-2.1.65/Documentation/Configure.help linux/Documentation/Configure.help --- linux-2.1.65/Documentation/Configure.help Mon Nov 24 07:34:07 1997 +++ linux/Documentation/Configure.help Mon Nov 24 07:34:33 1997 @@ -684,7 +684,10 @@ CONFIG_SERIAL_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. + support for this in the serial driver, say Y here. You also have to + say Y here if you want COM 1 and 2 to share interrupts with COM 3 + and 4 respectively. Beware that it is not recommended to use two of + the first four serial ports with shared interrupts at the same time! Support special multiport boards CONFIG_SERIAL_MULTIPORT diff -urN linux-2.1.65/drivers/char/Config.in linux/drivers/char/Config.in --- linux-2.1.65/drivers/char/Config.in Mon Nov 24 07:33:22 1997 +++ linux/drivers/char/Config.in Mon Nov 24 07:40:09 1997 @@ -17,6 +17,10 @@ bool ' Support the Bell Technologies HUB6 card' CONFIG_HUB6 bool ' Console on serial port' CONFIG_SERIAL_CONSOLE fi +if [ "$CONFIG_SERIAL_SHARE_IRQ" != "y" ]; then + int 'IRQ for 3th serial port' COM3_IRQ 5 + int 'IRQ for 4th serial port' COM4_IRQ 2 +fi bool 'Non-standard serial port support' CONFIG_SERIAL_NONSTANDARD if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then tristate 'Comtrol Rocketport support' CONFIG_ROCKETPORT diff -urN linux-2.1.65/drivers/char/serial.c linux/drivers/char/serial.c --- linux-2.1.65/drivers/char/serial.c Mon Nov 24 07:33:20 1997 +++ linux/drivers/char/serial.c Mon Nov 24 07:39:24 1997 @@ -22,6 +22,9 @@ * 1/97: Extended dumb serial ports are a config option now. * Saves 4k. Michael A. Griffith <grif@acm.org> * + * 11/97: Configuration of shared IRQs between COM 1/3 and COM 2/4 via + * CONFIG_SERIAL_SHARE_IRQ. Niels Kristian Bech Jensen <nkbj@image.dk> + * * This module exports the following rs232 io functions: * * int rs_init(void); @@ -53,7 +56,7 @@ #include <asm/bitops.h> static char *serial_name = "Serial driver"; -static char *serial_version = "4.24"; +static char *serial_version = "4.25"; static DECLARE_TASK_QUEUE(tq_serial); @@ -94,6 +97,8 @@ #define CONFIG_SERIAL_MANY_PORTS #define CONFIG_SERIAL_SHARE_IRQ +#define COM3_IRQ 5 +#define COM4_IRQ 2 #define CONFIG_SERIAL_MULTIPORT #define CONFIG_HUB6 #endif @@ -115,6 +120,15 @@ #endif #endif +#ifndef CONFIG_SERIAL_SHARE_IRQ +#ifndef COM3_IRQ +#define COM3_IRQ 5 +#endif +#ifndef COM4_IRQ +#define COM4_IRQ 2 +#endif +#endif + /* Set of debugging defines */ #undef SERIAL_DEBUG_INTR @@ -211,10 +225,17 @@ static struct serial_state rs_table[] = { /* UART CLK PORT IRQ FLAGS */ +#ifdef CONFIG_SERIAL_SHARE_IRQ { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ +#else /* Default is no shared IRQs, remember to set up hardware */ + { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ + { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ + { 0, BASE_BAUD, 0x3E8, COM3_IRQ, STD_COM_FLAGS }, /* ttyS2 */ + { 0, BASE_BAUD, 0x2E8, COM4_IRQ, STD_COM4_FLAGS }, /* ttyS3 */ +#endif /* CONFIG_SERIAL_SHARE_IRQ */ #ifdef CONFIG_SERIAL_MANY_PORTS { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */
| |