From: Michal Simek Date: Fri, 19 Apr 2013 12:51:30 +0000 (+0200) Subject: fpga: zynqpl: Buffers must be aligned X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ffad3cca5df64cc80d8880cfdad8ea091c530e55;p=thirdparty%2Fu-boot.git fpga: zynqpl: Buffers must be aligned Dma requires aligned buffers. Signed-off-by: Michal Simek --- 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",