All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] fpga: zynqmp: Fix the nonsecure bitstream loading issue
Date: Wed, 28 Mar 2018 16:30:25 +0200	[thread overview]
Message-ID: <21d84c6b62fc0b311e2773df939f22d6ee75878f.1522247420.git.michal.simek@xilinx.com> (raw)
In-Reply-To: <cover.1522247420.git.michal.simek@xilinx.com>

From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>

Xilfpga library expects the size of bitstream in a pointer
but currenly we are passing the size as a value. This patch
fixes this issue.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Nava kishore Manne <navam@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/fpga/zynqmppl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c
index aae0efc7348e..43e8b2520e35 100644
--- a/drivers/fpga/zynqmppl.c
+++ b/drivers/fpga/zynqmppl.c
@@ -11,6 +11,7 @@
 #include <zynqmppl.h>
 #include <linux/sizes.h>
 #include <asm/arch/sys_proto.h>
+#include <memalign.h>
 
 #define DUMMY_WORD	0xffffffff
 
@@ -195,6 +196,7 @@ static int zynqmp_validate_bitstream(xilinx_desc *desc, const void *buf,
 static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
 		     bitstream_type bstype)
 {
+	ALLOC_CACHE_ALIGN_BUFFER(u32, bsizeptr, 1);
 	u32 swap;
 	ulong bin_buf;
 	int ret;
@@ -205,15 +207,17 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
 		return FPGA_FAIL;
 
 	bin_buf = zynqmp_align_dma_buffer((u32 *)buf, bsize, swap);
+	bsizeptr = (u32 *)&bsize;
 
 	debug("%s called!\n", __func__);
 	flush_dcache_range(bin_buf, bin_buf + bsize);
+	flush_dcache_range((ulong)bsizeptr, (ulong)bsizeptr + sizeof(size_t));
 
 	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);
+	ret = invoke_smc(ZYNQMP_SIP_SVC_PM_FPGA_LOAD, buf_lo, buf_hi,
+			 (u32)(uintptr_t)bsizeptr, bstype, ret_payload);
 	if (ret)
 		debug("PL FPGA LOAD fail\n");
 
-- 
1.9.1

  parent reply	other threads:[~2018-03-28 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 14:30 [U-Boot] [PATCH 0/3] fpga: zynqmp: Fpga changes Michal Simek
2018-03-28 14:30 ` [U-Boot] [PATCH 1/3] fpga: zynqmp: Add support to get the PCAP status for fpga info command Michal Simek
2018-03-28 14:30 ` [U-Boot] [PATCH 2/3] fpga: zynqmp: Update zynqmp_load() as per latest xilfpga Michal Simek
2018-03-29  3:46   ` Joe Hershberger
2018-03-28 14:30 ` Michal Simek [this message]
2018-05-13 18:54   ` [U-Boot] [PATCH 3/3] fpga: zynqmp: Fix the nonsecure bitstream loading issue Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21d84c6b62fc0b311e2773df939f22d6ee75878f.1522247420.git.michal.simek@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.