* 8544 external interrupt configuration problems
@ 2009-05-28 19:05 Nancy Isaac
2009-05-28 20:02 ` Scott Wood
0 siblings, 1 reply; 5+ messages in thread
From: Nancy Isaac @ 2009-05-28 19:05 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 2488 bytes --]
Hi,
I have a custom board that's using powerpc 8544. I am trying to setup the
external interrupts using the device tree and I am having no luck getting
the interrupt. I think my problem is that I don't have the hwirq to virq
mapping correctly. We are using the freescale 8544ds as our base. We have a
PCI bus but we are not using PCIE. In my kernel configuration, I have
CONFIG_PCIEPORTBUS disabled. The PCI interrupt is connected to IRQ0 and it
is working fine. But, my FPGA has three interrupts, IRQ1, IRQ2 and IRQ3. I
configure this in the device tree and I've tried many different numbers for
the interrupt.
In the KConfig for ppc85xx, the configuration is the following
config MPC85xx_DS
bool "Freescale MPC8544 DS"
#select PPC_I8259
select DEFAULT_UIMAGE
select FSL_PCIE
config MPC85xx
bool
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
select FSL_PCIE
select SERIAL_8250_SHARE_IRQ if SERIAL_8250
default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
|| MPC85xx_MDS || MPC85xx_DS
My .config has the following configuration for PCI ( I am showing the PCI
configuration b/c 8544 seems to have different interrupt setup when PCIE is
configured)
CONFIG_ZONE_DMA=y
# CONFIG_MPIC_WEIRD is not set
# CONFIG_PPC_I8259 is not set
CONFIG_PPC_INDIRECT_PCI=y
CONFIG_FSL_SOC=y
CONFIG_FSL_PCIE=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCIEPORTBUS is not set
CONFIG_PCI_DEBUG=y
My device tree has the following entry for my fpga:
CpuCpld\@f0000000{
compatible = "MPC8544DS";
device_type = "CpuCpld";
reg = <f0000000 00000040>;
interrupts = <41 2 42 2 43 2>;
interrupt-parent = <&mpic>;
};
My driver does the mapping to the virq:
np = of_find_node_by_type(NULL, "CpuCpld");
if (!np) {
ret = -ENODEV;
}
cpldCpuDrv->MateIntIrq = irq_of_parse_and_map(np, 0);
cpldCpuDrv->FtaIrq = irq_of_parse_and_map(np, 1);
cpldCpuDrv->ExtractIrq = irq_of_parse_and_map(np, 2);
cpldCpuDrv->XauiIrq = irq_of_parse_and_map(np, 0);
of_node_put(np);
Does anyone know what the virq should be for these external interrupts?
I've tried specifying the actual irq numbers 1,2 and 3 and that doesn't work
either.
Is there some PCI configuration that's getting in the way? I've tried
disabling the FSL_PCIE and I get the same behavior.
Any help or pointers will be appreciated.
Thanks
Nancy
[-- Attachment #2: Type: text/html, Size: 2814 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 8544 external interrupt configuration problems
2009-05-28 19:05 8544 external interrupt configuration problems Nancy Isaac
@ 2009-05-28 20:02 ` Scott Wood
2009-05-29 1:48 ` Nancy Isaac
0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2009-05-28 20:02 UTC (permalink / raw)
To: Nancy Isaac; +Cc: linuxppc-dev
On Thu, May 28, 2009 at 12:05:52PM -0700, Nancy Isaac wrote:
> My device tree has the following entry for my fpga:
>
> CpuCpld\@f0000000{
> compatible = "MPC8544DS";
> device_type = "CpuCpld";
> reg = <f0000000 00000040>;
> interrupts = <41 2 42 2 43 2>;
> interrupt-parent = <&mpic>;
> };
Where did you get those interrupt numbers from? External interrupt
numbers start at zero on MPIC.
Is the level/sense information correct?
> My driver does the mapping to the virq:
>
> np = of_find_node_by_type(NULL, "CpuCpld");
> if (!np) {
> ret = -ENODEV;
> }
> cpldCpuDrv->MateIntIrq = irq_of_parse_and_map(np, 0);
> cpldCpuDrv->FtaIrq = irq_of_parse_and_map(np, 1);
> cpldCpuDrv->ExtractIrq = irq_of_parse_and_map(np, 2);
> cpldCpuDrv->XauiIrq = irq_of_parse_and_map(np, 0);
>
> of_node_put(np);
Looks good (other than that you should be using compatible (with a more
specific name) rather than device_type).
> Does anyone know what the virq should be for these external interrupts?
They're dynamically assigned.
> I've tried specifying the actual irq numbers 1,2 and 3 and that doesn't work
> either.
Specifying them where? In the device tree or as virq numbers? Never
hard-code virq numbers.
> Is there some PCI configuration that's getting in the way? I've tried
> disabling the FSL_PCIE and I get the same behavior.
Barring an unusual bug, PCI should have nothing to do with the interrupt
routing of things that aren't on the PCI bus.
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 8544 external interrupt configuration problems
2009-05-28 20:02 ` Scott Wood
@ 2009-05-29 1:48 ` Nancy Isaac
2009-05-29 17:09 ` Scott Wood
0 siblings, 1 reply; 5+ messages in thread
From: Nancy Isaac @ 2009-05-29 1:48 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 3237 bytes --]
Thank you for your response. My responses below.
On Thu, May 28, 2009 at 1:02 PM, Scott Wood <scottwood@freescale.com> wrote:
> On Thu, May 28, 2009 at 12:05:52PM -0700, Nancy Isaac wrote:
> > My device tree has the following entry for my fpga:
> >
> > CpuCpld\@f0000000{
> > compatible = "MPC8544DS";
> > device_type = "CpuCpld";
> > reg = <f0000000 00000040>;
> > interrupts = <41 2 42 2 43 2>;
> > interrupt-parent = <&mpic>;
> > };
>
> Where did you get those interrupt numbers from? External interrupt
> numbers start at zero on MPIC.
<NI> I tried several things and this is the last set I tried. These
numbers start at the end of the internal interrupts.
I also tried specifying 1, 2 and 3 because it looks like there is just an
array of these interrupts and the interrupts are just added to this array as
they are registered with the hwirq and the virq is the index into the array
where the hwirq was added. I get slightly different results but still not
accurate.
For example, in the device tree, I had setup interrupts = <1 2 2 2 3 2>; for
irq1, 2 and 3 which are all level sensitive interrupts. These map to virq
0x12, 0x13 and 0x14 . I verify that there is no interrupt present by
looking at the registers in the FPGA and also by connecting a scope to the
signal. Immediately after I finish registering the irqs listed above, I get
an interrupt and my print statement in the do_IRQ function returns irq
number 0x12. This happens even if I've disabled the interrupt at the FPGA.
Then I forced an interrupt to occur at the FPGA on irq2 and the do_irq
function still reports that the irq occured for 0x12.
>
> Is the level/sense information correct?
[NI] Yes, these interrupts are supposed to be active low, level sensitive
interrupts.
> > My driver does the mapping to the virq:
> >
> > np = of_find_node_by_type(NULL, "CpuCpld");
> > if (!np) {
> > ret = -ENODEV;
> > }
> > cpldCpuDrv->MateIntIrq = irq_of_parse_and_map(np, 0);
> > cpldCpuDrv->FtaIrq = irq_of_parse_and_map(np, 1);
> > cpldCpuDrv->ExtractIrq = irq_of_parse_and_map(np, 2);
> > cpldCpuDrv->XauiIrq = irq_of_parse_and_map(np, 0);
> >
> > of_node_put(np);
>
> Looks good (other than that you should be using compatible (with a more
> specific name) rather than device_type).
>
> > Does anyone know what the virq should be for these external interrupts?
>
> They're dynamically assigned.
>
> > I've tried specifying the actual irq numbers 1,2 and 3 and that doesn't
> work
> > either.
>
> Specifying them where? In the device tree or as virq numbers? Never
> hard-code virq numbers.
[NI] I specify this in the device tree.
>
>
> > Is there some PCI configuration that's getting in the way? I've tried
> > disabling the FSL_PCIE and I get the same behavior.
>
> Barring an unusual bug, PCI should have nothing to do with the interrupt
> routing of things that aren't on the PCI bus.
[NI]. For 8544, the external interrupts can be shared with PCI Express. I
thought that if I am somehow enabling PCI Express, maybe it would explain
this behavior.
>
>
> -Scott
>
Thanks
Nancy
[-- Attachment #2: Type: text/html, Size: 4659 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 8544 external interrupt configuration problems
2009-05-29 1:48 ` Nancy Isaac
@ 2009-05-29 17:09 ` Scott Wood
2009-05-29 17:20 ` Nancy Isaac
0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2009-05-29 17:09 UTC (permalink / raw)
To: Nancy Isaac; +Cc: linuxppc-dev
On Thu, May 28, 2009 at 06:48:48PM -0700, Nancy Isaac wrote:
> > Is the level/sense information correct?
>
>
> [NI] Yes, these interrupts are supposed to be active low, level sensitive
> interrupts.
But the level/sense value for that on mpic is 1, not 2. 2 is active
high (see Documentation/powerpc/booting-without-of.txt).
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 8544 external interrupt configuration problems
2009-05-29 17:09 ` Scott Wood
@ 2009-05-29 17:20 ` Nancy Isaac
0 siblings, 0 replies; 5+ messages in thread
From: Nancy Isaac @ 2009-05-29 17:20 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
Thank you! That was my problem. I was looking at the defines in
linux/irq.h and it didn't match what I was seeing at all....but this works
now.
On Fri, May 29, 2009 at 10:09 AM, Scott Wood <scottwood@freescale.com>wrote:
> On Thu, May 28, 2009 at 06:48:48PM -0700, Nancy Isaac wrote:
> > > Is the level/sense information correct?
> >
> >
> > [NI] Yes, these interrupts are supposed to be active low, level sensitive
> > interrupts.
>
> But the level/sense value for that on mpic is 1, not 2. 2 is active
> high (see Documentation/powerpc/booting-without-of.txt).
>
> -Scott
>
[-- Attachment #2: Type: text/html, Size: 952 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-29 17:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28 19:05 8544 external interrupt configuration problems Nancy Isaac
2009-05-28 20:02 ` Scott Wood
2009-05-29 1:48 ` Nancy Isaac
2009-05-29 17:09 ` Scott Wood
2009-05-29 17:20 ` Nancy Isaac
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).