More DTS questions

3 messages, 3 authors, 2008-09-04 · open the first message on its own page

More DTS questions

From: Gary Thomas <hidden>
Date: 2008-09-03 13:36:00

Thanks for the pointer to the DTC/DTS documents.  These
help, but I still have many questions and am unsure how
to solve some problems.

Most particularly, I have a number of platforms with
"extended" interrupts.  In these cases, I have an FPGA
which is used as an interrupt controller, multiplexing
a number of external interrupt sources into one [or more]
processor interrupts.

In the past (arch/ppc world), I simple expanded the number
of interrupts on the platform (NUM_IRQ) such that interrupts
0..N were the standard platform interrupts and N+1..M were
provided by my FPGA.  The FPGA support had its own interrupt
tables, etc.  Simply installing a single IRQ handler for the
composite got me to the FPGA handler which then de-multiplexed
and passed on the interrupt to the handler for the external
device.

I'm a bit lost as to how to describe this in the DTS.  For
example, I have a platform with PCI.  I can see how to setup
the rest of the PCI stuff (slots, addresses, etc), but I need
to tell it that the interrupt [in this case list corresponding
to INTA..INTD] is handled by this FPGA based interrupt controller.

Looking at some examples in the sources only bring more questions.
Perhaps someone can guide me through this (from the TQM5200):

        pci@f0000d00 {
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
                device_type = "pci";
                compatible = "fsl,mpc5200-pci";
                reg = <0xf0000d00 0x100>;
                interrupt-map-mask = <0xf800 0 0 7>;
                interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3
                                 0xc000 0 0 2 &mpc5200_pic 0 0 3
                                 0xc000 0 0 3 &mpc5200_pic 0 0 3
                                 0xc000 0 0 4 &mpc5200_pic 0 0 3>;

26 more lines

Re: More DTS questions

From: Scott Wood <hidden>
Date: 2008-09-03 17:12:25

On Wed, Sep 03, 2008 at 07:36:00AM -0600, Gary Thomas wrote:
        pci@f0000d00 {
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
                device_type = "pci";
                compatible = "fsl,mpc5200-pci";
                reg = <0xf0000d00 0x100>;
                interrupt-map-mask = <0xf800 0 0 7>;
                interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3
                                 0xc000 0 0 2 &mpc5200_pic 0 0 3
                                 0xc000 0 0 3 &mpc5200_pic 0 0 3
                                 0xc000 0 0 4 &mpc5200_pic 0 0 3>;
                clock-frequency = <0>; // From boot loader
                interrupts = <2 8 0 2 9 0 2 10 0>;
                interrupt-parent = <&mpc5200_pic>;
                bus-range = <0 0>;
                ranges = <0x42000000 0 0x80000000 0x80000000 0 0x10000000
                          0x02000000 0 0x90000000 0x90000000 0 0x10000000
                          0x01000000 0 0x00000000 0xa0000000 0 0x01000000>;
        };

The things that truly aren't clear are the various lists.
For example, how does "interrupt-map" and "interrupts" describe
how the interrupts are handled? 
It is described in this document:
http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf
I don't see any reference in the code to these names (how does a driver
get access to such properties?)
Look in arch/powerpc/kernel/prom_parse.c.

You'll want to change &mpc5200_pic in your interrupt-map to point to your
FPGA interrupt controller, and change the interrupt specifiers accordingly.

-Scott

Re: More DTS questions

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-09-04 03:18:55

quoted
The things that truly aren't clear are the various lists.
For example, how does "interrupt-map" and "interrupts" describe
how the interrupts are handled? 
It is described in this document:
http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf
And in Documentation/powerpc/booting-without-of.txt
quoted
I don't see any reference in the code to these names (how does a driver
get access to such properties?)
Look in arch/powerpc/kernel/prom_parse.c.

You'll want to change &mpc5200_pic in your interrupt-map to point to your
FPGA interrupt controller, and change the interrupt specifiers accordingly.
Yeah, basically. You create a node for your cascaded interrupt
controller, point some interrupts at it, etc...

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