From ffad3cca5df64cc80d8880cfdad8ea091c530e55 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 19 Apr 2013 14:51:30 +0200 Subject: [PATCH] fpga: zynqpl: Buffers must be aligned Dma requires aligned buffers. Signed-off-by: Michal Simek --- drivers/fpga/zynqpl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c index 6c455f4b5a2..693199bf0c9 100644 --- a/drivers/fpga/zynqpl.c +++ b/drivers/fpga/zynqpl.c @@ -55,7 +55,7 @@ int zynq_info(Xilinx_desc *desc) } /* Xilinx binary format header */ -const u32 bin_format[] = { +static const u32 bin_format[] = { 0xffffffff, /* Dummy words */ 0xffffffff, 0xffffffff, @@ -80,6 +80,11 @@ int zynq_load(Xilinx_desc *desc, const void *buf, size_t bsize) const u32 *test = buf; int i; + if ((u32)buf & 0x3) { + printf("Error: Buffer is not aligned %x\n", (u32)buf); + return FPGA_FAIL; + } + /* Check bitstream size */ if (bsize != desc->size) { printf("Error: File size is wrong - should be %x.\n", -- 2.47.3