This is the mail archive of the ecos-discuss@sourceware.org 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: Interrupt unmask before complete cs8900a interrupt configuration.


On Tue, Jan 10, 2006 at 05:11:07PM +0100, Jaws wrote:
> Hi all,
>     I found a problem when I generated a net template image for my system.
> The problem is related to the interrupt management beetwen the At91R40008
> and the CS8900a.
> In the if_cs8900a.c
> 
> static bool
> cs8900a_init(struct cyg_netdevtab_entry *tab)
> {
> 
>  ....
> 
> #ifdef CYGINT_IO_ETH_INT_SUPPORT_REQUIRED
>     // Initialize environment, setup interrupt handler
>     cyg_drv_interrupt_create(cpd->interrupt,
>                              cpd->priority,
>                              (cyg_addrword_t)cpd, //  Data item passed to
> interrupt handler
>                              (cyg_ISR_t *)cs8900a_isr,
>                              (cyg_DSR_t *)cs8900a_dsr,
>                              &cpd->interrupt_handle,
>                              &cpd->interrupt_object);
>     cyg_drv_interrupt_attach(cpd->interrupt_handle);
>     cyg_drv_interrupt_acknowledge(cpd->interrupt);
>     //cyg_drv_interrupt_unmask(cpd->interrupt);        //<---- I moved this
> line in cs8900a_start ---->
> 
> the interrupt unmask occurs before the execution of cs8900a_start function
> that configure the chip to generate the interrupt.

Why is it generating interrupts? By default devices should not
generate an interrupt until it is configured. 

Are you using a bootload which uses the ethernet? Maybe the boot
loader has left the ethernet running when it jumps into eCos. This is
a bad idea. You have no idea what else it could be doing. I had a
college who spent a week tracking down a bug which killed a linux
system about 10 seconds into its boot process. He eventually found out
the boot loader left the ethernet chip running. While Linux was
booting the eithernet received a packet and DMAed it into the memory
buffer the bootload has allocated it, which happend to now contain the
uncompressed Linux image. Some seconds later Linux then "executed" the
received packet.....

So moving the unmask till later might help, but i think it would be
better to understand why you are getting interrupts in the first
place.

        Andrew


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