Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1436520pxv; Fri, 25 Jun 2021 12:59:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7apddg1zve/nJTDRt8VazAoBjYYGIh57jVzLg6PkYjFqVPIxpX9ikHqyAcoPimqvhOwQo X-Received: by 2002:a05:6e02:1b8f:: with SMTP id h15mr8858531ili.151.1624651182251; Fri, 25 Jun 2021 12:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624651182; cv=none; d=google.com; s=arc-20160816; b=Xji1+1+p1W4G5G9gNT8IEq8wR2cMapWpMCjpNu3TjGcE92BUrFWYMbWYHlMw5YLUZN 7FBWZxMDH2izhy6a5XT742Ulp2Ytxrlv20TbiJOtDPjax89gATiI+rcSSxcrH1uChBJi 9TrM8aX8Wcp/RRlc0ZsqxW2Gs2e7IOpJcDp0+VQSJ3cM5WBU66QplWNi1cgL5AoRVdWw t9RYZtAbrocdsqf5bHsSQgDUvQ/A9kN/6Ftk027gNHsgZm+EElow6PovVSRX+bnQGAGp xRKCsoaB+RPotosalyDS0JfKFE+egcWpbU/IGKBEyhyfr1S/shzeesPtMTb2+xf5bbKm olnA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=cKZbkTJmpGtN/IdbnoPTOQJqZouuD1FRtyZb5ELX/mU=; b=wPk/DhxVmNoddmL369RC0S2d+zuQxCDbh28WC4ZdeEOUEZtMVUf3QIKdSOCWuqJ3te mgPgohyN6mT1bCnDN6zGtQwqerbNrXl/ml6iAycep+JhRtjXtmYj+A2Fiqm3CcPGAjqS dYZVH1gMxNz1uQrjKrJEVKo/AvSEEAQNBjMck9+mOkdKctbOjp1IdFGoORmJR2HYPf78 7jneNap+7rpDXCYVyl95U/OQm3rgzXj8gvVVCSLq7pgMbJelhyOn0kPUzBTkz0YR15cW FuXercyrifW1KDaYbsyw8c6UyWtkujZkIeQCVpDLI97KT14BKDHQxC9cBpNFucgV3jWU 8S5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="KK1/NSPN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si8884470jaj.107.2021.06.25.12.59.29; Fri, 25 Jun 2021 12:59:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="KK1/NSPN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229782AbhFYUBU (ORCPT + 99 others); Fri, 25 Jun 2021 16:01:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29307 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbhFYUBT (ORCPT ); Fri, 25 Jun 2021 16:01:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624651138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=cKZbkTJmpGtN/IdbnoPTOQJqZouuD1FRtyZb5ELX/mU=; b=KK1/NSPNE1jX1+xbwjCkcH1r04Tmkb+dqDso224OFocKumIicFpES9TH1rgKsHQ/2T5DTI NWzJpccIeiWjkLekd2GmDE3hrAnzEC0eYDKRVNOzjVcs6/O6/6Nrb3lWoJWyeuWVaTTFT3 X9xwFJncdhq96c5C8+OmHRd1zUBFHb0= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-dKIH56OiMRa_GVtd0vkUHA-1; Fri, 25 Jun 2021 15:58:56 -0400 X-MC-Unique: dKIH56OiMRa_GVtd0vkUHA-1 Received: by mail-oo1-f70.google.com with SMTP id b1-20020a4ac2810000b029024bec618157so6452653ooq.2 for ; Fri, 25 Jun 2021 12:58:56 -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=cKZbkTJmpGtN/IdbnoPTOQJqZouuD1FRtyZb5ELX/mU=; b=uHxedQgsSXp0f21OpsIKTH0DOTFGf5iPaq/n/Ua+MMktx7fEKkwsurzHPZozVfTVje sIe7AknbmZcDP8K57BAraDjuTyoHnELBnrUmIr2nH4ghEzgrcIrWf2GsQS09hojD/4i+ ufpFHt5rpi04wuzlNemswvYymPHhuzVf3P1v1L3vQbQ1KBQmcRUZOPb+cp1EwSixSlWX dvf/k7nLtZx4LdJ0S2h3V+pkAuDCOuks7S7A1g3PDQucgSzBOI7K8cI78oRj+SeVywJh bOsXu/wAGLNxCWDId5B3PVsIN+BuJZ61GLrQ0vDzaLx/F0mWdbuPfQO4CwndYKgOpmdY QhxQ== X-Gm-Message-State: AOAM531vK0QtZxVdWp8VWhmOZt+1EEtxLTfdgkZrcDcRKn/bA3N7G5zT cTDwCpKSwvBlpzCghFEYzB7l2fz07yUreZC0Hg6ElVioFDnlCMXDVlDflfWQkk0uLvNhJP7Qa+3 yMURak13jn135ji4gjt/TMTbV X-Received: by 2002:a54:440a:: with SMTP id k10mr12678115oiw.59.1624651136188; Fri, 25 Jun 2021 12:58:56 -0700 (PDT) X-Received: by 2002:a54:440a:: with SMTP id k10mr12678101oiw.59.1624651136006; Fri, 25 Jun 2021 12:58:56 -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 r204sm1467374oih.11.2021.06.25.12.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 12:58:55 -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 v5 0/4] generalize fpga_mgr_load Date: Fri, 25 Jun 2021 12:58:44 -0700 Message-Id: <20210625195849.837976-1-trix@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix Depends on https://lore.kernel.org/linux-fpga/20210625195148.837230-9-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. 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. Changes since v4 - refactor for wrapper ops patchset - drop write_sg wrapper - drop 'fpga: fpga-mgr: simplify mops check in wrappers' Tom Rix (4): 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() 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 | 95 +++++++++++++++++++------------- 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, 132 insertions(+), 100 deletions(-) -- 2.26.3