From patchwork Mon May 24 16:27: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: 12277393 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 E08C6C2B9F7 for ; Tue, 25 May 2021 00:17:22 +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 9E167613F4 for ; Tue, 25 May 2021 00:17:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E167613F4 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=Nvjm2E344ui95In3lCbpQ66+rpTo8+TltTNvfOTKwCk=; b=UA6rxB/yEDbMBV v584IFppMwJXAIkxsP6W1BeGswue0Q8AJkPiqT8e0RUiSvL/M+BQpnGMT69DOIZqt65SQZp/gMR5E oE8ntaIW1EFwWXD6TzN9I+FDEBg41UHQqIsq0yDZ/ur/Lqj2Tl+PlSsxXJ0TtnKb66JSqEywKcaBA wtfRRNGOXClqhoOoROiPq4AojhKAWpKHH+lS39dtccQSj3TabrnnxuHaXoDwnpegluXB11WrqWV5x 9mNfKxeQC/1kpQyIqhfvSYVZ8kUxyzSg6R25huyhQw3CLt3RDIMbn30sxYgGO98V2KGqpePqQq3s7 1khMcvexxA/jGtO4YVzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llKih-002UuM-Co; Tue, 25 May 2021 00:14:54 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1llDQU-0016Vt-Pu for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 16:27:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621873651; 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=4nLMwC8kEWrD6J/dDuglp7fEMPmfCCD3GpnEGOSToTc=; b=LNzBo9JV8IbV5tZp5Hd8RDMrmjARq+y4Mq0cND55+crHxbF8qWkg04Hj2epXNTXUapmKx8 3hOj75VfONfN0tCY/Kv3YzJCnu217xprfOh334isnZpOS+/huY1ubmCJO5KtHvCbAaMYKs bw1z0Fk2ey95f81A3VNqwGKc5T7STls= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-113-sH5nAPNlO8mFO0F1Uxp0Hg-1; Mon, 24 May 2021 12:27:27 -0400 X-MC-Unique: sH5nAPNlO8mFO0F1Uxp0Hg-1 Received: by mail-ot1-f69.google.com with SMTP id k21-20020a0568302435b02902e3741cb6c1so20092702ots.23 for ; Mon, 24 May 2021 09:27:27 -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=4nLMwC8kEWrD6J/dDuglp7fEMPmfCCD3GpnEGOSToTc=; b=aZJWXRCq+fNIghTF4Nw4HZ4Ly8JgTx+vw5XCN0uCLaoxncRVis3FnRr1ogXSGLKFyo PTJhHYmMi5jZpQoYwp+1vVfBVKnDIWImuyxHArfqOpkMbjtQAb++tbYbCrB0Xqdq9ZxE +M9Kqf+N80hZ9R7uNXhmiaunCaH+G42BbOW/RvIHn3gyDq9ePLACeP8WKv7x9UV88hnc qd+C6Ts65W8JrAjPMriTEMGEUy5s875jblJvzCvV5AR53Wh3Z2n9w9e7DfE6+2FS0r2U ugM5QvE5JN0CI/7F5nIy8kPM/e+H3N7AoFeusoVsALjxh9kaR+SyNKoYIF/1WzFVFgbj 4cNw== X-Gm-Message-State: AOAM533+FKccDUpbpyj0j6m2ymMBWZAhtUIRDJiQ9P+LQ10d3YVpDWpb DbcLTXiZy2o+7w/h5dYiu8zE5U4jLfwCk3Xhw7y8GsWUnut4wxXUvU/+ARR79Sfa8LDlTQ0crMJ Dk8BkJ5kp9xLnlsZfH0IEOAXMyBJ9KLkRwH8= X-Received: by 2002:aca:f354:: with SMTP id r81mr11384668oih.4.1621873646668; Mon, 24 May 2021 09:27:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw42exOlTKgikljKyi6YLzzVPK2zjfc1vkxYWZ1pFeN/mqUzEECdUlPHF6iArYGeKhCGoasWg== X-Received: by 2002:aca:f354:: with SMTP id r81mr11384661oih.4.1621873646515; Mon, 24 May 2021 09:27:26 -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 u24sm3171103otg.73.2021.05.24.09.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 09:27:25 -0700 (PDT) From: trix@redhat.com To: russell.h.weight@intel.com, 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 v3 0/6] generalize fpga_mgr_load Date: Mon, 24 May 2021 09:27:21 -0700 Message-Id: <20210524162721.2220782-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-20210524_092734_976207_C53A3FA8 X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. 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 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 Tom Rix (6): fpga: generalize updating the card fpga: add FPGA_MGR_REIMAGE flag fpga: pass fpga_manager_update_ops to the fpga_manager_write functions fpga: defer checking for update ops until they are used fpga: use reimage ops in fpga_mgr_load() fpga: dfl: stub in reimaging 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 | 38 ++++++++++++++--- drivers/fpga/dfl-fme-pr.c | 40 +++++++++++------- drivers/fpga/fpga-mgr.c | 72 ++++++++++++++++++++------------ 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 | 8 ++-- drivers/fpga/ts73xx-fpga.c | 8 ++-- drivers/fpga/xilinx-spi.c | 8 ++-- drivers/fpga/zynq-fpga.c | 10 ++--- drivers/fpga/zynqmp-fpga.c | 8 ++-- include/linux/fpga/fpga-mgr.h | 35 +++++++++++----- include/uapi/linux/fpga-dfl.h | 18 ++++++-- 17 files changed, 192 insertions(+), 111 deletions(-)