External interrupts with UIO framework on mpc8313e

Frank Prepelica Frank.Prepelica at ubidyne.com
Mon Feb 11 22:24:00 EST 2008


Hi everyone!

I'm trying to receive external interrupts on the mpc8313erdb board.
I'm also using the UIO framework to register the interrupt handler. 

It works for me when I register the interrupt handler for external interrupt IRQ4 (irq = 20)
But when I'm trying the register the handler for IRQ0(48)-IRQ3(17-19) it doesn't. 

I'm using following simple code:

---snip---
static irqreturn_t intHandler(int irq, struct uio_info *dev_info)
{
    printk("name: %s\n", dev_info->name);
    return IRQ_HANDLED
}

static struct uio_info myinfo = {
    .name = "IRQ4 Kernel Driver",
    .version = "1.0.0",
    .irq = 20,
    .irq_flags = IRQF_SHARED | IRQF_DISABLED,
    .handler = intHandler,
};

static int uio_probe(struct device *dev)
{
    if(uio_register_device(dev,&myinfo))
    {
        return -ENODEV;
    }
    else
    {
        return 0;
    }
}
---snip---

After booting the kernel, the driver (for IRQ4) appears correct in /proc/interrups and can be triggered.

I guess, this should also work for IRQ0-IRQ3 but it won't. IRQ0 cannot registered to 48 at all and the
other ones appear in /proc/interruts but they cannot be triggered (BUT shared with serial or i2c). 

I also checked the value of the SEMSR register and see that IRQ4 is set correctly.

Okay, I thought when I set the SEMSR register manually e.g. IRQ2 to "1" and trigger the correct interrupt signal I could see in /proc/stat a counting value. Nothing happened. But the BAD counter in /proc/interrupts is rising. 

Furthermore there's a mapping issue between the interrupt id number from the board manual
(page 8-10) and the output of /proc/interrupts. The kernel registers the i2c devices to 
ID 16 and 17 although the manual says they are mapped to 14 and 15.


Any hint is appreciate! 
Best regards



Frank Prepelica
Software Design Engineer

Ubidyne GmbH
Lise-Meitner-Str.-14
89081 Ulm - Germany

Phone:             +49 731 88 00 71 58
Fax:                 +49 731 88 00 71 99
Email:              frank.prepelica at ubidyne.com
Homepage:       www.ubidyne.com
 
Registered office: Ulm
District court of Ulm: HRB 5295
Managing Directors:
Dipl. Ing. Ken Hawk
Dipl. Ing. Beat Müller
Dr. Clemens Rheinfelder



More information about the Linuxppc-embedded mailing list