]> git.sur5r.net Git - u-boot/commitdiff
fpga: zynqmp: Update zynqmp_load() as per latest xilfpga
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 1 Mar 2018 12:14:47 +0000 (17:44 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 9 Apr 2018 10:14:50 +0000 (12:14 +0200)
Latest xilfpga expects to set BIT5 of flags for nonsecure
bitsream and also expects length in bytes instead of words
This patch does the same.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
arch/arm/include/asm/arch-zynqmp/sys_proto.h
drivers/fpga/zynqmppl.c

index ad3dc9aba50d0b956f575bb21dba9b4dbb74a47b..3daf0e81d80c78e87f9b5e98859ecde528ce997d 100644 (file)
@@ -14,6 +14,8 @@
 #define ZYNQMP_SIP_SVC_PM_SECURE_IMG_LOAD      0xC200002D
 #define KEY_PTR_LEN    32
 
+#define ZYNQMP_FPGA_BIT_NS             5
+
 enum {
        IDCODE,
        VERSION,
index 80388ae7f2cf762144955f791d63b875b6bad430..aae0efc7348ee8b9cdb5974a8edadcf3cba37a4a 100644 (file)
@@ -209,13 +209,9 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
        debug("%s called!\n", __func__);
        flush_dcache_range(bin_buf, bin_buf + bsize);
 
-       if (bsize % 4)
-               bsize = bsize / 4 + 1;
-       else
-               bsize = bsize / 4;
-
        buf_lo = (u32)bin_buf;
        buf_hi = upper_32_bits(bin_buf);
+       bstype |= BIT(ZYNQMP_FPGA_BIT_NS);
        ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi, bsize,
                         bstype, ret_payload);
        if (ret)