From: Vipul Kumar Date: Wed, 25 Apr 2018 09:57:53 +0000 (+0530) Subject: cmd: zynqrsa: Added support to load bitstream X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=00186544d431ef499bea3d7127886b665f638b43;p=thirdparty%2Fu-boot.git cmd: zynqrsa: Added support to load bitstream 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 Signed-off-by: Michal Simek --- diff --git a/cmd/zynq_rsa.c b/cmd/zynq_rsa.c index 81414a8c0fe..9a79c726fea 100644 --- a/cmd/zynq_rsa.c +++ b/cmd/zynq_rsa.c @@ -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;