This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AT91: FIQ patch proposal


+#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

Attachment: at91_fiq.patch
Description: Binary data

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]