summaryrefslogtreecommitdiff
path: root/include/fpga.h
diff options
context:
space:
mode:
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>2018-05-31 15:10:22 +0530
committerMichal Simek <michal.simek@xilinx.com>2018-06-01 11:37:31 +0200
commitcedd48e2cdb752444444a97157025f16e63ee446 (patch)
treee06cd6fb2d90c9d58da3ad7eec234be16e44e347 /include/fpga.h
parentf5953610bf9198a585e39c8074ef9dea1106da9c (diff)
cmd: fpga: Add support to load secure bitstreams
This patch adds support to load secure bitstreams(authenticated or encrypted or both). As of now, this feature is added and tested only for xilinx bitstreams and the secure bitstream was generated using xilinx bootgen tool, but the command is defined in more generic way. Command example to load authenticated and device key encrypted bitstream is as follows "fpga loads 0 100000 2000000 0 1" Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'include/fpga.h')
-rw-r--r--include/fpga.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/fpga.h b/include/fpga.h
index f444093353..195f0bdd57 100644
--- a/include/fpga.h
+++ b/include/fpga.h
@@ -20,6 +20,9 @@
/* device numbers must be non-negative */
#define FPGA_INVALID_DEVICE -1
+#define FPGA_ENC_USR_KEY 1
+#define FPGA_NO_ENC_OR_NO_AUTH 2
+
/* root data type defintions */
typedef enum { /* typedef fpga_type */
fpga_min_type, /* range check value */
@@ -42,6 +45,12 @@ typedef struct { /* typedef fpga_desc */
int fstype;
} fpga_fs_info;
+struct fpga_secure_info {
+ u8 *userkey_addr;
+ u8 authflag;
+ u8 encflag;
+};
+
typedef enum {
BIT_FULL = 0,
BIT_PARTIAL,
@@ -58,6 +67,8 @@ int fpga_load(int devnum, const void *buf, size_t bsize,
bitstream_type bstype);
int fpga_fsload(int devnum, const void *buf, size_t size,
fpga_fs_info *fpga_fsinfo);
+int fpga_loads(int devnum, const void *buf, size_t size,
+ struct fpga_secure_info *fpga_sec_info);
int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
bitstream_type bstype);
int fpga_dump(int devnum, const void *buf, size_t bsize);