* External interrupt type?
@ 2008-03-14 19:05 Kári Davíðsson
2008-03-15 11:54 ` Kári Davíðsson
0 siblings, 1 reply; 2+ messages in thread
From: Kári Davíðsson @ 2008-03-14 19:05 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
Hello,
I am dealing with external interrupts on an custom board of the
mpc5200b. Kernel is 2.6.24 from kernel.org.
I can declare the interrupt in the dts for the board and the
control register is set correctly, i.e. the correct external interrupt
is enabled.
On the other hand the type is ignored and is always level interrupt
active low.
Is this intended behaviour?
How can I pass in the interrupt type from the dts to the kernel?
I need to have the interrupt as edge interrupt, rising edge type?
rg
kd
[-- Attachment #2: Type: text/html, Size: 972 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: External interrupt type?
2008-03-14 19:05 External interrupt type? Kári Davíðsson
@ 2008-03-15 11:54 ` Kári Davíðsson
0 siblings, 0 replies; 2+ messages in thread
From: Kári Davíðsson @ 2008-03-15 11:54 UTC (permalink / raw)
To: linuxppc-embedded
A quick fix with very limited testing is included....
Someone might want to try this out or at least read it over :)
But as they say.. it works for me...
Index: arch/powerpc/platforms/52xx/mpc52xx_pic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- arch/powerpc/platforms/52xx/mpc52xx_pic.c (revision 172)
+++ arch/powerpc/platforms/52xx/mpc52xx_pic.c (working copy)
@@ -97,11 +97,28 @@
io_be_setbit(&intr->ctrl, 27-l2irq);
}
=20
+static int mpc52xx_extirq_set_type(unsigned int virq, unsigned int
type)
+{
+ int irq;
+ u32 ctrl_reg;
+
+ irq =3D irq_map[virq].hwirq;
+
+ ctrl_reg =3D in_be32(&intr->ctrl);
+ ctrl_reg &=3D ~(0x3 << (22 - irq * 2)); /* Clear the old type */
+ ctrl_reg |=3D (type & 0x3) << (22 -irq * 2);
+
+ out_be32(&intr->ctrl, ctrl_reg);
+
+ return 0;
+}
+
static struct irq_chip mpc52xx_extirq_irqchip =3D {
.typename =3D " MPC52xx IRQ[0-3] ",
.mask =3D mpc52xx_extirq_mask,
.unmask =3D mpc52xx_extirq_unmask,
.ack =3D mpc52xx_extirq_ack,
+ .set_type =3D mpc52xx_extirq_set_type,
};
=20
/*
rg
kd
On Fri, 2008-03-14 at 19:05 +0000, K=C3=A1ri Dav=C3=AD=C3=B0sson wrote:
> Hello,
>=20
> I am dealing with external interrupts on an custom board of the
> mpc5200b. Kernel is 2.6.24 from kernel.org.
>=20
> I can declare the interrupt in the dts for the board and the
> control register is set correctly, i.e. the correct external interrupt
> is enabled.
>=20
> On the other hand the type is ignored and is always level interrupt
> active low.
>=20
> Is this intended behaviour?
> How can I pass in the interrupt type from the dts to the kernel?
>=20
> I need to have the interrupt as edge interrupt, rising edge type?
>=20
> rg
> kd
>=20
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-15 11:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-14 19:05 External interrupt type? Kári Davíðsson
2008-03-15 11:54 ` Kári Davíðsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).