lkml.org 
[lkml]   [1997]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: Sharing IRQs between the first 4 serial ports.
I suspect the existing code is correct.

On most systems, you can't actually share com's IRQ's in the sense that they
can't be used by both ports at the same time. You can use one or the other,
but not both.

The com's ports have logic to tri-state their IRQ's so that one can safely sit
unused while you use another. But trying to drive one port's interupts while the
other is also enabled (but not interupting) results in a bus contention.

With the correct hardware, or a few diodes and a resistor, you can make it work
properly, but the "standard" PC hardware won't work reliably.



Peter

On 23-Nov-97 Niels Kristian Bech Jensen wrote:
> Traditionally IRQs have been assigned to the first four serial ports in
> this way:
>
> COM1 4
> COM2 3
> COM3 4
> COM4 3
>
> That is: sharing IRQs between COM 1/3 and COM 2/4.
>
> A de facto standard for internal modems seems to be:
>
> COM1 4
> COM2 3
> COM3 5
> COM4 2
>
> That is: no IRQ sharing.
>
> I've made a small patch to make this ``new standard'' default in the Linux
> serial driver. The ``old standard'' can be chosen by setting
> CONFIG_SERIAL_SHARE_IRQ during configuration (already used for serial
> boards.)
>
> This allows users with internal modems to use those without having to use
> setserial.
>
> I'd like to hear your comments on which IRQ scheme should be the default
> in the kernel.
>
>
> --- linux/drivers/char/serial.c.orig Fri Nov 21 11:06:38 1997
> +++ linux/drivers/char/serial.c Sun Nov 23 09:37:53 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: Configuring to share 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);
>
> @@ -211,10 +214,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
> + { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */
> + { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */
> + { 0, BASE_BAUD, 0x3E8, 5, STD_COM_FLAGS }, /* ttyS2 */
> + { 0, BASE_BAUD, 0x2E8, 2, 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 */
>
>
> --
> Med venlig hilsen / Regards
>
> Niels Kristian Bech Jensen nkbj@image.dk
> http://www.image.dk/~nkbj/

----------------------------------
E-Mail: P.Waltenberg@irl.cri.nz
Date: 24-Nov-97
Time: 07:30:48
----------------------------------

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.123 / U:1.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site