Thread (30 messages) 30 messages, 6 authors, 2011-02-28

Open Firmware and interrupt trigger

From: Robert Thorhuus <hidden>
Date: 2011-02-23 21:34:21

Hello!

I'm quite new to linux and Open Firmware.

I have a PPC processor. To this I have a Compact Flash connected. The Compa=
ct Flash is using external interrupt 0 of the processor.
In my DTS file I have specified a Compact Flash node and within it I have a=
n interrupt element:
interrupt =3D <0 2 0 0>;

Here I thought the first number was the ID of the interrupt and the second =
one should be a number indicating how the interrupt is triggered (high, low=
, raising, falling).

The interrupt is active low.

But I could not get it to work which ever value I chose.

Looking in the code I found this in function __devinit pata_of_platform_pro=
be in file pata_of_platform.c:

	ret =3D of_irq_to_resource(dn, 0, &irq_res);
	if (ret =3D=3D NO_IRQ)
		irq_res.start =3D irq_res.end =3D 0;
	else
		irq_res.flags =3D 0;

Here "flags" will be zero whatever I do in the DTS. As far as I can underst=
and the flags are defined in interrupts.h:
#define IRQF_TRIGGER_NONE       0x00000000
#define IRQF_TRIGGER_RISING     0x00000001
#define IRQF_TRIGGER_FALLING    0x00000002
#define IRQF_TRIGGER_HIGH       0x00000004
#define IRQF_TRIGGER_LOW        0x00000008

So modifying the code to:
	else
		irq_res.flags =3D 2;

I get it to work.

Could someone please explain to me why the "flags" parameter is hardcoded z=
ero or just point in a good direction.

Thank you

BR
Robert=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help