Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp484302iog; Fri, 17 Jun 2022 07:18:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tNLiEgl+56QH6d3vgCgKnWbtjNL06cRTfMKsMxs6ac2UWCQUh3bqdPbKKkxPlUd+KeLIOz X-Received: by 2002:a05:6402:1e88:b0:42f:b1ff:7858 with SMTP id f8-20020a0564021e8800b0042fb1ff7858mr12505630edf.407.1655475530089; Fri, 17 Jun 2022 07:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655475530; cv=none; d=google.com; s=arc-20160816; b=pc+wsHEEgeF5v1GCi5GXGsjQIETai7p0fyelkBpKSSJ2413bMDpJaafqzJt/6nPr4y OfEaypT3uGh35DTIUEKjBGb5mg436Sc6A+TtnAXByk/xaoS8DDhLoAAwnWn3aLDUQf0P CqTfdY0vrBAQGVVGacvj0GUyBc+DfBcsFAr3xee9ZIbeqRZSiby+/l6FeaJ45R/QKBmT lQkvXcZ+hqwBieFJRJCDTPRcE4wcFeG/Uc4gSAGn7DAsAlC1ltHafUUw5u4gcj79sULs /PfjXznUFv7APGN1DDNCwCZy6Av8acRgQUAUmOFl3mnbmsLw9J0vwEoCUzhpXRomwxqN HX9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1Y/0ze1Yel8J0wzjyn0zHIxVGoiOBWzb22A7EWEmC+I=; b=o7CdsSevaIGSKxxwfGdXW72Pg8qSqAreyr5yixw/F0yYqGVN3yrjRLvsrNxKm+qhoj gOYDon2bg7Z/fap8Iuj6HH70J3nhlds2SDwPIVV/EMoqJ7Q2fcfR7hmrTiEj+FllJ1wF MNa/5MBM01eEazc8grVRp8i99N4zfddo3Z4oCDyV1tPykuyLimslvsN2MtLtCLwlz8OP mwc+ydVKi5uh2wVSl3/9QkN08zdPziDq7sa8BjwXmf7Ch1kDo+HpV0lxwYCZRS1DhpKv kESM8j531zYUE8PyrYhXkkgDdeRvlZciiJAWMOHMBgkCIA+L0UgUxhmFANgA3fEFWXRf mJtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b="Ja/Ge57E"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb15-20020a170907160f00b006fe9e9ed643si1298541ejc.48.2022.06.17.07.18.23; Fri, 17 Jun 2022 07:18:50 -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=fail header.i=@metrotek.ru header.s=mail header.b="Ja/Ge57E"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231462AbiFQNuA (ORCPT + 99 others); Fri, 17 Jun 2022 09:50:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234575AbiFQNty (ORCPT ); Fri, 17 Jun 2022 09:49:54 -0400 Received: from mail.pr-group.ru (mail.pr-group.ru [178.18.215.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E08A43385; Fri, 17 Jun 2022 06:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metrotek.ru; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding: in-reply-to:references; bh=Hz1N3iQRQ8cqLzLkwSQu0ZphBJbofHB1qe/OnX978VY=; b=Ja/Ge57E11DS2Kd/3ofi/C33E0VW510gHg7EBJxHOi7aq2EnYo+XRisuYPcvcVv8teiBy0yf+KgcI a0AVmM3QhbwdgZv5bXz1vX7Syf4+G1KdJxmXkCwcZ37KOuyQqUBTVNjXuql9v7PkSlBCoqWs3aA3dt WsRs2OzEFKG4UOD7A7MhgFbyI8MoZyg2LxUe+xL/doT8AhdijdmkaeEn7d+jLUvYsQnYT1tSgkSsTC 8YMK2GWQrq4CdZhh979Gg256zDXOdSeMQMcS1clyXY/1yje+1vuWqL4FLcA2cypZ/jb+80zZH1L9T5 B86NYHQFGgUDjlYKh/L0v1QxscqPcJw== X-Kerio-Anti-Spam: Build: [Engines: 2.16.3.1424, Stamp: 3], Multi: [Enabled, t: (0.000010,0.010967)], BW: [Enabled, t: (0.000015,0.000001)], RTDA: [Enabled, t: (0.076789), Hit: No, Details: v2.40.0; Id: 15.52k5n9.1g5oupv3g.28mf; mclb], total: 0(700) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: X-Footer: bWV0cm90ZWsucnU= Received: from h-e2.ddg ([85.143.252.66]) (authenticated user i.bornyakov@metrotek.ru) by mail.pr-group.ru with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Fri, 17 Jun 2022 16:49:22 +0300 From: Ivan Bornyakov To: mdf@kernel.org, hao.wu@intel.com, yilun.xu@intel.com, trix@redhat.com, corbet@lwn.net Cc: 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: [PATCH v20 2/4] docs: fpga: mgr: document parse_header() callback Date: Fri, 17 Jun 2022 16:48:44 +0300 Message-Id: <20220617134846.19859-3-i.bornyakov@metrotek.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617134846.19859-1-i.bornyakov@metrotek.ru> References: <20220617134846.19859-1-i.bornyakov@metrotek.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- 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