lkml.org 
[lkml]   [2022]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v17 1/4] fpga: fpga-mgr: support bitstream offset in image buffer
On Fri, Jun 10, 2022 at 03:43:11PM +0800, Xu Yilun wrote:
> On Thu, Jun 09, 2022 at 06:47:49PM +0300, Ivan Bornyakov wrote:
> > At the moment FPGA manager core loads to the device entire image
> > provided to fpga_mgr_load(). But it is not always whole FPGA image
> > buffer meant to be written to the device. In particular, .dat formatted
> > image for Microchip MPF contains meta info in the header that is not
> > meant to be written to the device. This is issue for those low level
> > drivers that loads data to the device with write() fpga_manager_ops
> > callback, since write() can be called in iterator over scatter-gather
> > table, not only linear image buffer. On the other hand, write_sg()
> > callback is provided with whole image in scatter-gather form and can
> > decide itself which part should be sent to the device.
> >
> > Add header_size and data_size to the fpga_image_info struct and adjust
> > fpga_mgr_write() callers with respect to them.
> >
> > * info->header_size indicates part at the beginning of image buffer
> > that is *not* meant to be written to the device. It is optional and
> > can be 0.
> >
> > * info->data_size is the size of actual bitstream data that *is* meant
> > to be written to the device, starting at info->header_size from the
> > beginning of image buffer. It is also optional and can be 0, which
> > means bitstream data is up to the end of image buffer.
> >
> > Also add parse_header() callback to fpga_manager_ops, which purpose is
> > to set info->header_size and info->data_size. At least
> > initial_header_size bytes of image buffer will be passed into
> > parse_header() first time. 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.
> >
> > Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
> > ---
> > drivers/fpga/fpga-mgr.c | 243 +++++++++++++++++++++++++++++-----
> > include/linux/fpga/fpga-mgr.h | 17 ++-
> > 2 files changed, 229 insertions(+), 31 deletions(-)
> >
> > diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
> > index 08dc85fcd511..0854fbc8f11e 100644
> > --- a/drivers/fpga/fpga-mgr.c
> > +++ b/drivers/fpga/fpga-mgr.c
>
> Should we check in fpga_mgr_create, that initial_header_size must not be
> 0 if parse_header() is defined. If we pass no data to parse_header(),
> does it make any sense?

Sorry, there is no fpga_mgr_create now, should be fpga_mgr_register_full

Thanks,
Yilun

\
 
 \ /
  Last update: 2022-06-10 10:14    [W:0.069 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site