linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RE: fpga driver on custom PPC target platform (P4080) ...
@ 2011-11-03 22:12 Robert Sciuk
  2011-11-04 16:36 ` Tabi Timur-B04825
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Sciuk @ 2011-11-03 22:12 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: devicetree-discuss, linuxppc-dev



> -----Original Message-----
> From: Segher Boessenkool [mailto:segher@kernel.crashing.org]
> Sent: Thursday, November 03, 2011 5:22 PM
> To: Robert Sciuk
> Cc: devicetree-discuss@lists.ozlabs.org; linuxppc-dev@lists.ozlabs.org
> Subject: Re: fpga driver on custom PPC target platform (P4080) ...
>=20
> > 	- How does one specify in the device tree an FPGA which uses
> > both I2c bus and localbus for programming?
>=20
> You have two device nodes, one on the localbus and one on the IIC bus.
> One of the nodes points to the other, or both do; you point to another
> node by having a property containing the phandle of that other node.
>=20
> It's probably easiest to make the IIC node point to the localbus node,
> because you will most likely always have exactly one of those, and you
> could have multiple IIC nodes on your FPGA, or none at all.  But this
> is something you'll have to put in the device binding for your device,
> and it doesn't really matter what you choose -- it will work either
> way,
> some choices are more convenient than others though.
>=20
>=20
> Segher

Segher,

Actually, I'm just now re-configuring my device-tree i2c nodes to =
accurately reflect reality.  As the open() will be doing the i2c bit =
banging, I agree completely with your assessment, and I will access the =
FPGA's via the I2c bus, and locate the localbus port via the phandle =
8-).

dmesg | grep pca

[    2.699342] pca953x 2-00e8: failed reading register
[    2.708444] pca953x: probe of 2-00e8 failed with error -5
[    2.719097] pca953x 2-00e9: failed reading register
[    2.728192] pca953x: probe of 2-00e9 failed with error -5	=09

	i2c@119000 {
			#address-cells =3D <1>;
			#size-cells =3D <0>;
			cell-index =3D <2>;
			compatible =3D "fsl-i2c";
			reg =3D <0x119000 0x100>;
			interrupts =3D <39 2 0 0>;
			interrupt-parent =3D <&mpic>;
			dfsrr;

                        lim_r: gpio@e8 {
                                compatible =3D "nxp,pca9539";
                                reg =3D <0xe8>;
                                #gpio-cells =3D <2>;
                                gpio-controller;
                                polarity =3D <0x00>;
                        };

                        lim_w: gpio@e9 {
                                compatible =3D "nxp,pca9539";
                                reg =3D <0xe9>;
                                #gpio-cells =3D <2>;
                                gpio-controller;
                                polarity =3D <0x00>;
                        };

		};

It appears that I'm not correctly creating the pca9539 nodes as of yet =
(I'll be adding the phandles shortly).  Any pointers for pca9539 driver =
nodes would be appreciated, as I took these from a similar tree, but not =
the 95xx driver.  I'll match them up with the code in the morning ...


Thanks for your feedback, it was as timely as it was welcomed!

Cheers,
Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread
* fpga driver on custom PPC target platform (P4080) ...
@ 2011-11-02 22:43 Robert Sciuk
  2011-11-03 21:22 ` Segher Boessenkool
  0 siblings, 1 reply; 14+ messages in thread
From: Robert Sciuk @ 2011-11-02 22:43 UTC (permalink / raw)
  To: devicetree-discuss; +Cc: linuxppc-dev

Dear Tree lovers,

I'm in the process of designing and implementing a Linux device driver
for a Xilinx V6 FPGA which can be loaded from  the CPU (P4080) on our
target board (and optionally 2 additional FPGA's on a riser card).  The
programming pins of the FPGAs are tied to a MUX (PCA9539) on an i2c bus,
and the port is located on the localbus (simplebus).  I'm thinking that
a uio type driver could in theory set the programming bits using the i2c
mux upon open(), and that an mmap() in userspace would perform the .bits
load, and the programming done bit would be returned in the close() of
the device from userland.

I would like to use the device tree to map both the i2c access and the
localbus mappings, and I've yet to start coding, though this may start
RSN.  My questions to the list, are:

	- am I barking up the wrong tree here?
	- is there anyone who has done something similar before which
can be shared?
	- Is there an impedance problem having the device accessed on
both I2c and localbus?
	- Is there a problem combining device tree and uio drivers?
	- How does one specify in the device tree an FPGA which uses
both I2c bus and localbus for programming?

This is kind of an interesting project, as I've never written a
device-tree driver before, and I've yet to use uio type drivers, but it
does seem a good match for the problem.  Any comments or pointers would
be well received.

Thanks in advance, and sorry for cross-posting, I'm sure that some of
you may well see this message twice, and for that I'm sorry.

Robert Sciuk
Senior Designer, R&D.
905.738.3741 xt 22621

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

end of thread, other threads:[~2011-11-07 23:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 22:12 fpga driver on custom PPC target platform (P4080) Robert Sciuk
2011-11-04 16:36 ` Tabi Timur-B04825
2011-11-04 16:42   ` Robert Sciuk
2011-11-04 18:19   ` Robert Sciuk
2011-11-05  0:40     ` David Gibson
2011-11-07 18:48       ` Robert Sciuk
2011-11-07 20:09       ` Robert Sciuk
2011-11-07 21:31         ` Mitch Bradley
2011-11-07 21:50           ` Robert Sciuk
2011-11-07 22:14         ` Scott Wood
2011-11-07 23:07           ` Robert Sciuk
2011-11-07 23:29           ` Robert Sciuk
  -- strict thread matches above, loose matches on Subject: below --
2011-11-02 22:43 Robert Sciuk
2011-11-03 21:22 ` Segher Boessenkool

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