Skip to contentSkip to conversation

Edge Interrupts (Virtex-II Pro)

DISCUSSION Joshua Lamorie 2 participants 3 messages Feb 4, 2005 – Feb 7, 2005

lore
Share & tools
lore
#0 lore raw

Gidday there,

Is there a cleaner way to specify that an interrupt is edge triggered other than directly accessing irq_desc_t irq_desc []?

In my module, when I request_irq, if it succeeds I do the following.

     irq_desc[iIRQ].status &= ~(IRQ_LEVEL);

Is there a better way?

Thanks in advance

Joshua

Signature · 11 lines
Xiphos Technologies
(514) 848-9640 x227
(514) 848-9644 fax

www.xiplink.com
_______________________________________________
The information transmitted is intended only for the
person or entity to which it is addressed and may contain
confidential and/or privileged material.  If you have
received this in error, please contact the sender and delete
this communication and any copy immediately. Thank you.
#1 lore raw
Quoted 3 lines · Joshua Lamorie

Gidday there,

Is there a cleaner way to specify that an interrupt is edge triggered other than directly accessing irq_desc_t irq_desc []?

In case of ML300 (which is the only Virtex-II Pro board in the linux-2.5 tree so far) this is done in platforms/xilinx_ml300.c:ml300_init_irq() based on XPAR_INTC_0_KIND_OF_INTR value defined in the xparameters.h:

        for (i = 0; i < NR_IRQS; i++) {
                if (XPAR_INTC_0_KIND_OF_INTR & (0x80000000 >> i))
                        irq_desc[i].status &= ~IRQ_LEVEL;
                else
                        irq_desc[i].status |= IRQ_LEVEL;
        }

As this code is not board specific at all,
I would move it to arch/ppc/syslib/xilinx_pic.c:ppc4xx_pic_init(). Does it sound reasonable (I'll prepare the patch this weekend then)?

Hmm...
Looks like I've forgotten to change the irq numbering here... Must be
if (XPAR_INTC_0_KIND_OF_INTR & (0x00000001 << i))
I think...
Will check.

Thanks,
Andrei

P.S.
Just in case you use 2.4.
2.4 kernel is almost the same to 2.6 in this sense. But the irq numbering is different.

Quoted 10 lines

In my module, when I request_irq, if it succeeds I do the following.

     irq_desc[iIRQ].status &= ~(IRQ_LEVEL);

Is there a better way?

Thanks in advance

Joshua

#2 lore raw
Quoted 3 lines · Andrei Konovalov

As this code is not board specific at all,
I would move it to arch/ppc/syslib/xilinx_pic.c:ppc4xx_pic_init(). Does it sound reasonable (I'll prepare the patch this weekend then)?

This sounds useful, since I am using a custom developed board using the Virtex-II Pro. Unfortunately, the patch wouldn't help me much because I am doing my interrupt setup for most of my custom devices within modules. You see my hardware has a Virtex-II Pro and a Virtex-II with a shared (logically) address space (OPB). I have cascaded interrupt controllers (ask me if anyone wants the code). So it is quite often that I have a changed hardware and therefore require different drivers. Rather than downloading to flash the 700k kernel each time while I am developing, I just download the 6k - 20k modules. Then I store them in onboard NOR flash.

That's a long way of saying YES, isn't it?

Joshua

Signature · 11 lines
Xiphos Technologies
(514) 848-9640 x227
(514) 848-9644 fax

www.xiplink.com
_______________________________________________
The information transmitted is intended only for the
person or entity to which it is addressed and may contain
confidential and/or privileged material.  If you have
received this in error, please contact the sender and delete
this communication and any copy immediately. Thank you.