Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: fpga: mgr: document parse_header() callback

Document newly introduced fpga_manager_ops callback parse_header() and
flag skip_header along with header_size and data_size fields of struct
fpga_image_info.

Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20220623163248.3672-3-i.bornyakov@metrotek.ru
Signed-off-by: Xu Yilun <yilun.xu@intel.com>

authored by

Ivan Bornyakov and committed by
Xu Yilun
288cc44b 3cc624be

+20 -5
+20 -5
Documentation/driver-api/fpga/fpga-mgr.rst
··· 79 79 success or negative error codes otherwise. 80 80 81 81 The programming sequence is:: 82 - 1. .write_init 83 - 2. .write or .write_sg (may be called once or multiple times) 84 - 3. .write_complete 82 + 1. .parse_header (optional, may be called once or multiple times) 83 + 2. .write_init 84 + 3. .write or .write_sg (may be called once or multiple times) 85 + 4. .write_complete 85 86 86 - The .write_init function will prepare the FPGA to receive the image data. The 87 - buffer passed into .write_init will be at most .initial_header_size bytes long; 87 + The .parse_header function will set header_size and data_size to 88 + struct fpga_image_info. Before parse_header call, header_size is initialized 89 + with initial_header_size. If flag skip_header of fpga_manager_ops is true, 90 + .write function will get image buffer starting at header_size offset from the 91 + beginning. If data_size is set, .write function will get data_size bytes of 92 + the image buffer, otherwise .write will get data up to the end of image buffer. 93 + This will not affect .write_sg, .write_sg will still get whole image in 94 + sg_table form. If FPGA image is already mapped as a single contiguous buffer, 95 + whole buffer will be passed into .parse_header. If image is in scatter-gather 96 + form, core code will buffer up at least .initial_header_size before the first 97 + call of .parse_header, if it is not enough, .parse_header should set desired 98 + size into info->header_size and return -EAGAIN, then it will be called again 99 + with greater part of image buffer on the input. 100 + 101 + The .write_init function will prepare the FPGA to receive the image data. The 102 + buffer passed into .write_init will be at least info->header_size bytes long; 88 103 if the whole bitstream is not immediately available then the core code will 89 104 buffer up at least this much before starting. 90 105