Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp346788pxb; Wed, 18 Nov 2020 06:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQsxejbsVl57/RLK1Y3VQ0VouBMdb+1PCRGwCKvUdCuipzhMz6sngw84cYt/3ZMiE6Lmsz X-Received: by 2002:a17:906:38cc:: with SMTP id r12mr24626648ejd.277.1605708674618; Wed, 18 Nov 2020 06:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605708674; cv=none; d=google.com; s=arc-20160816; b=vqUA9CQhTK4AotgUxPv+FuY2qD2xzr7eQVVwsC7kIs7QsxHg2qfbv/hNZZEWNRil+A xom/0Kcip4V9E4+h7WRn8xXNStgsrne6Nc/vEh1DJB3sYxKVZuSAEKidRlUjYboLzN1k kngifa3N6o6zlc0IXynMhPvGxXRU0rpA/l9twPAFyLnmj3G7YqlagByk/ACs0T76Y0Mk nrbC97sbdzb1zgHXgRsuDZyowC8LXCtcM/RqZWNex8gqaXvLl7huFKoKpHmr5u2qrJbi kybLv4huC1CLXkfL47HEHi9avgHbCZ/6dKN8fXGJhdcK97pff7zLbGjZVORsrixe5wxq bMGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=lxxX3+o7SC7y+iScNp8jSJVSIjj37uVg3u9e6TD5nUs=; b=Ady1ttkxigrKcmFKOhsT5qBbEvhFctBfGSn9Fz7ITNkR31wWcs9DI9e2ktRPqdMaHp 5Ul8tvLeho3zoHTeufL4j514bI3mQUv68/VX/HOL/mJNaoRTZwwC7xlYy3ITzb4zzh/e rq8Ha8EHDsiTF439gbVQSpm3kBKsRzxzAphQefDbT+K1JhFqphfn8eh2XjW+34Hle5R1 J0G3RJqE35iCiSe6jms3xynHgL17Xo/fzLPOg9VyEFJ2GTbJdp9Tg9pevP58WdxwN0F/ OSA6HmwZ3xF6Sup6x4delLtrW6hrR4ZyBnYRLJjted6ui+0YjbMK9iZm8HJg1WkP0tjm Z4ig== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si8472722edv.85.2020.11.18.06.10.51; Wed, 18 Nov 2020 06:11:14 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbgKROJC (ORCPT + 99 others); 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-kernel@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 -- 2.7.4