linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* of_serial and device trees
@ 2009-03-24  8:49 Simon Kagstrom
  2009-03-24 15:55 ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Kagstrom @ 2009-03-24  8:49 UTC (permalink / raw)
  To: linuxppc-dev

Hi!

I'm working on a custom Freescale 8544-based board and having some
trouble with getting the device tree right. In particular, we have a
setup which looks like this:

* We have an FPGA which contains a few serial ports, an interrupt
  controller and some other devices

* The serial ports are "normal" 16550s and interrupt the FPGA interrupt
  controller

* The interrupt controller is in turn cascaded to the 8544 OpenPIC
  (mpic).

My problem is that I can't figure out how to express this correctly in
the device tree for the board. My device tree looks like this ("isf" is
the name of the FPGA):

	isf@c0020000 {
		#address-cells = <1>;
		#size-cells = <1>;
		reg = <c0020000 00020000>;

                isf_pic: isf_pic@4000 {
                        device_type = "isf-pic";
                        compatible = "isf-pic";
                        interrupt-controller;
                        clock-frequency = <0>;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
                        reg = <4000 100>;
                        built-in;
                        interrupts = <4 1>;
                        interrupt-parent = <&mpic>;
                };

                serial2: isf-serial@4200 {
                        device_type = "serial";
                        compatible = "ns16550";
                        reg = <4200 100>;
                        clock-frequency = <13ab6680>; /* 330Mhz */
                        interrupts = <0 1>;
                        interrupt-parent = <&isf_pic>;
                };
                <... and a few more serial ports which look the same >

Following the example set in mpc85xx_ds.c, I lookup the interrupt
controller manually in the platform setup code (init_IRQ). Basically

        np = of_find_compatible_node(NULL, "isf-pic", "isf-pic");
        if (np == NULL) {
                printk(KERN_ERR "Could not find ISF PIC\n");
                return;
        }

and thereafter calling a custom setup function for the FPGA interrupt
controller. That appears to work fine, but I'm wondering how to get the
serial ports detected properly by of_serial.

I suppose I can do something similar in code to what is done in
arch/powerpc/kernel/legacy_serial.c:find_legacy_serial_ports, but I
thought I could do without that with the device trees. Is it so, or do
I have to add code to walk through and setup the rest of the serial
ports?

Thanks in advance,
// Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-26  0:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24  8:49 of_serial and device trees Simon Kagstrom
2009-03-24 15:55 ` Scott Wood
2009-03-25 14:51   ` Simon Kagstrom
2009-03-25 16:39     ` Scott Wood
2009-03-26  0:53       ` Michael Ellerman

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).