From: Michal Simek <michal.simek@xilinx.com>
To: linux-kernel@vger.kernel.org, monstr@monstr.eu
Cc: Alan Tull <atull@altera.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dinh Nguyen <dinguyen@altera.com>,
Philip Balister <philip@balister.org>,
Alessandro Rubini <rubini@gnudd.com>,
Dom Cobley <popcornmix@gmail.com>,
Mauro Carvalho Chehab <m.chehab@samsung.com>,
David Brown <davidb@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>,
Joe Perches <joe@perches.com>,
Cesar Eduardo Barros <cesarb@cesarb.net>,
Arnd Bergmann <arnd@arndb.de>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Warren <swarren@nvidia.com>
Subject: [RFC PATCH 0/1] FPGA subsystem core
Date: Wed, 18 Sep 2013 17:56:38 +0200 [thread overview]
Message-ID: <cover.1379519753.git.michal.simek@xilinx.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]
Hi All,
this is the first attempt to introduce new Linux FPGA subsystem which
can help us to unify all fpga drivers which in general do the same
things.
Xilinx has hwicap in the kernel as char driver (drivers/char/xilinx_hwicap/)
and I would like to base Zynq devcfg driver based on this interface
because make no sense to push the Linux kernel another char driver
(I am testing this interface on this driver).
Based on my discussion at ELC with Greg KH the new driver
should support firmware interface for loading bitstream.
FPGA manager/driver just define set of functions and
call fpga_mgr_register().
struct fpga_manager_ops zynq_fpga_mgr_ops = {
.status = zynq_fpga_status,
.read_init = zynq_init,
.write_init = zynq_init,
.read = zynq_read,
.write = zynq_write,
.read_complete = zynq_complete,
.write_complete = zynq_complete,
};
fpga_mgr_register(pdev, &zynq_fpga_mgr_ops, "Zynq FPGA Manager", priv);
For unregistration it is enough to call:
fpga_mgr_unregister(pdev);
Subsystem supports working with phandles for cases where you want to load
bitstreams for particular device though defined device.
For example:
mngr@0 {
compatible = "whatever";
fpga-mgr = <&ps7_dev_cfg_0>;
...
} ;
With these lines you can get easily load bitstream to the device.
struct fpga_manager *mgr;
mgr = of_find_fpga_mgr_by_phandle(pdev->dev.of_node, "fpga-mgr");
if (mgr)
mgr->fpga_write(mgr, "filename");
NOTE: I have added there of_find_fpga_mgr_by_node()
and of_find_fpga_mgr_by_phandle() but maybe they should be added
separately to drivers/of/of_fpga.c.
Alessandro: I haven't looked at your FMC cases but maybe this
could be also worth for your cases.
TODO:
- Probably make sense to create doc in Documentation folder too.
- When interface is fine also send zynq devcfg driver
Thanks for your comments,
Michal
Michal Simek (1):
fpga: Introduce new fpga subsystem
MAINTAINERS | 7 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/fpga/Kconfig | 18 ++
drivers/fpga/Makefile | 5 +
drivers/fpga/fpga-mgr.c | 433 ++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/fpga.h | 105 ++++++++++++
7 files changed, 571 insertions(+)
create mode 100644 drivers/fpga/Kconfig
create mode 100644 drivers/fpga/Makefile
create mode 100644 drivers/fpga/fpga-mgr.c
create mode 100644 include/linux/fpga.h
--
1.8.2.3
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
next reply other threads:[~2013-09-18 15:57 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 15:56 Michal Simek [this message]
2013-09-18 15:56 ` [RFC PATCH] fpga: Introduce new fpga subsystem Michal Simek
2013-09-18 16:11 ` Joe Perches
2013-09-19 10:01 ` Michal Simek
2013-09-19 16:26 ` Alan Tull
2013-09-18 19:02 ` Dinh Nguyen
2013-09-19 11:53 ` Michal Simek
2013-09-18 19:15 ` Jason Cooper
2013-09-18 20:32 ` Jason Gunthorpe
2013-09-18 21:17 ` Alan Tull
2013-09-19 10:08 ` Pavel Machek
2013-09-19 11:02 ` Michal Simek
2013-09-20 20:55 ` Alan Tull
2013-09-24 15:55 ` Alan Tull
2013-09-24 15:58 ` Michal Simek
2013-09-24 16:22 ` Alan Tull
2013-09-24 22:18 ` Greg Kroah-Hartman
2013-09-25 13:55 ` Yves Vandervennet
2013-09-25 14:51 ` Michal Simek
2013-09-25 18:50 ` Alan Tull
2013-09-24 22:54 ` H. Peter Anvin
2013-09-25 10:41 ` Michal Simek
2013-09-25 12:00 ` Pavel Machek
2013-09-25 14:27 ` Philip Balister
2013-09-25 14:43 ` Michal Simek
2013-09-25 19:21 ` Alan Tull
2013-09-19 10:55 ` Michal Simek
2013-09-19 11:17 ` Pavel Machek
2013-09-19 11:22 ` Michal Simek
2013-09-19 12:52 ` /sys rules " Pavel Machek
2013-09-19 14:06 ` Greg KH
2013-09-19 14:10 ` Michal Simek
2013-09-19 14:18 ` Greg KH
2013-09-19 15:14 ` Alan Tull
2013-09-19 14:20 ` Jason Cooper
2013-09-19 14:37 ` Greg KH
2013-09-19 22:48 ` Pavel Machek
[not found] ` <CADuitaA3PLaOgmqXzfMdMDaXg7G6bT-DufjcuhtWfvaoWRj__Q@mail.gmail.com>
2013-09-19 15:14 ` Michal Simek
2013-09-19 15:18 ` Yves Vandervennet
2013-09-19 17:28 ` Jason Gunthorpe
2013-09-23 13:10 ` Michal Simek
2013-09-23 17:10 ` Jason Gunthorpe
2013-09-25 10:48 ` Michal Simek
2013-09-23 13:02 ` Michal Simek
2013-09-19 10:03 ` Pavel Machek
2013-09-19 10:45 ` Michal Simek
2013-09-27 13:31 ` Michal Simek
2013-09-30 17:12 ` Jason Gunthorpe
2013-10-01 15:59 ` Michal Simek
2013-09-18 23:45 ` Ryan Mallon
2013-09-19 11:37 ` Michal Simek
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=cover.1379519753.git.michal.simek@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=atull@altera.com \
--cc=cesarb@cesarb.net \
--cc=davem@davemloft.net \
--cc=davidb@codeaurora.org \
--cc=dinguyen@altera.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=monstr@monstr.eu \
--cc=pavel@ucw.cz \
--cc=philip@balister.org \
--cc=popcornmix@gmail.com \
--cc=rubini@gnudd.com \
--cc=swarren@nvidia.com \
/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 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).