Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1134419iol; Fri, 10 Jun 2022 00:34:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrq9u8V41hA4LrOxkm4Puw3Ebjo1m6U+7n/AEPOT85uJ8R935emoIo/GHOb8SSi/jLnn3T X-Received: by 2002:a17:903:22c6:b0:167:5991:fb63 with SMTP id y6-20020a17090322c600b001675991fb63mr33291157plg.37.1654846496378; Fri, 10 Jun 2022 00:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654846496; cv=none; d=google.com; s=arc-20160816; b=KmQfP+Eztfjqm8P7/C+5ntCynqJWZoFllV4scqCknFJcn6Air3rHFNv40sIxb2AXGy O8L5A5vprhfFyJ4ojaJ0FjfOLCjQNSbCJiJn4lUeUXYr0D+8yCwUUInYeGabXIy+ClvE Zcc7pJgl4utLBJnTffHa+6CptUd5meMZlCRF52sydAd4ZPMOQbMFP1qo/mZk64BRton6 pcoE2EBjPAf+uWaz+UMowteNKnF/VjFPiQMaOoq5cGGgUvM1SGunWaYgRGp+8xHoVecS S76AseWm56lVkbYLuYZSGXZeUS0l/LW61r7Yrc3S0toZwlmEKk4ptG/ljoec1Csnix/L 3gYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iHkHOcfIcyqgND3WATUEP59sgdDbodsRHQDHcTL8Pq0=; b=Uc76aE+ZxAq4XfC2VYYfjFzNH3egj9mGBBfPk9mQl1FGo6XrPfjTQhgi/KgCgrTlSR VAR+u4Z+7qtFch1Xi8hfTu6etMttN4C4GYn6kSXsPxUy4vVHyIjmuLNGhHTJ12MsdQrm aZzrpW6UMNJqzWtE3sRkl9j+mQ9HdiGPRkVIptvlJNMaxVs5AZTHFGRyMaz3nyuhlbjm Gwj7mRKeDbOmPVVvSIYEbw85ihPK8ho39CQEzEYii/cvowqWByZ1x2FaxJTAl4nTJVkV OGI5aiWLIjAdYdBzB4cOuETxwfuYBMUX2sT3xIWQuVTpO95qYBV5aPRcTJjxuBDl8BsQ 7I7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qp0RU2Lz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f190-20020a636ac7000000b003fcb19cf926si36333554pgc.48.2022.06.10.00.34.43; Fri, 10 Jun 2022 00:34:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qp0RU2Lz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346920AbiFJHYQ (ORCPT + 99 others); Fri, 10 Jun 2022 03:24:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346795AbiFJHXw (ORCPT ); Fri, 10 Jun 2022 03:23:52 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B9321C3B3; Fri, 10 Jun 2022 00:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654845830; x=1686381830; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=POm9JCNG8hbNwtmENSOZ9MbIkytxsFpCygdTnLttjFA=; b=Qp0RU2LzOuzhubuY+egvd67s4UG2dJVeEIbXUyr6WJuWfiNhlAD7+Os1 /Wu0cPP+nNOUe1TWI6tuF1NQ/2b8PZCGlhw10i+Yzh+9QDbk1EYxUKIY5 WvTj73lM2NH67rxuJAjrcIcFr3u6Y/ufa53GmgOe9jhOE2+75uhyAMfkE WOiDfSdbqVYSmyirMd6ShPK1X/iqQBwMZf8OjjQgniYUT5F7ZlACHi6fH AkZFH2Hc7shOUbWW654F+wBv2UUVrwNt48q9ppgmKNmylaBUQiQrG+PIN xGIj1O45crCZ94sGKxXxnwscTel0VOTuxpKrcCr7633dLaPVOpphQMkVb A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="302918958" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="302918958" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 00:23:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="649685430" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmsmga004.fm.intel.com with ESMTP; 10 Jun 2022 00:23:44 -0700 Date: Fri, 10 Jun 2022 15:15:47 +0800 From: Xu Yilun To: Ivan Bornyakov Cc: mdf@kernel.org, hao.wu@intel.com, trix@redhat.com, corbet@lwn.net, Ivan Bornyakov , Conor.Dooley@microchip.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-fpga@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, system@metrotek.ru Subject: Re: [PATCH v17 2/4] docs: fpga: mgr: document parse_header() callback Message-ID: <20220610071547.GA655812@yilunxu-OptiPlex-7050> References: <20220609154752.20781-1-i.bornyakov@metrotek.ru> <20220609154752.20781-3-i.bornyakov@metrotek.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609154752.20781-3-i.bornyakov@metrotek.ru> X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 09, 2022 at 06:47:50PM +0300, Ivan Bornyakov wrote: > Document newly introduced fpga_manager_ops callback parse_header() along > with header_size and data_size fields of struct fpga_image_info. > > Signed-off-by: Ivan Bornyakov > --- > Documentation/driver-api/fpga/fpga-mgr.rst | 31 ++++++++++++++++------ > 1 file changed, 23 insertions(+), 8 deletions(-) > > diff --git a/Documentation/driver-api/fpga/fpga-mgr.rst b/Documentation/driver-api/fpga/fpga-mgr.rst > index 42c01f396dce..db0852bd3ddc 100644 > --- a/Documentation/driver-api/fpga/fpga-mgr.rst > +++ b/Documentation/driver-api/fpga/fpga-mgr.rst > @@ -79,14 +79,29 @@ 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; > -if the whole bitstream is not immediately available then the core code will > -buffer up at least this much before starting. > + 1. .parse_header 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. If header_size is set, .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 a If FPGA image is already mapped as a Others look good to me. Thanks, Yilun > +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 it's defined, otherwise .initial_header_size; if the whole bitstream is not > +immediately available then the core code will buffer up at least this much > +before starting. > > The .write function writes a buffer to the FPGA. The buffer may be contain the > whole FPGA image or may be a smaller chunk of an FPGA image. In the latter > -- > 2.35.1 >