linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Moritz Fischer <mdf@kernel.org>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Alan Tull <atull@kernel.org>, Moritz Fischer <mdf@kernel.org>,
	linux-fpga@vger.kernel.org, Marek Vasut <marek.vasut@gmail.com>
Subject: Re: [PATCH] fpga: add simple userspace interface to trigger FPGA programming
Date: Mon, 11 Dec 2017 14:05:45 -0800	[thread overview]
Message-ID: <20171211220545.GA12954@tyrael.ni.corp.natinst.com> (raw)
In-Reply-To: <818e6012-6919-7428-1d05-79d5b89a5e1d@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2670 bytes --]

On Sun, Dec 10, 2017 at 02:59:36PM -0800, Florian Fainelli wrote:
> 
> 
> On 12/10/2017 02:44 PM, Thomas Petazzoni wrote:
> > Hello,
> > 
> > On Sat, 9 Dec 2017 22:03:06 -0600, Alan Tull wrote:
> > 
> >>> We can actually use the Linux device driver model to do that though.
> >>> Assuming all peripherals behind the FPGA do have the FPGA manager's
> >>> struct device as a parent (which they should), when there is a bistream
> >>> load request, we ought to be able to teardown all of these child struct
> >>> device's and their corresponding drivers (unbind), load the bistream,
> >>> and then rebind the drivers accordingly.  
> >>
> >> Hi Florain,
> >>
> >> FPGA regions are a way of handling all that plus the bridges [1] or
> >> are you proposing something else?  An FPGA region knows what manager
> >> to use and what bridges (if any) needs to be disabled while
> >> programming is happening.  Applying a DT overlay targeting a FPGA
> >> region is used to program the FPGA.
> > 
> > I thought my initial patch made it clear: DT overlays are not an
> > applicable solution for my use case, for two reasons:
> > 
> >  1. My platform doesn't use Device Tree at all.
> > 
> >  2. The device implemented in the FPGA is self-discoverable because it
> >     sits on a PCI bus, so there is no point in doing a static
> >     description of the device in a DT overlay.
> 
> Agreed, sorry for side tracking the discussion a bit on that topic.

I do agree that wee need to find a solution for this. We should not
force people to use DT overlays in a system that is discoverable,
or out of tree hacks.

> 
> > 
> > So, solutions based on DT overlays are quite irrelevant for my use
> > case. Am I missing something here ?
> 
> I don't think you are, in fact, as it stands today, unless your FPGA has
> a bistream which is already loaded, in which case you don't really need
> the FPGA manager framework at all, this framework is completely useless
> in offering people the ability to load bistreams on non-DT enabled
> platforms without resorting to out of tree hacks like this one for instance:
> 
> https://github.com/ffainelli/linux/commit/78a4824165d7bf627c1b2dbb645ce013185331de
> 
> So what needs to be done so we can allow people to take full advantage
> of the fact that FPGAs are (re)programmable, even when the platform does
> not use DT?


I like your suggestion of tying into the device model, to tear down
everything underneath.

Would making the PCIe root complex a child to a FPGA region work? Seems
clumsy. Do we have other examples of devices reloading firmware
triggered by userland?

- Moritz

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2017-12-11 22:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 15:43 [PATCH] fpga: add simple userspace interface to trigger FPGA programming Thomas Petazzoni
2017-12-04 15:50 ` Alan Tull
2017-12-04 15:58   ` Thomas Petazzoni
2017-12-04 16:25     ` Alan Tull
2017-12-04 16:49       ` Moritz Fischer
2017-12-04 17:30         ` Alan Tull
2017-12-09 18:05   ` Florian Fainelli
2017-12-10  4:03     ` Alan Tull
2017-12-10 22:44       ` Thomas Petazzoni
2017-12-10 22:59         ` Florian Fainelli
2017-12-11 22:05           ` Moritz Fischer [this message]
2017-12-11 23:32             ` Alan Tull
2017-12-13  6:30         ` yves.vandervennet
2017-12-13  5:23           ` Thomas Petazzoni
2017-12-13 15:59             ` Alan Tull
2017-12-14  5:27               ` Thomas Petazzoni
2017-12-14 20:10                 ` Alan Tull
2017-12-10 22:42     ` Thomas Petazzoni
2018-08-11 15:01 ` Philippe De Muyter

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=20171211220545.GA12954@tyrael.ni.corp.natinst.com \
    --to=mdf@kernel.org \
    --cc=atull@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=thomas.petazzoni@free-electrons.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).