]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fpga: Extend loads command to load all secure images
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Sat, 18 Feb 2017 09:09:46 +0000 (14:39 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 20 Feb 2017 14:42:51 +0000 (15:42 +0100)
Extend loads command to loads to load all secure images
by providing an option to specify the secure image type
whose valueof 0 corresponds to authenticated image type
and 1 to encrypted image stype.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
cmd/fpga.c
include/fpga.h

index 1904dc00fb512655f77fe682b7e6065d8a37a60a..d584bbd183c5a4b891a9f62be71af249e527aaa1 100644 (file)
@@ -74,6 +74,8 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
                fpga_fsinfo.filename = argv[8];
 #endif
 #if defined(CONFIG_CMD_FPGA_LOAD_SECURE)
+       case 8:
+               fpga_sec_info.sec_img_type = simple_strtoul(argv[7], NULL, 16);
        case 7:
                fpga_sec_info.ivaddr_size = argv[6];
                fpga_sec_info.keyaddr_size = argv[5];
@@ -366,7 +368,7 @@ static int fpga_get_op(char *opstr)
 #if defined(CONFIG_CMD_FPGA_LOADFS)
 U_BOOT_CMD(fpga, 9, 1, do_fpga,
 #else
-U_BOOT_CMD(fpga, 7, 1, do_fpga,
+U_BOOT_CMD(fpga, 8, 1, do_fpga,
 #endif
           "loadable FPGA image support",
           "[operation type] [device number] [image address] [image size]\n"
@@ -400,6 +402,13 @@ U_BOOT_CMD(fpga, 7, 1, do_fpga,
 #endif
 #if defined(CONFIG_CMD_FPGA_LOAD_SECURE)
           "Load encrypted bitstream (Xilinx only)\n"
-          "  loads [dev] [address] [size] [keyaddr:size] [IVaddr:size]\n"
+          "  loads [dev] [address] [size] [key/sigaddr:size]\n"
+          "        [IV/PPKaddr:size] [secureimgtype]\n"
+          "Loads the secure bistreams(authenticated/encrypted)image of\n"
+          "[size] from [address] using key/signature(key for encrypted\n"
+          "bitstreams and signature for authenticated bitstreams) from\n"
+          "address whose :size and IV/PPK at address with size. The secure\n"
+          "image type specifies whether it is authenticated/encrypted\n"
+          "(0-enc, 1-auth) type of bitstream\n"
 #endif
 );
index a5742a1d6a2d311cf728ea206cac22cbef0c421e..343ee85bc9de3f5ddb120e770b3ed9726346dba7 100644 (file)
@@ -46,6 +46,7 @@ typedef struct {                /* typedef fpga_desc */
 typedef struct {
        char *keyaddr_size;
        char *ivaddr_size;
+       char sec_img_type;
 } fpga_secure_info;
 
 typedef enum {