]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: zynqrsa: Added support to load bitstream
authorVipul Kumar <vipul.kumar@xilinx.com>
Wed, 25 Apr 2018 09:57:53 +0000 (15:27 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 25 Apr 2018 13:35:29 +0000 (15:35 +0200)
This patch added support to check whether the bitstream is full
or none. On the basis of that, it loads the bitstream. Only
full bitstream loading is supported because we don't have a way
to identify it based on data in boot.bin format.

Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
cmd/zynq_rsa.c

index 81414a8c0fecac9c96ae010dee2dbd0183ea74fc..9a79c726fea5556d86aab6bc0441660f04de5d3f 100644 (file)
@@ -418,6 +418,7 @@ static int do_zynq_verify_image(cmd_tbl_t *cmdtp, int flag, int argc,
        u8 encrypt_part_flag;
        u8 part_chksum_flag;
        u8 signed_part_flag;
+       u8 bstype;
        char *endp;
 
        if (argc < 2)
@@ -553,15 +554,23 @@ static int do_zynq_verify_image(cmd_tbl_t *cmdtp, int flag, int argc,
                                debug("DECRYPTION \r\n");
 
                                part_dst_addr = part_load_addr;
-
-                               if (part_attr & ZYNQ_ATTRIBUTE_PL_IMAGE_MASK)
+                               /*
+                                * bootgen does not know whether the bitstream
+                                * is full or partial. As of now we supports
+                                * BIT_FULL which is the part of BOOT.BIN.
+                                */
+                               if (part_attr & ZYNQ_ATTRIBUTE_PL_IMAGE_MASK) {
                                        part_dst_addr = 0xFFFFFFFF;
+                                       bstype = BIT_FULL;
+                               } else {
+                                       bstype = BIT_NONE;
+                               }
 
                                status = zynq_decrypt_load(part_load_addr,
                                                           part_img_len,
                                                           part_dst_addr,
                                                           part_data_len,
-                                                          BIT_NONE);
+                                                          bstype);
                                if (status != 0) {
                                        printf("DECRYPTION_FAIL\r\n");
                                        return -1;