[NEWBIE] Interrupt-problem mpc5200

S. Fricke silvio.fricke at googlemail.com
Thu Sep 6 23:30:51 EST 2007


Hello all.

What are the steps to configure an MPC500B-Board to react on an IRQ (2)?

I have written a test-driver with this code-snippets, but the prozessor
hangs when loading the driver.

my __init-function looks like:

static int __init mod_init( void ) 
{
    volatile static struct mpc52xx_intr __iomem *intr;
    u32 intr_ctrl;

    // ...

    printk( "intmod.ko: interrupt init ");
    if (request_irq(MPC52xx_IRQ2, intmod_isr, IRQF_SHARED , "intmod",
                INTMOD_IRQ_BOARD) == -EBUSY)
        printk("KO\n");
    else
        printk("OK\n");

    intr = ioremap(MPC52xx_MBAR+MPC52xx_INTR_OFFSET, MPC52xx_INTR_SIZE);

    // read - modify - write
    intr_ctrl = in_be32(&intr->ctrl);
    intr_ctrl &= 0xfff3ffff;
    intr_ctrl |= 0x00080200;
    out_be32(&intr->ctrl, intr_ctrl);       // ERROR!

    if(intr) iounmap(intr);

    // ...
}

On the Line, marked with "ERROR!" the prozessor hangs and the kernel drops
out.

TIA: Silvio

-- 
-- S. Fricke ----------------------------- MAILTO:silvio.fricke at gmail.com --
   Diplom-Informatiker (FH)
   Linux-Entwicklung                       JABBER:      fricke at jabber.org
----------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070906/81d28181/attachment.pgp>


More information about the Linuxppc-dev mailing list