linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mdf@kernel.org
To: linux-fpga@vger.kernel.org
Cc: "Moritz Fischer" <mdf@kernel.org>, "Alan Tull" <atull@kernel.org>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] fpga: region: Add fpga-region property 'encrypted-fpga-config'
Date: Mon, 20 Feb 2017 12:55:23 -0800	[thread overview]
Message-ID: <1487624123-13579-3-git-send-email-mdf@kernel.org> (raw)
In-Reply-To: <1487624123-13579-1-git-send-email-mdf@kernel.org>

From: Moritz Fischer <mdf@kernel.org>

Add fpga-region property to allow passing the fact that the bitstream is
encrypted to the fpga-region and ultimately to the low-level driver.

Signed-off-by: Moritz Fischer <mdf@kernel.org>
Cc: Alan Tull <atull@kernel.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Sören Brinkmann <soren.brinkmann@xilinx.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-fpga@vger.kernel.org
---
 Documentation/devicetree/bindings/fpga/fpga-region.txt | 1 +
 drivers/fpga/fpga-region.c                             | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/fpga/fpga-region.txt b/Documentation/devicetree/bindings/fpga/fpga-region.txt
index 3b32ba1..81bf3ad 100644
--- a/Documentation/devicetree/bindings/fpga/fpga-region.txt
+++ b/Documentation/devicetree/bindings/fpga/fpga-region.txt
@@ -186,6 +186,7 @@ Optional properties:
 	otherwise full reconfiguration is done.
 - external-fpga-config : boolean, set if the FPGA has already been configured
 	prior to OS boot up.
+- encrypted-fpga-config : boolean, set if the bitstream is encrypted
 - region-unfreeze-timeout-us : The maximum time in microseconds to wait for
 	bridges to successfully become enabled after the region has been
 	programmed.
diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
index 3222fdb..2fe2a52 100644
--- a/drivers/fpga/fpga-region.c
+++ b/drivers/fpga/fpga-region.c
@@ -337,8 +337,9 @@ static int child_regions_with_firmware(struct device_node *overlay)
  * The overlay must add either firmware-name or external-fpga-config property
  * to the FPGA Region.
  *
- *   firmware-name        : program the FPGA
- *   external-fpga-config : FPGA is already programmed
+ *   firmware-name         : program the FPGA
+ *   external-fpga-config  : FPGA is already programmed
+ *   encrypted-fpga-config : FPGA bitstream is encrypted
  *
  * The overlay can add other FPGA regions, but child FPGA regions cannot have a
  * firmware-name property since those regions don't exist yet.
@@ -373,6 +374,9 @@ static int fpga_region_notify_pre_apply(struct fpga_region *region,
 	if (of_property_read_bool(nd->overlay, "external-fpga-config"))
 		info->flags |= FPGA_MGR_EXTERNAL_CONFIG;
 
+	if (of_property_read_bool(nd->overlay, "encrypted-fpga-config"))
+		info->flags |= FPGA_MGR_ENCRYPTED_BITSTREAM;
+
 	of_property_read_string(nd->overlay, "firmware-name", &firmware_name);
 
 	of_property_read_u32(nd->overlay, "region-unfreeze-timeout-us",
-- 
2.7.4

  parent reply	other threads:[~2017-02-20 20:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 20:55 [PATCH v2 1/3] fpga: Add flag to indicate bitstream needs decrypting mdf
2017-02-20 20:55 ` [PATCH v2 2/3] fpga: zynq: Add support for encrypted bitstreams mdf
2017-02-21 13:55   ` Michal Simek
2017-02-21 16:36     ` Alan Tull
2017-02-20 20:55 ` mdf [this message]
2017-02-21 13:55   ` [PATCH v2 3/3] fpga: region: Add fpga-region property 'encrypted-fpga-config' Michal Simek
2017-02-21 16:36     ` Alan Tull
2017-02-21 13:55 ` [PATCH v2 1/3] fpga: Add flag to indicate bitstream needs decrypting Michal Simek
2017-02-21 16:35   ` Alan Tull
2017-02-21 18:26     ` Alan Tull
2017-02-21 18:36       ` Michal Simek
2017-02-21 18:38         ` Alan Tull
2017-02-22  7:15       ` Greg Kroah-Hartman
2017-02-22  8:22         ` Michal Simek
2017-02-22 13:04           ` Greg Kroah-Hartman
2017-02-22 13:24             ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487624123-13579-3-git-send-email-mdf@kernel.org \
    --to=mdf@kernel.org \
    --cc=atull@kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=soren.brinkmann@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).