On Nov 25, 2008, at 1:00 PM, Andrew Kohlsmith (lists) wrote:

It's been a while, but my MCF5282 design had no problems at all with
interrupts.  Mind you, I was using the internal peripheral interrupts
(ethernet, CAN and UART). I don't think I used the external interrupt pin
for anything.

Could you perhaps post your interrupt module init and service code?

Hm, mebbe.

FWIW, btw, I seem to be called twice - that is, my IRQ routine gets called once when the interrupt is asserted, and again when it is deasserted, as though it is being called for both rising and falling edges, even though the hardware is configured as a level interrupt.

I've also tried it configured as a falling edge interrupt (with code to clear it) and I see the same behavior.

Okay, let's see...where I initialize the interrupt:

*MCF5282_EPORT_EPIER |= 0x40; // bit #6; enable interrupts on IRQ 6 *(u32 *)(MCF5282_INTC0_IMRL) &= ~0x00000040; // unmask IRQ6 interrupt
//    *MCF5282_EPORT_EPPAR |= 0x2000; // falling edge triggered

I'm leaving the commented out "falling edge" stuff for your edification :)

err = request_irq(MD_INTERRUPT, md_interrupt, 0, "my device", NULL);

bottomhalf_thread = kthread_run((void *)bottom_half, NULL, "mddriver");

MD_INTERRUPT is 64 + 6, fwiw.


static irqreturn_t md_interrupt(int irq, void *dev_id)
{
    MDDEBUG("MD Interrupt\n");

    // The falling-edge triggered interrupt is latched on the coldfire.
// *MCF5282_EPORT_EPFR = 0x40; // bit #6; clear latch on IRQ 6 (write a bit to clear it)

    /* Do a read to clear the interrupt. */
    code_which_reads();
    barrier();

    if (work to be done)
        wake_up_interruptible(&bh_queue);

    return IRQ_HANDLED;
}


-
allon
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to