From patchwork Thu Jun 24 21:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 12343229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8C0BC49EA5 for ; Thu, 24 Jun 2021 21:19:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D1296124C for ; Thu, 24 Jun 2021 21:19:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D1296124C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4dJyMZUDI7K3xLapVIitgXG+47jyEsDUFvXrXJYnecE=; b=sma1Yzc1whfRGv fTzPFuRV3T7gsPNeDStM7T20mUgjLozzCg1MPJ14M/92dWCCLQ9OSULIuKVoBIBi7c6ef/4PfIeUH H+53A3DsxzzoKEHP5h/bkdF0E67aZCjUmJn19F2UwCFu8P0zZxhZOB0+l05IxgZkoLsqsAGU8Qcdg Uqjl9SP9PQVt0QOMGbw69VF5/BCvala+NdbVpPe8LD4TqtJE6fEWwk3GcE+u4cPwrHuiQF6IlkbDr vaFlaRTj6TX9Y084iqJtJlhKMEJcVzgWtJ3cau3ImZvcBPvLbcSkdRbuJbmGi0pRualiMnB1BwcY0 vecuKnRGc77kcAKgWK7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwWjK-00GKCO-7r; Thu, 24 Jun 2021 21:17:46 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwWjH-00GKBn-1T for linux-arm-kernel@lists.infradead.org; Thu, 24 Jun 2021 21:17:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624569461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbuTBMFChOy4pqwvCtsZG3RUwzvZUOwMhboraTVRj4M=; b=VqY2xhobwDd3fhmGnR9VTLS6LlOYK55T9+eemTnstz7faPlDouAN3rzEilThFeb4DdICV+ UFUOdjhfLexp07cx110yXQXPkwERPLThmlFuGnOpVDpwior6crfh6RICNza5UelUdEg+Yu lNtfzty0Uht80gsAuAp3LeNqkR+SOjg= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-536-dqwl94HRO5aBtukusoq6hg-1; Thu, 24 Jun 2021 17:17:40 -0400 X-MC-Unique: dqwl94HRO5aBtukusoq6hg-1 Received: by mail-oo1-f71.google.com with SMTP id t19-20020a4ae4130000b029023950cb8d35so4507271oov.6 for ; Thu, 24 Jun 2021 14:17:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VbuTBMFChOy4pqwvCtsZG3RUwzvZUOwMhboraTVRj4M=; b=FGdvtrcRbL8Z76KqNgWPdo+AGKUN5PYIQhdXkS63mV/Uohbonled2/MwNvCr4iswrY QDVrgzi3ExZWUIJF2jLr7WX6IeeQIGgoyOK17pt2YohhMDjaubkGF7gazBEBwzJeH+M/ 0GX+12o6rBjAqecTXZDEdslaJ2vPCytznpC59g63IjVyN84bYBCGZyiBxPgldP8G7CJ2 PkA976NfUSiMNVWc14yA/qpYsHYQDufD4xYmc8ytuA9tjxQpzjkBU87ljdbYfKHgk7sB T7xalUzJTYkaybHi2tcZIphE4RvlC84qiK/5GrddXJmyP4sNvB9le4rYN2TIBZ3Wx8K6 Ehqg== X-Gm-Message-State: AOAM5321e9QroQ658ybjrWXzOTuwl3YWeWyksjDK54eBOyY1VhdM52yW 3ub3FbxpS3AuSQq9BEIv7p3xuMGN2uEgtsSSSO77vTWKyJW+j0fV4QwB6jNOaCO2LuV+o1JQJHU W40NgMXzxuHt2mKTWfefxTnJ/7mNICO9TAVY= X-Received: by 2002:a05:6830:1c2e:: with SMTP id f14mr6444873ote.133.1624569459330; Thu, 24 Jun 2021 14:17:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMtb0KwbhrC4hX3KzMWzQtC+1uIfeoLx9w4mgt0iXeUxBWaQ4cK/XbrTlFsKjiaexh1vNAOA== X-Received: by 2002:a05:6830:1c2e:: with SMTP id f14mr6444852ote.133.1624569459075; Thu, 24 Jun 2021 14:17:39 -0700 (PDT) Received: from localhost.localdomain.com (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id 94sm915513otj.33.2021.06.24.14.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 14:17:37 -0700 (PDT) From: trix@redhat.com To: mdf@kernel.org, hao.wu@intel.com, michal.simek@xilinx.com Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tom Rix Subject: [PATCH v4 0/5] generalize fpga_mgr_load Date: Thu, 24 Jun 2021 14:17:21 -0700 Message-Id: <20210624211727.501019-1-trix@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=trix@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210624_141743_212240_0674B821 X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tom Rix Depends on https://lore.kernel.org/linux-fpga/20210623182410.3787784-1-trix@redhat.com/ A refactor of the fpga-manager to make space for the functionality of the secure update in this thread. https://lore.kernel.org/linux-fpga/20210517023200.52707-1-mdf@kernel.org/T/#mf3a1951d429a973c863eee079ed990c55056827c Splits the reconfig write ops into its own ops structure and then has an instance for the existing loading (reconfig) and the secure update (reimage) fpga_mgr_load uses a new bit, FPGA_MGR_REIMAGE, in fpga_info_info to use either the reconfig or the reimage ops. valid write op checking has moved to make the reimage path option. Since fpga_image_info_alloc zalloc's the fpga_info_struct, the reimage path will not be taken. Stub in remimage support for dfl Changes since v1: - update op names changed from partial_update to reconfig full_update to reimage - dropped the cancel() and get_error() ops. - add FPGA_MGR_REIMAGE bit - refactor fpga_mgr_load to use either update ops Changes since v2: - Fix a missed write op change - Stub in dfl reimage Changes since v3 - refactor for wrapper ops patchset - drop 0004 fpga: defer checking.., wrapper ops took care of that - drop 0006 fpga: dfl stub in..., simplify the patchset - add a wrapper for write_sg - rearrange the passing of update ops to be last. - simplify some wrapper checks, this should go in the wrapper ps. Tom Rix (5): fpga: generalize updating the card fpga: add FPGA_MGR_REIMAGE flag fpga: pass fpga_manager_update_ops to the fpga_manager_write functions fpga: use reimage ops in fpga_mgr_load() fpga: fpga-mgr: simplify mops check in wrappers drivers/fpga/altera-cvp.c | 8 +-- drivers/fpga/altera-pr-ip-core.c | 8 +-- drivers/fpga/altera-ps-spi.c | 8 +-- drivers/fpga/dfl-fme-mgr.c | 8 +-- drivers/fpga/fpga-mgr.c | 103 +++++++++++++++++++------------ drivers/fpga/ice40-spi.c | 8 +-- drivers/fpga/machxo2-spi.c | 8 +-- drivers/fpga/socfpga-a10.c | 10 +-- drivers/fpga/socfpga.c | 8 +-- drivers/fpga/stratix10-soc.c | 6 +- drivers/fpga/ts73xx-fpga.c | 6 +- drivers/fpga/xilinx-spi.c | 8 +-- drivers/fpga/zynq-fpga.c | 10 +-- drivers/fpga/zynqmp-fpga.c | 6 +- include/linux/fpga/fpga-mgr.h | 35 +++++++---- 15 files changed, 140 insertions(+), 100 deletions(-)