lkml.org 
[lkml]   [2021]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 0/5] Firmware Upload Framework
On Thu, Dec 09, 2021 at 07:15:06AM -0800, Tom Rix wrote:
>
> On 11/17/21 11:20 AM, Bjorn Andersson wrote:
> > On Mon 15 Nov 05:57 PST 2021, Tom Rix wrote:
> >
> > > On 11/10/21 5:13 PM, Russ Weight wrote:
> > > > The Firmware Upload framework provides a common API for uploading firmware
> > > > files to target devices. An example use case involves FPGA devices that
> > > > load FPGA, Card BMC, and firmware images from FLASH when the card boots.
> > > > Users need the ability to update these firmware images while the card is
> > > > in use.
> > > >
> > > > Device drivers that instantiate the Firmware Upload class driver will
> > > > interact with the target device to transfer and authenticate the firmware
> > > > data. Uploads are performed in the context of a kernel worker thread in
> > > > order to facilitate progress indicators during lengthy uploads.
> > > >
> > > > This driver was previously submitted in the context of the FPGA sub-
> > > > system as the "FPGA Image Load Framework", but the framework is generic
> > > > enough to support other devices as well. The previous submission of this
> > > > patch-set can be viewed here:
> > > >
> > > > https://marc.info/?l=linux-kernel&m=163295640216820&w=2
> > > >
> > > > The n3000bmc-sec-update driver is the first driver to use the Firmware
> > > > Upload API. A recent version of these patches can be viewed here:
> > > >
> > > > https://marc.info/?l=linux-kernel&m=163295697217095&w=2
> > > >
> > > > I don't think I am duplicating any functionality that is currently covered
> > > > in the firmware subsystem. I appreciate your feedback on these patches.
> > > This may be a common api for fpga/dfl-, but it is not likely common for
> > > general devices.
> > >
> > During my years of hacking on device drivers I've run into the need for
> > being able to reflash/update firmware in things such as touchscreen
> > controllers, hdmi bridges, usb network devices and (embedded) usb hubs.
> >
> > The implementation typically manifest itself as some sysfs or debugfs
> > knob which when written triggers a request_firmware() followed by the
> > operation to write the content to flash. But the result is often quite
> > hacky and requires that you store the firmware-to-be-written in some
> > path that will be looked at by request_firmware() - and hence these
> > patches often doesn't end up upstream.
> >
> > So I'm certainly in favor of some generic way for drivers to expose an
> > interface for userspace to flash new firmware to their associated
> > hardware.
>
> The image to be loaded is not really firmware and not really a partial
> reconfiguration image.  It is both.

The kernel does not care. It is a "blob of data to be sent to the
device". Traditionally we have called this "firmware", and so the api
is called that. But it could be anything, the kernel does not parse it
or care at all, it is just a pipe from userspace to the device to
transfer the data.

> Which image is used depends on the end user's workload for the n3000 and
> could change and need reloading day to day.
>
> Because the n3000 is unusable without this change, I would like to see
> updating working first for the n3000.
>
> Then the interface generalized as other devices are found that have a
> similar use case.
>
> This is a device specific feature so it should go somewhere like
> drivers/fpga/dfl-n3000-update.c

Then have that driver call the firmware api, that's what it is there
for.

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-12-09 16:35    [W:0.093 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site