public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] AT91: interrupt0 (fiq) and interrupt1 (swint) ?
@ 2004-09-15  8:32 Andrea Michelotti
  2004-09-15  9:11 ` [ECOS] " Andrew Lunn
  2004-09-15  9:29 ` [ECOS] " Nick Garnett
  0 siblings, 2 replies; 4+ messages in thread
From: Andrea Michelotti @ 2004-09-15  8:32 UTC (permalink / raw)
  To: ecos-discuss; +Cc: Andrew Lunn

Why in hal_platform_ints.h interrupts 0 and 1 are not treated?
What does the comment "Note: extra slots (0,1) to avoid messing with vector
translation" mean?

thanks

Andrea

------------------
Andrea Michelotti
ATMEL Rome


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Re: AT91: interrupt0 (fiq) and interrupt1 (swint) ?
  2004-09-15  8:32 [ECOS] AT91: interrupt0 (fiq) and interrupt1 (swint) ? Andrea Michelotti
@ 2004-09-15  9:11 ` Andrew Lunn
  2004-09-15  9:29 ` [ECOS] " Nick Garnett
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2004-09-15  9:11 UTC (permalink / raw)
  To: Andrea Michelotti; +Cc: ecos-discuss, Andrew Lunn

On Wed, Sep 15, 2004 at 10:37:06AM +0200, Andrea Michelotti wrote:
> Why in hal_platform_ints.h interrupts 0 and 1 are not treated?
> What does the comment "Note: extra slots (0,1) to avoid messing with vector
> translation" mean?

I think its avoiding subtracting two from the value in the IVR
register. The value of 0 you proposed probably makes sense. So you
need to add #define CYGNUM_HAL_INTERRUPT_FIQ 0 and change
CYGNUM_HAL_ISR_MIN to 0.

        Andrew


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] AT91: interrupt0 (fiq) and interrupt1 (swint) ?
  2004-09-15  8:32 [ECOS] AT91: interrupt0 (fiq) and interrupt1 (swint) ? Andrea Michelotti
  2004-09-15  9:11 ` [ECOS] " Andrew Lunn
@ 2004-09-15  9:29 ` Nick Garnett
  2004-09-15 10:05   ` Andrea Michelotti
  1 sibling, 1 reply; 4+ messages in thread
From: Nick Garnett @ 2004-09-15  9:29 UTC (permalink / raw)
  To: Andrea Michelotti; +Cc: ecos-discuss, Andrew Lunn

"Andrea Michelotti" <amichelotti@atmel.com> writes:

> Why in hal_platform_ints.h interrupts 0 and 1 are not treated?
> What does the comment "Note: extra slots (0,1) to avoid messing with vector
> translation" mean?

It means that the ISR table has 32 entries, but entries 0 and 1 are
unused. This allows vector numbers to translate directly to table
indexes. It simplifies the code at the expense of wasting some memory.

So, the table slot for your FIQ handler is present. I think all you
need to do is add a

#define CYGNUM_HAL_INTERRUPT_FIQ             0

somewhere and use that in your patch. It should probably go into
var_io.h since it is generic to all AT91s and is used in generic code.


However, in general eCos doesn't really support FIQs. The intended use
of FIQ is for very fast, low instruction count, interrupts -- software
DMA engines was the typical example. So the expected mechanism for
using FIQ is for the application to replace the FIQ VSR table entry
with a pointer to a short assembler routine. The FIQ support in the
HAL was mainly intended to support devices where the hardware
designers have connected a normal device to the FIQ for no good
reason, and to be able to catch and report spurious FIQs if they
occur.

For this reason, I think that the FIQ support in hal_IRQ_handler()
ought to be optional, and controlled by a config option. Otherwise all
platforms will pay the extra cost of testing for a FIQ when there is
never any possibility of the interrupt occuring.


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] AT91: interrupt0 (fiq) and interrupt1 (swint) ?
  2004-09-15  9:29 ` [ECOS] " Nick Garnett
@ 2004-09-15 10:05   ` Andrea Michelotti
  0 siblings, 0 replies; 4+ messages in thread
From: Andrea Michelotti @ 2004-09-15 10:05 UTC (permalink / raw)
  To: Nick Garnett; +Cc: ecos-discuss, Andrew Lunn

I agree with you that maybe will be better to add some CDL entry to enable
FIQ handling in hal_IRQ_handler.
I think there is an extra cost in testing spurious interrupts too, because
in case of spurious interrupt ISR=0.
I try to do these patches and send you back.
best regards
Andrea.


> It means that the ISR table has 32 entries, but entries 0 and 1 are
> unused. This allows vector numbers to translate directly to table
> indexes. It simplifies the code at the expense of wasting some memory.
>
> So, the table slot for your FIQ handler is present. I think all you
> need to do is add a
>
> #define CYGNUM_HAL_INTERRUPT_FIQ             0
>
> somewhere and use that in your patch. It should probably go into
> var_io.h since it is generic to all AT91s and is used in generic code.
>
>
> However, in general eCos doesn't really support FIQs. The intended use
> of FIQ is for very fast, low instruction count, interrupts -- software
> DMA engines was the typical example. So the expected mechanism for
> using FIQ is for the application to replace the FIQ VSR table entry
> with a pointer to a short assembler routine. The FIQ support in the
> HAL was mainly intended to support devices where the hardware
> designers have connected a normal device to the FIQ for no good
> reason, and to be able to catch and report spurious FIQs if they
> occur.
>
> For this reason, I think that the FIQ support in hal_IRQ_handler()
> ought to be optional, and controlled by a config option. Otherwise all
> platforms will pay the extra cost of testing for a FIQ when there is
> never any possibility of the interrupt occuring.
>
>
> -- 
> Nick Garnett                    eCos Kernel Architect
> http://www.ecoscentric.com/     The eCos and RedBoot experts
>
>
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-15 10:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15  8:32 [ECOS] AT91: interrupt0 (fiq) and interrupt1 (swint) ? Andrea Michelotti
2004-09-15  9:11 ` [ECOS] " Andrew Lunn
2004-09-15  9:29 ` [ECOS] " Nick Garnett
2004-09-15 10:05   ` Andrea Michelotti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).