summaryrefslogtreecommitdiff
path: root/Documentation/driver-api
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-11 13:30:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-11 13:30:24 +0300
commit4682f21368352ce087e3a2f73e1e6d776c38f685 (patch)
tree80e44228a65362393be6929e03f37307b49c5370 /Documentation/driver-api
parentf5fd903b311fc4fa5511259fcf414d866a016c7c (diff)
parentee794221a6f66d054beb1cbc151d8de4083e634e (diff)
downloadlinux-4682f21368352ce087e3a2f73e1e6d776c38f685.tar.xz
Merge tag 'fpga-late-for-5.20-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next
Xu writes: Here is the second set of FPGA changes for 5.20-rc1 FPGA Manager core: - Ivan's change to support image offset and data size setting for reprograming. A parse_header() callback is introduced for drivers to specify these info. - Colin's immediate spelling fix for Ivan's patch. Microchip: - Ivan's change to add Microchip MPF FPGA manager driver. And MAINTAINERS entry added for the driver. All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of our for-next branch). Signed-off-by: Xu Yilun <yilun.xu@intel.com> * tag 'fpga-late-for-5.20-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: fpga-mgr: Fix spelling mistake "bitsream" -> "bitstream" MAINTAINERS: add Microchip PolarFire FPGA drivers entry dt-bindings: fpga: add binding doc for microchip-spi fpga mgr fpga: microchip-spi: add Microchip MPF FPGA manager docs: fpga: mgr: document parse_header() callback fpga: fpga-mgr: support bitstream offset in image buffer
Diffstat (limited to 'Documentation/driver-api')
-rw-r--r--Documentation/driver-api/fpga/fpga-mgr.rst27
1 files changed, 21 insertions, 6 deletions
diff --git a/Documentation/driver-api/fpga/fpga-mgr.rst b/Documentation/driver-api/fpga/fpga-mgr.rst
index 42c01f396dce..49c0a9512653 100644
--- a/Documentation/driver-api/fpga/fpga-mgr.rst
+++ b/Documentation/driver-api/fpga/fpga-mgr.rst
@@ -79,12 +79,27 @@ do the programming sequence for this particular FPGA. These ops return 0 for
success or negative error codes otherwise.
The programming sequence is::
- 1. .write_init
- 2. .write or .write_sg (may be called once or multiple times)
- 3. .write_complete
-
-The .write_init function will prepare the FPGA to receive the image data. The
-buffer passed into .write_init will be at most .initial_header_size bytes long;
+ 1. .parse_header (optional, may be called once or multiple times)
+ 2. .write_init
+ 3. .write or .write_sg (may be called once or multiple times)
+ 4. .write_complete
+
+The .parse_header function will set header_size and data_size to
+struct fpga_image_info. Before parse_header call, header_size is initialized
+with initial_header_size. If flag skip_header of fpga_manager_ops is true,
+.write function will get image buffer starting at header_size offset from the
+beginning. If data_size is set, .write function will get data_size bytes of
+the image buffer, otherwise .write will get data up to the end of image buffer.
+This will not affect .write_sg, .write_sg will still get whole image in
+sg_table form. If FPGA image is already mapped as a single contiguous buffer,
+whole buffer will be passed into .parse_header. If image is in scatter-gather
+form, core code will buffer up at least .initial_header_size before the first
+call of .parse_header, if it is not enough, .parse_header should set desired
+size into info->header_size and return -EAGAIN, then it will be called again
+with greater part of image buffer on the input.
+
+The .write_init function will prepare the FPGA to receive the image data. The
+buffer passed into .write_init will be at least info->header_size bytes long;
if the whole bitstream is not immediately available then the core code will
buffer up at least this much before starting.