From patchwork Thu May 20 18:29:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 12271147 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,USER_AGENT_GIT autolearn=ham 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 23650C433B4 for ; Thu, 20 May 2021 18:31:37 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 A4DB06024A for ; Thu, 20 May 2021 18:31:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4DB06024A 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=desiato.20200630; 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=cBJd3vG5L2rb2rYshQHnsxNkl6bSpM4Aup+8vo5awBk=; b=AOrDK+afcgr4fAYTFId4NF1Hn5 5gbDwuocaiu+zX1Y4zLqj2JkToqpfv+SXpwF/3vPOcgTJJy8Y9FLg9SGZyyy34Genk2xNT0eDXoJI vL3sN+J/hCX4SyL2++E/xaC3aPnC9iVVFip+aqN0IYNC81NTA2+FxsB4QqTU4o/zxiIT45JI6ws3I YKpo9tMIcWm56gMcbLXjRlVnFbH4Eyz+Diu8kpEHSTUCHTicfSPHOfmfnyQNWO5HoGQ+34beoNmAT psWy62hWcr9AjrsBZ+mEaHuyNcGdwl4jROvQfMgarhVwl/1zps0vjKNmzPghh4j+cVU2gZiL4Y2C8 Zh8vYlag==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljnQE-002GAc-WF; Thu, 20 May 2021 18:29:27 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljnQC-002GA3-6h for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 18:29:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type: Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description:In-Reply-To:References; bh=KuRG9vWY0jfUiOP1f57t7lLfBEAT6/lfYeU935poEww=; b=kxjf20wHd5cHYRk/x2LzK3pz42 iFaq1v8VlMddc1HXmsjMj9fa/6Qxi4ELu9KHvLWLIFGpLssD/f2qqb2HYhGYv6tDHIlETZZgPLDO8 Yx8s7dsC6L7qMCCy7ZFNc4dgtvzdiuZrlXCBJM0syImGjN7xTgckknFTqTEA/WZmg38ZtThOBa71r 8LIucn5kzBWfFjSUHgZxEQZSG7GU3vRpjU2pjF092+j/+WuBQKZF/EEgR8iROI6eD20mDfXphJiOi r8cFgimMKpMF7krKLfHWVdED67aM2IoAJNqnpF0t9J/da73/UaDbmOBK+l/PWj9xs6uspDrHuQaUJ j3CJDgBg==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljnQ8-00GZcH-SM for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 18:29:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621535358; 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=KuRG9vWY0jfUiOP1f57t7lLfBEAT6/lfYeU935poEww=; b=aDL2zjDOg531qXRoN50Y0dyI8xbJKEAfVP6yBKDQ0wNHnu05NKHLGPv8lW/3VBzc3h8yy4 iyki/HsqwU1sN1Zt7jdqG0mRRjQayBoTnNrh2kTfNmPr+qURMrFIYEjZEd0j9px0GpsIqn U2galfamWc2Y1DjNCpvkqBpcqI8vZBg= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-80-HYCbCm_6NjG5ouKjEnRwcA-1; Thu, 20 May 2021 14:29:16 -0400 X-MC-Unique: HYCbCm_6NjG5ouKjEnRwcA-1 Received: by mail-qv1-f69.google.com with SMTP id n12-20020a0c8c0c0000b02901edb8963d4dso13958482qvb.18 for ; Thu, 20 May 2021 11:29:16 -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=KuRG9vWY0jfUiOP1f57t7lLfBEAT6/lfYeU935poEww=; b=uGPo4ZZDmRMR0tDWDyOWxcIBStQ+/tWoIpdVKySFuDynwLTEPoGQrV1mMsF/BLmTgS fyBWrWQqOj/4vPnOXqHyvTYhwlpxUEjEtyYmmXnZ4FTv1uRYvubK4MHUbtvvq1bxH+9P pShkcnN2Fy5vpraUvXfLW8aVdsmYqC2wJlCSwROGjsvPIyx1BSp6b9mYpZq9+FzPifZG DoTfzuyBKHlT9QyY2hv06oK48Tmmg902B6GSGKndYKhuuPxjONnzbEaQt3DVl8l230zT AWl7QsOthPZpsf0t3N1y7INLuArXXC7gomNel00uWuqnaf4KDkSUtgCN4DehDLjATY7R +Wmw== X-Gm-Message-State: AOAM530hvHhhw/wRHZ3TSoj2rpc+ieF3DEPhFuK/SGT2WDpiElcQF8xP mohLGbYfDdo6Yr/w7rQSy+Nfxe7cZyXziE3olzbqUn1UOxQ5t+KveYfe51n/sc8P2xygF9H8iv2 wkKWso7wp3/knIrRBvoEK8ooXrbVsZvt1Ssg= X-Received: by 2002:a37:a309:: with SMTP id m9mr7206201qke.126.1621535355837; Thu, 20 May 2021 11:29:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwldeFbz0RULF07VGqpc5h9My9BH9z98cOaZH/dSszgRT8CgQ/ebLHUQRBrmVYBM65/8fiWkg== X-Received: by 2002:a37:a309:: with SMTP id m9mr7206181qke.126.1621535355674; Thu, 20 May 2021 11:29:15 -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 l10sm2702932qtn.28.2021.05.20.11.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 11:29:15 -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 v2 0/5] generalize fpga_mgr_load Date: Thu, 20 May 2021 11:29:06 -0700 Message-Id: <20210520182906.2021594-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-20210520_112921_200476_18FC870D X-CRM114-Status: UNSURE ( 8.99 ) 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. 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 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: defer checking for update ops until they are used 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 | 10 ++--- 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 +++++++++++----- 15 files changed, 125 insertions(+), 92 deletions(-) --- 2.26.3