From patchwork Wed Nov 18 14:29:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Gong X-Patchwork-Id: 11915191 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 6B692C63697 for ; Wed, 18 Nov 2020 14:09:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CD2C2224C for ; Wed, 18 Nov 2020 14:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726332AbgKROJA (ORCPT ); Wed, 18 Nov 2020 09:09:00 -0500 Received: from mga18.intel.com ([134.134.136.126]:44063 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725613AbgKROJA (ORCPT ); Wed, 18 Nov 2020 09:09:00 -0500 IronPort-SDR: zUkKLFOiz5fcL9TTg0zHanGeoQoW03uItt6xZBX7+b93mrFCbj7y4q6eXvXJMWPsH7KgaQVpyj fA5TzAXML6hg== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="158892793" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="158892793" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 06:08:56 -0800 IronPort-SDR: jTLi6QCJeaDgaUI2u+X9x/hbWP8tu3ra2dRZJO7OSqgUqF4aXSVfklCwxevhKraCjrCIet7NSO Rl0FeT7207+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="325596862" Received: from marshy.an.intel.com ([10.122.105.143]) by orsmga003.jf.intel.com with ESMTP; 18 Nov 2020 06:08:55 -0800 From: richard.gong@linux.intel.com To: gregkh@linuxfoundation.org, mdf@kernel.org, trix@redhat.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dinguyen@kernel.org, sridhar.rajagopal@intel.com, richard.gong@linux.intel.com, richard.gong@intel.com Subject: [PATCHv2 1/5] firmware: stratix10-svc: add COMMAND_AUTHENTICATE_BITSTREAM flag Date: Wed, 18 Nov 2020 08:29:09 -0600 Message-Id: <1605709753-7800-2-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> References: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org From: Richard Gong Add COMMAND_AUTHENTICATE_BITSTREAM command flag for new added bitstream authentication feature. Authenticating a bistream is to make sure a signed bitstream has the valid signatures. Except for the actual configuration of the device, the bitstream authentication works the same way as FPGA configuration does. If the authentication passes, the signed bitstream will be programmed into QSPI flash memory and will be expected to boot without issues. Clean up COMMAND_RECONFIG_FLAG_PARTIAL flag by resetting it to 0, which aligns with the firmware settings. Signed-off-by: Richard Gong --- v2: new added --- include/linux/firmware/intel/stratix10-svc-client.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/linux/firmware/intel/stratix10-svc-client.h b/include/linux/firmware/intel/stratix10-svc-client.h index a93d859..85463c8 100644 --- a/include/linux/firmware/intel/stratix10-svc-client.h +++ b/include/linux/firmware/intel/stratix10-svc-client.h @@ -51,12 +51,17 @@ #define SVC_STATUS_NO_SUPPORT 6 /** - * Flag bit for COMMAND_RECONFIG + * Flag bit for COMMAND_RECONFIG, in bit number * * COMMAND_RECONFIG_FLAG_PARTIAL: - * Set to FPGA configuration type (full or partial). + * Set for partial FPGA configuration. + * + * COMMAND_AUTHENTICATE_BITSTREAM: + * Set for bitstream authentication, which makes sure a signed bitstream + * has valid signatures before committing it to QSPI flash memory. */ -#define COMMAND_RECONFIG_FLAG_PARTIAL 1 +#define COMMAND_RECONFIG_FLAG_PARTIAL 0 +#define COMMAND_AUTHENTICATE_BITSTREAM 1 /** * Timeout settings for service clients: From patchwork Wed Nov 18 14:29:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Gong X-Patchwork-Id: 11915195 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,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 65E89C5519F for ; Wed, 18 Nov 2020 14:09:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4B1C246B9 for ; Wed, 18 Nov 2020 14:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbgKROJC (ORCPT ); Wed, 18 Nov 2020 09:09:02 -0500 Received: from mga18.intel.com ([134.134.136.126]:44063 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbgKROJB (ORCPT ); Wed, 18 Nov 2020 09:09:01 -0500 IronPort-SDR: YhjaWQtYBjt23Pu/ecJprkCUl1kF1M6mpRPUqfRiuRttJQSiW90K7LjKvTTKCV1NpwKXtGotRU xkDFn0JT3v+g== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="158892809" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="158892809" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 06:09:00 -0800 IronPort-SDR: ucueP6mVYc0ts6qY3bgCufekTyY9JS9jQZvEa5x7xVA8scRHd27lSoXmV0zeb0Q2XPQSJyR6t5 xIXZeo5kwESw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="325596896" Received: from marshy.an.intel.com ([10.122.105.143]) by orsmga003.jf.intel.com with ESMTP; 18 Nov 2020 06:08:59 -0800 From: richard.gong@linux.intel.com To: gregkh@linuxfoundation.org, mdf@kernel.org, trix@redhat.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dinguyen@kernel.org, sridhar.rajagopal@intel.com, richard.gong@linux.intel.com, richard.gong@intel.com Subject: [PATCHv2 2/5] fpga: fpga-mgr: add FPGA_MGR_BITSTREM_AUTHENTICATION flag Date: Wed, 18 Nov 2020 08:29:10 -0600 Message-Id: <1605709753-7800-3-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> References: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org From: Richard Gong Add FPGA_MGR_BITSTREM_AUTHENTICATION flag for FPGA bitstream authentication, which makes sure a signed bitstream has valid signatures. Except for the actual configuration of the device, the authentication works the same way as FPGA configuration does. If the authentication passes, the bitstream will be programmed into QSPI flash and will be expected to boot without issues. Signed-off-by: Richard Gong --- v2: align all FPGA_MGR_* flags update the commit messages --- include/linux/fpga/fpga-mgr.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index 2bc3030..4fb3400 100644 --- a/include/linux/fpga/fpga-mgr.h +++ b/include/linux/fpga/fpga-mgr.h @@ -67,12 +67,15 @@ enum fpga_mgr_states { * %FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first * * %FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed + * + * %FPGA_MGR_BITSTREM_AUTHENTICATION: do FPGA bitstream authentication only */ -#define FPGA_MGR_PARTIAL_RECONFIG BIT(0) -#define FPGA_MGR_EXTERNAL_CONFIG BIT(1) -#define FPGA_MGR_ENCRYPTED_BITSTREAM BIT(2) -#define FPGA_MGR_BITSTREAM_LSB_FIRST BIT(3) -#define FPGA_MGR_COMPRESSED_BITSTREAM BIT(4) +#define FPGA_MGR_PARTIAL_RECONFIG BIT(0) +#define FPGA_MGR_EXTERNAL_CONFIG BIT(1) +#define FPGA_MGR_ENCRYPTED_BITSTREAM BIT(2) +#define FPGA_MGR_BITSTREAM_LSB_FIRST BIT(3) +#define FPGA_MGR_COMPRESSED_BITSTREAM BIT(4) +#define FPGA_MGR_BITSTREM_AUTHENTICATION BIT(5) /** * struct fpga_image_info - information specific to a FPGA image From patchwork Wed Nov 18 14:29:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Gong X-Patchwork-Id: 11915193 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 3CF2CC64E69 for ; Wed, 18 Nov 2020 14:09:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2EC22224C for ; Wed, 18 Nov 2020 14:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbgKROJF (ORCPT ); Wed, 18 Nov 2020 09:09:05 -0500 Received: from mga18.intel.com ([134.134.136.126]:44063 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbgKROJD (ORCPT ); Wed, 18 Nov 2020 09:09:03 -0500 IronPort-SDR: 3qMAYDVavMqhB0i4fbq04ncevTUdLdCucjkKeHlqZ3z+/yL0cEalEFW6IlBLx+Es4mtg+pPakk aoQWudk/m5ZQ== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="158892815" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="158892815" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 06:09:02 -0800 IronPort-SDR: g91f9M9sTZQ1rAMbTLTHR7LaKCSrbyLbvXkY71SghjPqQOc9S3bSMrdnz2cQ63rNvkCnDNgPeS P9xuzVTYSgmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="325596908" Received: from marshy.an.intel.com ([10.122.105.143]) by orsmga003.jf.intel.com with ESMTP; 18 Nov 2020 06:09:02 -0800 From: richard.gong@linux.intel.com To: gregkh@linuxfoundation.org, mdf@kernel.org, trix@redhat.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dinguyen@kernel.org, sridhar.rajagopal@intel.com, richard.gong@linux.intel.com, richard.gong@intel.com Subject: [PATCHv2 3/5] fpga: of-fpga-region: add authenticate-fpga-config property Date: Wed, 18 Nov 2020 08:29:11 -0600 Message-Id: <1605709753-7800-4-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> References: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org From: Richard Gong Add authenticate-fpga-config property to support FPGA bitstream authentication, which makes sure a signed bitstream has valid signatures. Signed-off-by: Richard Gong --- v2: changed in alphabetical order --- drivers/fpga/of-fpga-region.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c index e405309..3840883 100644 --- a/drivers/fpga/of-fpga-region.c +++ b/drivers/fpga/of-fpga-region.c @@ -219,6 +219,9 @@ static struct fpga_image_info *of_fpga_region_parse_ov( info->overlay = overlay; /* Read FPGA region properties from the overlay */ + if (of_property_read_bool(overlay, "authenticate-fpga-config")) + info->flags |= FPGA_MGR_BITSTREM_AUTHENTICATION; + if (of_property_read_bool(overlay, "partial-fpga-config")) info->flags |= FPGA_MGR_PARTIAL_RECONFIG; From patchwork Wed Nov 18 14:29:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Gong X-Patchwork-Id: 11915199 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,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 A94D0C64E90 for ; Wed, 18 Nov 2020 14:09:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C11322244 for ; Wed, 18 Nov 2020 14:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbgKROJI (ORCPT ); Wed, 18 Nov 2020 09:09:08 -0500 Received: from mga18.intel.com ([134.134.136.126]:44078 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbgKROJF (ORCPT ); Wed, 18 Nov 2020 09:09:05 -0500 IronPort-SDR: vr4ylSyQPHSLUViLrZZI0DtmrGvoneRAMTRrXaLGstcNim0HrZNCE0UOXJQzYOO/DYr2yAWEr9 YOMiFZcy4dCA== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="158892819" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="158892819" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 06:09:04 -0800 IronPort-SDR: 7+OMYNG4DOiHNS2BM/zUpkyQQrDJ9A7cmsPpLKbb7p2ajoLDRUgXUdtbsIkEJYhDS2cawelHRb cGcRVwNCDyig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="325596925" Received: from marshy.an.intel.com ([10.122.105.143]) by orsmga003.jf.intel.com with ESMTP; 18 Nov 2020 06:09:03 -0800 From: richard.gong@linux.intel.com To: gregkh@linuxfoundation.org, mdf@kernel.org, trix@redhat.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dinguyen@kernel.org, sridhar.rajagopal@intel.com, richard.gong@linux.intel.com, richard.gong@intel.com Subject: [PATCHv2 4/5] dt-bindings: fpga: add authenticate-fpga-config property Date: Wed, 18 Nov 2020 08:29:12 -0600 Message-Id: <1605709753-7800-5-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> References: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org From: Richard Gong Add authenticate-fpga-config property for FPGA bitstream authentication, which makes sure a signed bitstream has valid signatures. Signed-off-by: Richard Gong --- v2: put authenticate-fpga-config above partial-fpga-config update commit messages --- Documentation/devicetree/bindings/fpga/fpga-region.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/fpga/fpga-region.txt b/Documentation/devicetree/bindings/fpga/fpga-region.txt index e811cf8..d0d3234 100644 --- a/Documentation/devicetree/bindings/fpga/fpga-region.txt +++ b/Documentation/devicetree/bindings/fpga/fpga-region.txt @@ -182,6 +182,7 @@ Optional properties: This property is optional if the FPGA Manager handles the bridges. If the fpga-region is the child of a fpga-bridge, the list should not contain the parent bridge. +- authenticate-fpga-config : boolean, set if do bitstream authentication only. - partial-fpga-config : boolean, set if partial reconfiguration is to be done, otherwise full reconfiguration is done. - external-fpga-config : boolean, set if the FPGA has already been configured From patchwork Wed Nov 18 14:29:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Gong X-Patchwork-Id: 11915197 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,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 66FF8C64E8A for ; Wed, 18 Nov 2020 14:09:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CD0E2223D for ; Wed, 18 Nov 2020 14:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726915AbgKROJK (ORCPT ); Wed, 18 Nov 2020 09:09:10 -0500 Received: from mga18.intel.com ([134.134.136.126]:44082 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbgKROJJ (ORCPT ); Wed, 18 Nov 2020 09:09:09 -0500 IronPort-SDR: ZRtLRxiXBJLKpIhA9+JRySOGYWAI6nV44JyP9Ws332985HWmOAd9Bx8jhoXEr6juKju+grzaRn TQ3p31Ws9/GA== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="158892830" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="158892830" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 06:09:08 -0800 IronPort-SDR: Tm0ELrCvDRFEKrpSt5F23OrJXxIfOJ6tRx5LqJOPIIWasd4/grqgHS5f1EJnKtRorn0Nss/wxn Y8x4N4vkw2+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="325596943" Received: from marshy.an.intel.com ([10.122.105.143]) by orsmga003.jf.intel.com with ESMTP; 18 Nov 2020 06:09:07 -0800 From: richard.gong@linux.intel.com To: gregkh@linuxfoundation.org, mdf@kernel.org, trix@redhat.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dinguyen@kernel.org, sridhar.rajagopal@intel.com, richard.gong@linux.intel.com, richard.gong@intel.com Subject: [PATCHv2 5/5] fpga: stratix10-soc: extend driver for bitstream authentication Date: Wed, 18 Nov 2020 08:29:13 -0600 Message-Id: <1605709753-7800-6-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> References: <1605709753-7800-1-git-send-email-richard.gong@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org From: Richard Gong Extend FPGA manager driver to support FPGA bitstream authentication on Intel SocFPGA platforms. Signed-off-by: Richard Gong --- v2: use flag defined in stratix10-svc driver --- drivers/fpga/stratix10-soc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c index 657a70c..b77067e 100644 --- a/drivers/fpga/stratix10-soc.c +++ b/drivers/fpga/stratix10-soc.c @@ -186,6 +186,9 @@ static int s10_ops_write_init(struct fpga_manager *mgr, if (info->flags & FPGA_MGR_PARTIAL_RECONFIG) { dev_dbg(dev, "Requesting partial reconfiguration.\n"); ctype.flags |= BIT(COMMAND_RECONFIG_FLAG_PARTIAL); + } else if (info->flags & FPGA_MGR_BITSTREM_AUTHENTICATION) { + dev_dbg(dev, "Requesting bitstream authentication.\n"); + ctype.flags |= BIT(COMMAND_AUTHENTICATE_BITSTREAM); } else { dev_dbg(dev, "Requesting full reconfiguration.\n"); }