[ECOS] DAI driver and I2S interrupt on edb7xxx
Franck MAMALET FT-R&D DIH/OCF
franck.mamalet@rd.francetelecom.com
Wed Jul 18 06:55:00 GMT 2001
Hi,
I'm trying to install a driver for DAIÃÂ codec on the edb7xxx.
I had a look to hal/arm/edb7xxx/current/misc/i2s_audio...ÃÂ to
devellop a i2s_ISRÃÂ and i2s_DSR and then create and attach themÃÂ
to CYGNUM_HAL_INTERRUPT_I2SINT.
Looking at eCos interrupt handling I found somethingÃÂ weird: in
hal_IRQ_handler(hal/arm/edb7xxx/current/src/edb7xxx_misc.c), eCos scans
all interrupts to find the vector number of the first interrupt to handle:
ÃÂ ÃÂ ÃÂ while (map->first_int) {
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ stat = *(volatile cyg_uint32
*)map->stat_reg & *(volatile cyg_uint32 *)map->mask_reg;
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ for (vector = map->first_int;ÃÂ
vector <= map->last_int;ÃÂ vector++) {
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
if (stat & hal_interrupt_bitmap[vector]) return vector;
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ }
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ map++;ÃÂ // Next interrupt
status register
ÃÂ ÃÂ ÃÂ }
But I2SÃÂ interrupt vector number is 22 andÃÂ is the last one,
so it will be handled after all pending interrupts (even some IRQs)
I think it is not a good idea for a FIQ, and actually it doesn't work.ÃÂ
I had to change hal_interrupt_status_regmap table to fix it:
"./arm/edb7xxx/current/src/edb7xxx_misc.c"ÃÂ line 284
static struct regmap {
ÃÂ ÃÂ ÃÂ intÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ first_int,
last_int;
ÃÂ ÃÂ ÃÂ cyg_uint32 stat_reg, mask_reg;
} hal_interrupt_status_regmap[] = {
ÃÂ ÃÂ ÃÂ { CYGNUM_HAL_INTERRUPT_EXTFIQ, CYGNUM_HAL_INTERRUPT_MCINT,ÃÂ
INTSR1, INTMR1},
#if defined(__EDB7211)
ÃÂ ÃÂ ÃÂ { CYGNUM_HAL_INTERRUPT_MCPINT, CYGNUM_HAL_INTERRUPT_MCPINT,ÃÂ
INTSR3, INTMR3},
#endif
#if defined(__EDB7209)
ÃÂ ÃÂ ÃÂ { CYGNUM_HAL_INTERRUPT_I2SINT, CYGNUM_HAL_INTERRUPT_I2SINT,ÃÂ
INTSR3, INTMR3},
#endif
ÃÂ ÃÂ { CYGNUM_HAL_INTERRUPT_CSINT, CYGNUM_HAL_INTERRUPT_SSEOTI,ÃÂ
INTSR1, INTMR1},
ÃÂ ÃÂ ÃÂ { CYGNUM_HAL_INTERRUPT_KBDINT, CYGNUM_HAL_INTERRUPT_URXINT2,
INTSR2, INTMR2},
ÃÂ ÃÂ ÃÂ { 0, 0, 0}
};
Could you please tell me ifÃÂ my modification is OK (I mean safe)
? and if the same kind of selection is applied for DSRÃÂ handling? and
where?
Thanks,
Best regards,
Franck.
ÃÂ
ÃÂ
--ÃÂ
& france telecomÃÂ
Mamalet Franck
FTR&D DIH/OCF
Télà: 04 76 76 45 71ààFax : 04 76 90 34 43
franck.mamalet@rd.francetelecom.com
ÃÂ
More information about the Ecos-discuss
mailing list