[ECOS] AT91: FIQ patch proposal
Andrew Lunn
andrew@lunn.ch
Wed Sep 15 11:57:00 GMT 2004
+#ifdef CYGHWR_HAL_ARM_AT91_FIQ
+ cyg_uint32 ipr,imr;
+ HAL_READ_UINT32(AT91_AIC+AT91_AIC_IPR, ipr);
+ HAL_READ_UINT32(AT91_AIC+AT91_AIC_IMR, imr);
+ if(imr&ipr&0x1){
+ HAL_WRITE_UINT32(AT91_AIC+AT91_AIC_ICCR, 1);
+ return CYGNUM_HAL_INTERRUPT_FIQ;
+ }
+#endif
// Calculate active interrupt (updates ISR)
HAL_READ_UINT32(AT91_AIC+AT91_AIC_IVR, ivr);
HAL_READ_UINT32(AT91_AIC+AT91_AIC_ISR, irq_num);
-
+
// No valid interrrupt source, treat as spurious interrupt
- if (irq_num < CYGNUM_HAL_ISR_MIN || irq_num > CYGNUM_HAL_ISR_MAX)
+ // ISR return 0 in case of spurious interrupts,fiq or a valid IRQ line betw
een 1-31
+ if (irq_num == 0)
irq_num = CYGNUM_HAL_INTERRUPT_NONE;
I don't like this last part. Since the FIQ case is handled above,
there should not be any need to change this.
There is also another problem.
void
Cyg_Interrupt::attach(void)
{
CYG_REPORT_FUNCTION();
CYG_ASSERT( vector >= CYGNUM_HAL_ISR_MIN, "Invalid vector");
CYG_ASSERT( vector <= CYGNUM_HAL_ISR_MAX, "Invalid vector");
If CYGHWR_HAL_ARM_AT91_FIQ is enabled you need to set
CYGNUM_HAL_ISR_MIN to zero or you will get assert failures when you
install your interrupt handler.
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: at91_fiq.patch
Type: application/octet-stream
Size: 3085 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20040915/55df971b/attachment.obj>
-------------- next part --------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list