Commit Graph

3 Commits

Author SHA1 Message Date
Mark Langsdorf 952d6c7edf firmware_loader: Move definitions from sysfs_upload.h to sysfs.h
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2122318

commit f8ae07f4b8bfde0f33761e1a1aaee45a4e85e9d6
Author: Russ Weight <russell.h.weight@intel.com>
Date: Tue, 26 Apr 2022 13:03:56 -0700

Move definitions required by sysfs.c from sysfs_upload.h to sysfs.h so
that sysfs.c does not need to include sysfs_upload.h.

Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20220426200356.126085-3-russell.h.weight@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2022-10-25 15:20:23 -04:00
Mark Langsdorf e34757c3de firmware_loader: Add sysfs nodes to monitor fw_upload
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2122318

commit 536fd8184b7dfa30e28e5b459e7c5c91c3a8063f
Author: Russ Weight <russell.h.weight@intel.com>
Date: Thu, 21 Apr 2022 14:22:01 -0700

Add additional sysfs nodes to monitor the transfer of firmware upload data
to the target device:

cancel: Write 1 to cancel the data transfer
error: Display error status for a failed firmware upload
remaining_size: Display the remaining amount of data to be transferred
status: Display the progress of the firmware upload

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Tianfei zhang <tianfei.zhang@intel.com>
Tested-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20220421212204.36052-6-russell.h.weight@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2022-10-25 15:20:23 -04:00
Mark Langsdorf ae5143e8c7 firmware_loader: Add firmware-upload support
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2122318

commit 97730bbb242cde22b7140acd202ffd88823886c9
Author: Russ Weight <russell.h.weight@intel.com>
Date: Thu, 21 Apr 2022 14:22:00 -0700

Extend the firmware subsystem to support a persistent sysfs interface that
userspace may use to initiate a firmware update. For example, FPGA based
PCIe cards load firmware and FPGA images from local FLASH when the card
boots. The images in FLASH may be updated with new images provided by the
user at his/her convenience.

A device driver may call firmware_upload_register() to expose persistent
"loading" and "data" sysfs files. These files are used in the same way as
the fallback sysfs "loading" and "data" files. When 0 is written to
"loading" to complete the write of firmware data, the data is transferred
to the lower-level driver using pre-registered call-back functions. The
data transfer is done in the context of a kernel worker thread.

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Tianfei zhang <tianfei.zhang@intel.com>
Tested-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20220421212204.36052-5-russell.h.weight@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2022-10-25 15:20:18 -04:00