Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3677337iog; Tue, 21 Jun 2022 03:48:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vU/Kt8xpocGp7m8aAtXA47iu44v9ZpbFb91f6wTdYtsD1c6tO3ZhYWCI7v3AbNo5hzddiE X-Received: by 2002:aa7:c50c:0:b0:435:66b7:3dad with SMTP id o12-20020aa7c50c000000b0043566b73dadmr23757309edq.397.1655808514163; Tue, 21 Jun 2022 03:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655808514; cv=none; d=google.com; s=arc-20160816; b=ljvLSu2GgFVZUpQWqGLDpZrNmrULqpQ7mQeBbh3K1RkWx1mRn6vjLCBbJgZvmaAxr2 x3WyYdZczQH0gfunON3wNtIGhbvM+B8QZRaODce5/n7EC1U+quWzdYJQbFDjpWn1zI0B T5XHz32UovsH7yKmO2v+oIVVyQYtvmlA8G4txOvmjcCEGcqS10kyoAQ2r+SjBZ0Jj50l CdczdTFQ5qE86Nct1qo3deMlnooHqkC/wFxCmq2tWnTWiKpqjmwWNpY56w7jFA7eNhMa w+rbEIF3h4dGVA7lluBeiwvlMfhvv8liRTuY599DnUun2pJ5sBPf2iI+e3qJtls3tFg8 eKkA== 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=6/98yzWfKNm5TVKKi7VL40Pdf0u4OBlbVsPxrANlBeU=; b=e6WI6O7AWwp6WQngcBb1I3zBXPbn6QsHWdi/C4bgSlQVmEDJcFHZ/bP/glkD9pXPJ9 UkczVNiIu0hldeTDoPVPNSKUqwzA8uL1v8RwNs6ijCbUUfg3/VN7AQd7wvbcL6Oi8Ozl zMAeO8y+YrYB1rUoZhZeEnZsLTHB8D370dtpJA+kfzNNV4IaZoOsFH3px+3J0KRvr3Ny 8wMYYfWlqM9Dml4hNcjUH3u1/6A9vKeoacYaygaf2FVXkQIgs+AYyQ1+QTjgl11XL3m4 Z0sVVQv1XcsV5xt0s2UijAhzCoGXl5K+BH4xWd9ndoIlaP4UV+CWW/AOiWVKWA0+HxLM CIng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IErzzsYx; 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 g8-20020a1709065d0800b006feb18c72bfsi13996837ejt.126.2022.06.21.03.48.07; Tue, 21 Jun 2022 03:48:34 -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=IErzzsYx; 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 S230029AbiFUKpV (ORCPT + 99 others); Tue, 21 Jun 2022 06:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiFUKpR (ORCPT ); Tue, 21 Jun 2022 06:45:17 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773C4286D4; Tue, 21 Jun 2022 03:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655808316; x=1687344316; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=92qWkWzDZRR+3vN9HA1g36iku2zgJgrFBeBrin/KXIc=; b=IErzzsYxL0TpuYIdNFbt8LJ0Vq7bwJBPft31fbYi1e92KCMgOaLS5QLE 8SqY9MBWLfJ7mXEmih9/dFCjLiKqqNSkZfpwE53FhoK7IcOGFXkFBQayc +5IN1tgyD7HcsaEFlW2v21B+y4UcxPjtohx74ddqAfHHA0WeNYLTndyKR B9n+YaZMsfkjCqm13e418wVrwcjWx/VP2m3NoT1oPCKZl+jPnXk1tTb0P /uneplq4xWlTntpReehUL1oQ5/hanVANRkPSe2bsp+zYMUrrae2WOmGq8 dEYG651qxNxAjUvLj5exm8N7NWS9FpqDKwo/N+0OQAjhutmkmM/x1X6Vn A==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="280136737" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="280136737" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 03:45:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="833523803" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmsmga006.fm.intel.com with ESMTP; 21 Jun 2022 03:45:04 -0700 Date: Tue, 21 Jun 2022 18:36:57 +0800 From: Xu Yilun To: Ivan Bornyakov Cc: mdf@kernel.org, hao.wu@intel.com, trix@redhat.com, corbet@lwn.net, 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 v20 2/4] docs: fpga: mgr: document parse_header() callback Message-ID: <20220621103657.GB1530041@yilunxu-OptiPlex-7050> References: <20220617134846.19859-1-i.bornyakov@metrotek.ru> <20220617134846.19859-3-i.bornyakov@metrotek.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220617134846.19859-3-i.bornyakov@metrotek.ru> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Fri, Jun 17, 2022 at 04:48:44PM +0300, Ivan Bornyakov wrote: > 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 Acked-by: Xu Yilun > --- > Documentation/driver-api/fpga/fpga-mgr.rst | 27 +++++++++++++++++----- > 1 file 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. > > -- > 2.25.1 >