]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
fpga: zynqpl: Buffers must be aligned
authorMichal Simek <michal.simek@xilinx.com>
Fri, 19 Apr 2013 12:51:30 +0000 (14:51 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 25 Apr 2013 14:55:46 +0000 (16:55 +0200)
Dma requires aligned buffers.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/fpga/zynqpl.c

index 6c455f4b5a2ed689db368f0230fd8498138bc593..693199bf0c9c2a0aa03f9efde6a4369b5f48540c 100644 (file)
@@ -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",