[NEWBIE] Interrupt-problem mpc5200

S. Fricke silvio.fricke at googlemail.com
Wed Sep 19 17:16:43 EST 2007


Hello,

> > Can u give me an example with a single IRQ of a configuration-node for a
> > dts?
> 
> myreallycooldevice at 0 {
>         interrupts = <1 2 3>;
>         interrupt-parent = <&mpc5200_pic>;
> };

Ahh - oh weh - so simple! Thank you!

> The interrupts property matches the size of the #interrupt-cells
> property in the interrupt controller node.  For the 5200-intc, each
> interrupt is described by 3 cells; l1, l2 and sense which is a
> reflection of the interrupt controller architecture.  For IRQ0, l1=0,
> l2=0; IRQ1, l1=1, l2=1; IRQ2, l1=1 and l2=2; IRQ3, l1=1, l2=3 Sense is
> described in mpc52xx-device-tree-bindings.txt

OK, my dts is now:

    / {
        /* ... */
        soc5200 at f0000000 {
            /* ... */
            intpin at 0 {
                interrupt-parent = <500>;
                interrupts = <1 2 2>;
            };
            /* ... */
        };
        /* ... */
    };

And the corresponding code is:

struct intmod_priv {
    /** Interrupt-Number */
    int own_irq;

    /** The of-device-node */
    struct device_node *intmod_dev_node;
};

static int __init mod_init( void )
{
    // ...
    priv.intmod_dev_node = NULL;
    priv.intmod_dev_node = of_find_node_by_name(NULL, "intpin");

    priv.own_irq = irq_of_parse_and_map(priv.intmod_dev_node, 0);
    request_irq(priv.own_irq, intmod_isr, IRQF_DISABLED , "intmod", INTMOD_IRQ_BOARD);
    // ...


Thank you and bye, my next question is following :-)

Silvio Fricke

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

-------------- 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/20070919/49c99439/attachment.pgp>


More information about the Linuxppc-dev mailing list