From: Martyn Welch <martyn.welch@ge.com>
To: Michael Remski <mremski@comcast.net>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: spi device from handle
Date: Fri, 13 Jan 2012 09:32:09 +0000 [thread overview]
Message-ID: <4F0FFA19.7070606@ge.com> (raw)
In-Reply-To: <alpine.BSF.2.00.1201121056330.21456@payne.remski.net>
On 12/01/12 16:02, Michael Remski wrote:
> kernel 2.6.33
>
> relevant section of dts has:
> spi@7000 {
> fpga0: fpga@0 {
> #address-cells = <1>;
> #size-cells = <0>;
> compatible = "fsl, espi-fpga";
> reg = <0>;
> linux,modalias = "spidev";
> spi-max-frequency = <1572864>;
> };
> }
>
>
> I have another device driver that needs to talk to this fpga device, but for
> the life of me I can't figure out the appropriate hooks to get there. The
> device can be talked to from userland via /dev/spixyx.k, but how do I get to
> the device from another driver?
>
> Any little hints would be appreciated. Upgrading kernel is not an option
> (sorry).
>
We have a FPGA that provides a number of different functions. Each function is
provided in a distinct register set. We have multiple entries in the DTS, one
for each piece of functionality. The drivers are then able to bind separately
against the required registers. So in the case of
"arch/powerpc/boot/dts/gef_ppc9a.dts", "fpga@4,0", "wdt@4,2000", "wdt@4,2010",
"pic@4,4000" and "gpio@7,14000" are all provided by the same FPGA and each has
it's own driver. However, I've just realised our FPGA is memory mapped and
looking at your DTS snippet yours isn't.
The only clean way I can think about doing it via spi would be to have a
driver that provides an in-kernel interface to access the functionality in the
FPGA (which binds to this entry in the DTS), then modify the driver providing
the user space access to use that and also use that interface for other
drivers needing access to the FPGA. Depending on the level of extrapolation
provided by the existing user space driver, this may be possible without
breaking anything in user space.
Martyn
--
Martyn Welch (Lead Software Engineer) | Registered in England and Wales
GE Intelligent Platforms | (3828642) at 100 Barbirolli Square
T +44(0)1327322748 | Manchester, M2 3AB
E martyn.welch@ge.com | VAT:GB 927559189
next prev parent reply other threads:[~2012-01-13 9:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 16:02 spi device from handle Michael Remski
2012-01-13 9:32 ` Martyn Welch [this message]
2012-01-13 9:53 ` Michael Remski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F0FFA19.7070606@ge.com \
--to=martyn.welch@ge.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mremski@comcast.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.