[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150114160617.02fb9135@lxorguk.ukuu.org.uk>
Date: Wed, 14 Jan 2015 16:06:17 +0000
From: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
To: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Cc: atull <atull@...nsource.altera.com>, Pavel Machek <pavel@...x.de>,
gregkh@...uxfoundation.org, hpa@...or.com, monstr@...str.eu,
michal.simek@...inx.com, rdunlap@...radead.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
pantelis.antoniou@...sulko.com, robh+dt@...nel.org,
grant.likely@...aro.org, iws@...o.caltech.edu,
linux-doc@...r.kernel.org, broonie@...nel.org, philip@...ister.org,
rubini@...dd.com, s.trumtrar@...gutronix.de, jason@...edaemon.net,
kyle.teske@...com, nico@...aro.org, balbi@...com,
m.chehab@...sung.com, davidb@...eaurora.org, rob@...dley.net,
davem@...emloft.net, cesarb@...arb.net, sameo@...ux.intel.com,
akpm@...ux-foundation.org, linus.walleij@...aro.org,
pawel.moll@....com, mark.rutland@....com,
ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
devel@...verdev.osuosl.org, delicious.quinoa@...il.com,
dinguyen@...nsource.altera.com, yvanderv@...nsource.altera.com
Subject: Re: [PATCH v8 2/4] fpga manager: add sysfs interface document
> The request_firmware interface should be for the DT overlay path, and
> other schemes shouldn't use it. The name should come from the DT and
> no place else.
For the static bindings agreed (or ACPI but that's a detail) or other
dynamic discovery post boot.
> 2) The bootloader starts the kernel and passes a DT that describes
> the hard logic and soft logic using a scheme like I outlined. The
> kernel is responsible to request_firmware the bitfile and start
> the FPGA and connect the drivers.
>
> DT purists will rightly point out that this isn't great, but it
> is a simple and pragmatic solution.
>
> This probably falls out automatically if #3 is implemented..
> 3) The bootloader starts the kernel with a DT that only describes the
> hard logic.
>
> Userspace must load a DT overlay early on. Otherwise proceeds like #2.
>
> In both 2 and 3 the FPGA can be reprogrammed on resume by re-doing
> request_firmware.
and I think you effectively have the user usage covered here for such
things. It much like GPIO pins - we can describe them but we can also
declare they are not visible to the user.
> And for folks that need more control, expose all the knobs explicitly
> to user space:
> 4) There is a /dev/ node for the fpga that allows
> - ioctl to program via mmap'd file (no request_firmware)
>
> The ioctl has an option for the kernel to hang on to the mmap
> for the repogram on resume case.
> - ioctl to get status/error reporting/etc
> - ioctl to load/bind a DT overlay to the FPGA instance
> This provides a gap where userspace can boot and configure the
> FPGA internals before binding the kernel drivers.
> (end result is the same as #3 case, but no request_firmware)
> - (future) ioctl to load a swappable FPGA (what Alan is talking
> about)
The swappable case mostly comes out of the /dev node. Once you have the
dev node it becomes a detail of the OS not the FPGA driver as to who may
open it, and how it is handed about. It might be an FPU manager daemon it
might not.
> The key thing is that we have a FPGA object that can be associated
> with some DT element, and the kernel can then keep track if the FPGA
> is is in use or not. Exactly like you said in your reply.
I think this is right. You have a set of FPGA objects initially coming
from DT and system enumerations and later maybe even showing up via
hotplug.
You have a set of bindings which describes what to do with those that
have fixed bindings.
The fpga /dev entries are then a subset of the enumerated list which has
not been marked as OS in use (or they return -EBUSY and can't be opened)
At that point it works like pretty much everything else.
> I have no problem with the in kernel stuff, and I'd have no problem if
> the sysfs controls were in debugfs for testing purposes. It just
> doesn't make sense to me to expose that kind of interface as a
> permanent API...
That's my big concern too. We need an FPGA manager in kernel clearly. We
need kernel ability to program FPGA bitstreams (if only because there are
both boot time and suspend/resume cases that turn into complete insanity
otherwise).
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists