[ECOS] AT91: fiq patch

Andrew Lunn andrew@lunn.ch
Thu Sep 16 12:15:00 GMT 2004


On Thu, Sep 16, 2004 at 10:41:42AM +0200, Andrea Michelotti wrote:
> Hi Andrew,
> here's the patch corrected as you suggested and with Changelogs.
> thanks.
> Andrea.

Great. I made a few minor changes to the ChangeLog entries. Attached
is the patch i commited.

        Andrew
-------------- next part --------------
Index: hal/arm/at91/eb40/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb40/current/ChangeLog,v
retrieving revision 1.7
diff -u -r1.7 ChangeLog
--- hal/arm/at91/eb40/current/ChangeLog	13 Sep 2004 09:56:36 -0000	1.7
+++ hal/arm/at91/eb40/current/ChangeLog	16 Sep 2004 12:15:06 -0000
@@ -1,6 +1,11 @@
+2004-09-16  Andrea Michelotti <amichelotti@atmel.com>
+
+	* include/hal_platform_ints.h: When CYGHWR_HAL_ARM_AT91_FIQ is defined 
+	  CYGNUM_HAL_ISR_MIN is equal to zero.
+	
 2004-08-30  Thomas Koeller <thomas.koeller@baslerweb.com>
 
-	* cdl//hal_arm_at91_eb42.cdl: Undid last change. These
+	* cdl/hal_arm_at91_eb42.cdl: Undid last change. These
 	options are not really common among all platforms.
 
 2004-02-12  Jani Monoses <jani@iv.ro>
Index: hal/arm/at91/eb40/current/include/hal_platform_ints.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb40/current/include/hal_platform_ints.h,v
retrieving revision 1.2
diff -u -r1.2 hal_platform_ints.h
--- hal/arm/at91/eb40/current/include/hal_platform_ints.h	15 Jul 2003 01:54:44 -0000	1.2
+++ hal/arm/at91/eb40/current/include/hal_platform_ints.h	16 Sep 2004 12:15:06 -0000
@@ -68,7 +68,12 @@
 #define CYGNUM_HAL_INTERRUPT_EXT1              17
 #define CYGNUM_HAL_INTERRUPT_EXT2              18
 
+#ifdef CYGHWR_HAL_ARM_AT91_FIQ
+#define CYGNUM_HAL_ISR_MIN                     0
+#else
 #define CYGNUM_HAL_ISR_MIN                     2
+#endif
+
 #define CYGNUM_HAL_ISR_MAX                     18
 // Note: extra slots (0,1) to avoid messing with vector translation
 #define CYGNUM_HAL_ISR_COUNT                   (CYGNUM_HAL_ISR_MAX + 1)
Index: hal/arm/at91/eb40a/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb40a/current/ChangeLog,v
retrieving revision 1.7
diff -u -r1.7 ChangeLog
--- hal/arm/at91/eb40a/current/ChangeLog	13 Sep 2004 09:56:37 -0000	1.7
+++ hal/arm/at91/eb40a/current/ChangeLog	16 Sep 2004 12:15:07 -0000
@@ -1,3 +1,8 @@
+2004-09-16  Andrea Michelotti <amichelotti@atmel.com>
+
+	* include/hal_platform_ints.h: When CYGHWR_HAL_ARM_AT91_FIQ is defined 
+	  CYGNUM_HAL_ISR_MIN is equal to zero.
+	
 2004-08-30  Thomas Koeller <thomas.koeller@baslerweb.com>
 
 	* cdl//hal_arm_at91_eb42.cdl: Undid last change. These
Index: hal/arm/at91/eb40a/current/include/hal_platform_ints.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb40a/current/include/hal_platform_ints.h,v
retrieving revision 1.2
diff -u -r1.2 hal_platform_ints.h
--- hal/arm/at91/eb40a/current/include/hal_platform_ints.h	15 Jul 2003 01:54:44 -0000	1.2
+++ hal/arm/at91/eb40a/current/include/hal_platform_ints.h	16 Sep 2004 12:15:07 -0000
@@ -68,7 +68,12 @@
 #define CYGNUM_HAL_INTERRUPT_EXT1              17
 #define CYGNUM_HAL_INTERRUPT_EXT2              18
 
+#ifdef CYGHWR_HAL_ARM_AT91_FIQ
+#define CYGNUM_HAL_ISR_MIN                     0
+#else
 #define CYGNUM_HAL_ISR_MIN                     2
+#endif
+
 #define CYGNUM_HAL_ISR_MAX                     18
 // Note: extra slots (0,1) to avoid messing with vector translation
 #define CYGNUM_HAL_ISR_COUNT                   (CYGNUM_HAL_ISR_MAX + 1)
Index: hal/arm/at91/eb42/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb42/current/ChangeLog,v
retrieving revision 1.6
diff -u -r1.6 ChangeLog
--- hal/arm/at91/eb42/current/ChangeLog	13 Sep 2004 09:56:39 -0000	1.6
+++ hal/arm/at91/eb42/current/ChangeLog	16 Sep 2004 12:15:07 -0000
@@ -1,3 +1,8 @@
+2004-09-16  Andrea Michelotti <amichelotti@atmel.com>
+
+	* include/hal_platform_ints.h: When CYGHWR_HAL_ARM_AT91_FIQ is defined 
+	  CYGNUM_HAL_ISR_MIN is equal to zero.
+	
 2004-08-30  Thomas Koeller <thomas.koeller@baslerweb.com>
 
 	* cdl//hal_arm_at91_eb42.cdl: Undid last change. These
Index: hal/arm/at91/eb42/current/include/hal_platform_ints.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb42/current/include/hal_platform_ints.h,v
retrieving revision 1.2
diff -u -r1.2 hal_platform_ints.h
--- hal/arm/at91/eb42/current/include/hal_platform_ints.h	15 Jul 2003 01:54:45 -0000	1.2
+++ hal/arm/at91/eb42/current/include/hal_platform_ints.h	16 Sep 2004 12:15:07 -0000
@@ -78,7 +78,12 @@
 #define CYGNUM_HAL_INTERRUPT_EXT1              30
 #define CYGNUM_HAL_INTERRUPT_EXT0              31
 
+#ifdef CYGHWR_HAL_ARM_AT91_FIQ
+#define CYGNUM_HAL_ISR_MIN                     0
+#else
 #define CYGNUM_HAL_ISR_MIN                     2
+#endif
+
 #define CYGNUM_HAL_ISR_MAX                     31
 // Note: extra slots (0,1) to avoid messing with vector translation
 #define CYGNUM_HAL_ISR_COUNT                   (CYGNUM_HAL_ISR_MAX + 1)
Index: hal/arm/at91/eb55/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb55/current/ChangeLog,v
retrieving revision 1.7
diff -u -r1.7 ChangeLog
--- hal/arm/at91/eb55/current/ChangeLog	13 Sep 2004 09:56:39 -0000	1.7
+++ hal/arm/at91/eb55/current/ChangeLog	16 Sep 2004 12:15:07 -0000
@@ -1,3 +1,8 @@
+2004-09-16  Andrea Michelotti <amichelotti@atmel.com>
+
+	* include/hal_platform_ints.h: When CYGHWR_HAL_ARM_AT91_FIQ is defined 
+	  CYGNUM_HAL_ISR_MIN is equal to zero.
+	
 2004-08-30  Thomas Koeller  <thomas.koeller@baslerweb.com>
 
 	* cdl/hal_arm_at91_eb55.cdl: Reversed change of 2004-02-12.
Index: hal/arm/at91/eb55/current/include/hal_platform_ints.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/eb55/current/include/hal_platform_ints.h,v
retrieving revision 1.2
diff -u -r1.2 hal_platform_ints.h
--- hal/arm/at91/eb55/current/include/hal_platform_ints.h	15 Jul 2003 01:54:45 -0000	1.2
+++ hal/arm/at91/eb55/current/include/hal_platform_ints.h	16 Sep 2004 12:15:08 -0000
@@ -89,8 +89,12 @@
 #define CYGNUM_HAL_INTERRUPT_COMMRX             30
 #define CYGNUM_HAL_INTERRUPT_COMMTX             31
 
-
+#ifdef CYGHWR_HAL_ARM_AT91_FIQ
+#define CYGNUM_HAL_ISR_MIN                     0
+#else
 #define CYGNUM_HAL_ISR_MIN                     2
+#endif
+
 #define CYGNUM_HAL_ISR_MAX                     31
 // Note: extra slots (0,1) to avoid messing with vector translation
 #define CYGNUM_HAL_ISR_COUNT                   (CYGNUM_HAL_ISR_MAX + 1)
Index: hal/arm/at91/var/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/var/current/ChangeLog,v
retrieving revision 1.20
diff -u -r1.20 ChangeLog
--- hal/arm/at91/var/current/ChangeLog	13 Sep 2004 09:56:39 -0000	1.20
+++ hal/arm/at91/var/current/ChangeLog	16 Sep 2004 12:15:08 -0000
@@ -1,3 +1,12 @@
+2004-09-16  Andrea Michelotti <amichelotti@atmel.com>
+
+	* cdl/hal_arm_at91.cdl:
+	* src/at91_misc.c:
+	* include/var_io.h: Support FIQ as a high priority interrupt using the normal
+	mechanism. This is controlled by the CDL option CYGHWR_HAL_ARM_AT91_FIQ and uses the
+	interrupt number CYGHWR_HAL_ARM_AT91_FIQ which is common to all platforms using
+	this HAL variant. 
+		
 2004-08-30  Thomas Koeller <thomas.koeller@baslerweb.com>
 
 	* cdl/hal_arm_at91.cdl: Reversed change of 2004-02-12 that move
Index: hal/arm/at91/var/current/cdl/hal_arm_at91.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/var/current/cdl/hal_arm_at91.cdl,v
retrieving revision 1.7
diff -u -r1.7 hal_arm_at91.cdl
--- hal/arm/at91/var/current/cdl/hal_arm_at91.cdl	13 Sep 2004 09:56:40 -0000	1.7
+++ hal/arm/at91/var/current/cdl/hal_arm_at91.cdl	16 Sep 2004 12:15:08 -0000
@@ -85,4 +85,14 @@
                         platform HALs to select the specific microcontroller
                         being used."
     }
+
+    cdl_option CYGHWR_HAL_ARM_AT91_FIQ {
+        display       "handle FIQ as an IRQ"
+        flavor        bool
+        default_value 0
+        description   "
+            Enable this option if you need to handle FIQ interrupts in the
+            normal way, i.e. a FIQ interrupt will be treated as a normal IRQ 
+            using the highest priority"
+    }
 }
Index: hal/arm/at91/var/current/include/var_io.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/var/current/include/var_io.h,v
retrieving revision 1.7
diff -u -r1.7 var_io.h
--- hal/arm/at91/var/current/include/var_io.h	24 May 2004 08:41:47 -0000	1.7
+++ hal/arm/at91/var/current/include/var_io.h	16 Sep 2004 12:15:09 -0000
@@ -640,6 +640,10 @@
 #define AT91_WD_SR_WDOVF    0x00000001
 
 
+//=============================================================================
+// FIQ interrupt vector which is shared by all HAL varients.
+
+#define CYGNUM_HAL_INTERRUPT_FIQ 0
 //-----------------------------------------------------------------------------
 // end of var_io.h
 #endif // CYGONCE_HAL_VAR_IO_H
Index: hal/arm/at91/var/current/src/at91_misc.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/at91/var/current/src/at91_misc.c,v
retrieving revision 1.8
diff -u -r1.8 at91_misc.c
--- hal/arm/at91/var/current/src/at91_misc.c	12 Aug 2004 13:02:24 -0000	1.8
+++ hal/arm/at91/var/current/src/at91_misc.c	16 Sep 2004 12:15:09 -0000
@@ -180,13 +180,24 @@
 {
     cyg_uint32 irq_num;
     cyg_uint32 ivr;
-    
+#ifdef CYGHWR_HAL_ARM_AT91_FIQ
+    // handle fiq interrupts as irq 
+    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 & (1 << CYGNUM_HAL_INTERRUPT_FIQ)) {
+      HAL_WRITE_UINT32(AT91_AIC+AT91_AIC_ICCR, (1 << CYGNUM_HAL_INTERRUPT_FIQ));
+      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    
+    // An invalid interrrupt source is treated as a spurious interrupt    
     if (irq_num < CYGNUM_HAL_ISR_MIN || irq_num > CYGNUM_HAL_ISR_MAX)
       irq_num = CYGNUM_HAL_INTERRUPT_NONE;
     

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