Re: [UCLINUX] Re: [uCsimm] Interrupts & ColdFire

From: Greg Ungerer (gerg@moreton.com.au)
Date: Sat Jul 01 2000 - 09:15:00 EDT


Hi Tom, Olivier,

Tom Walsh wrote:
> Olivier Bouyssou wrote:
> > Greg Ungerer wrote:
> > > Why does the stl16c2550 have 2 interrupts?
> >
> > Yes, I forgot to specify that the stl16c2550 is a double 16550A with two lines
> > of interrupts.
> >
> > > I would suggest that these share the one IRQ line...
> >
> > Well... it does not remain any more which has to make a new pcb
> > and to make a patch for serial.c.
>
> Olivier,
>
> I agree with Greg, the interrupt outputs of that device should be Open
> Collector, then you can wire-OR the pins (tie them together), program
> the interrupt line to be Level Triggered (as opposed to Edge
> Triggered). Write your interrupt handler to check for servicing of
> Uart #1, if service needed, service it, then assume that all is finished
> and RETI. If you leave without also servicing Uart #2, the Level state
> of the interrupt line would pull you back into your ISR and this time
> the Uart #2 would get serviced. What you would have to do is poll the
> Interrupt Service Register of the Uart to see if it generate an IRQ, I
> think that this is a bit in the second register set (e.g. 0x3f9)?
>
> build it as:
>
> if (NeedServiceUart1 ()) {
> ServiceUart1 (); return;
>  } else if (NeedServiceUart2 ()) {
> ServiceUart2 (); return;
> }

This may be even easier than you think. The Linux serial.c driver for
16XXX UARTs already has good support for dealing with multiple UARTs
sharing the same IRQ. (Many PC multi-port serial 16XXX based boards
share 1 inetrrupt line for all UARTs on the board).

With appropriate configuration lines in serial.c most of the servicing
code required will already be there...

Seeya
Greg

------------------------------------------------------------------------
Greg Ungerer EMAIL: gerg@moreton.com.au
Moreton Bay (A Lineo Company) PHONE: +61 7 3279 1822
Unit 12, 97 Jijaws St, FAX: +61 7 3279 1820
Sumner Park, QLD, 4074, Australia WEB: www.moretonbay.com
This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:37 EST