Mercurial > ecos-v3_0-branch
changeset 1752:2feea0d283e4
* 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.
| author | asl |
|---|---|
| date | Thu, 16 Sep 2004 12:16:00 +0000 |
| parents | 9448eb977d1b |
| children | 1cb798c09c9a |
| files | packages/hal/arm/at91/var/current/ChangeLog packages/hal/arm/at91/var/current/cdl/hal_arm_at91.cdl packages/hal/arm/at91/var/current/include/var_io.h packages/hal/arm/at91/var/current/src/at91_misc.c |
| diffstat | 4 files changed, 36 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/hal/arm/at91/var/current/ChangeLog +++ b/packages/hal/arm/at91/var/current/ChangeLog @@ -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
--- a/packages/hal/arm/at91/var/current/cdl/hal_arm_at91.cdl +++ b/packages/hal/arm/at91/var/current/cdl/hal_arm_at91.cdl @@ -85,4 +85,14 @@ cdl_package CYGPKG_HAL_ARM_AT91 { 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" + } }
--- a/packages/hal/arm/at91/var/current/include/var_io.h +++ b/packages/hal/arm/at91/var/current/include/var_io.h @@ -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
--- a/packages/hal/arm/at91/var/current/src/at91_misc.c +++ b/packages/hal/arm/at91/var/current/src/at91_misc.c @@ -180,13 +180,24 @@ int hal_IRQ_handler(void) { 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;
