]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fpga: zynqpl: Add bstype argument to zynq_decrypt_load()
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Tue, 12 Mar 2019 14:50:19 +0000 (20:20 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 13 Mar 2019 14:19:21 +0000 (15:19 +0100)
This patch adds 'bstype' argument to zynq_decrypt_load() to specify whether
the input source is a bitstream/non-bitstream/partial bitstream image.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/zynq/cmds.c
drivers/fpga/zynqpl.c
include/zynqpl.h

index 8b48ea3a03abffec54514d48de41c3b1d00c6470..cec35cd849e6415af8f9926359dffa9f2a7af4b2 100644 (file)
@@ -396,7 +396,8 @@ static int zynq_verify_image(u32 src_ptr)
                        status = zynq_decrypt_load(part_load_addr,
                                                   part_img_len,
                                                   part_dst_addr,
-                                                  part_data_len);
+                                                  part_data_len,
+                                                  BIT_NONE);
                        if (status != 0) {
                                printf("DECRYPTION_FAIL\n");
                                return -1;
@@ -431,6 +432,7 @@ static int zynq_decrypt_image(cmd_tbl_t *cmdtp, int flag, int argc,
        char *endp;
        u32 srcaddr, srclen, dstaddr, dstlen;
        int status;
+       u8 imgtype = BIT_NONE;
 
        srcaddr = simple_strtoul(argv[2], &endp, 16);
        if (*argv[2] == 0 || *endp != 0)
@@ -454,7 +456,8 @@ static int zynq_decrypt_image(cmd_tbl_t *cmdtp, int flag, int argc,
        if (dstlen % 4)
                dstlen = roundup(dstlen, 4);
 
-       status = zynq_decrypt_load(srcaddr, srclen >> 2, dstaddr, dstlen >> 2);
+       status = zynq_decrypt_load(srcaddr, srclen >> 2, dstaddr,
+                                  dstlen >> 2, imgtype);
        if (status != 0)
                return CMD_RET_FAILURE;
 
index ef0f251db26377108a8f64c6422458bb34583301..9745d8a7152fe8dda32cc1e05e47124448dcf8ba 100644 (file)
@@ -505,7 +505,8 @@ struct xilinx_fpga_op zynq_op = {
  * Load the encrypted image from src addr and decrypt the image and
  * place it back the decrypted image into dstaddr.
  */
-int zynq_decrypt_load(u32 srcaddr, u32 srclen, u32 dstaddr, u32 dstlen)
+int zynq_decrypt_load(u32 srcaddr, u32 srclen, u32 dstaddr, u32 dstlen,
+                     u8 bstype)
 {
        u32 isr_status, ts;
 
@@ -522,7 +523,7 @@ int zynq_decrypt_load(u32 srcaddr, u32 srclen, u32 dstaddr, u32 dstlen)
                return FPGA_FAIL;
        }
 
-       if (zynq_dma_xfer_init(BIT_NONE)) {
+       if (zynq_dma_xfer_init(bstype)) {
                printf("%s: zynq_dma_xfer_init FAIL\n", __func__);
                return FPGA_FAIL;
        }
index 766e6918cd384c720ac19dbed4f152c61aa3b2d4..d7dc064585eaec8a5ff7f92af11d16860f0014be 100644 (file)
@@ -12,7 +12,8 @@
 #include <xilinx.h>
 
 #ifdef CONFIG_CMD_ZYNQ_AES
-int zynq_decrypt_load(u32 srcaddr, u32 dstaddr, u32 srclen, u32 dstlen);
+int zynq_decrypt_load(u32 srcaddr, u32 dstaddr, u32 srclen, u32 dstlen,
+                     u8 bstype);
 #endif
 
 extern struct xilinx_fpga_op zynq_op;