summaryrefslogtreecommitdiff
path: root/drivers/fpga
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2014-03-05 12:51:26 +0100
committerStefano Babic <sbabic@denx.de>2014-03-05 12:51:26 +0100
commit1ad6364eeb4f578e423081d1748e8a3fdf1ab01d (patch)
treef55731737edf1cfd653b21f2ff9d387e6c53ae24 /drivers/fpga
parent335143c76612a0ae26eef8abeda77641d4f63b50 (diff)
parentcc07294bc704694ae33db75b25ac557e5917a83f (diff)
downloadu-boot-imx-1ad6364eeb4f578e423081d1748e8a3fdf1ab01d.zip
u-boot-imx-1ad6364eeb4f578e423081d1748e8a3fdf1ab01d.tar.gz
u-boot-imx-1ad6364eeb4f578e423081d1748e8a3fdf1ab01d.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/zynqpl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c
index 1effbad..15900c9 100644
--- a/drivers/fpga/zynqpl.c
+++ b/drivers/fpga/zynqpl.c
@@ -187,6 +187,16 @@ int zynq_load(Xilinx_desc *desc, const void *buf, size_t bsize)
if ((u32)buf != ALIGN((u32)buf, ARCH_DMA_MINALIGN)) {
u32 *new_buf = (u32 *)ALIGN((u32)buf, ARCH_DMA_MINALIGN);
+ /*
+ * This might be dangerous but permits to flash if
+ * ARCH_DMA_MINALIGN is greater than header size
+ */
+ if (new_buf > buf_start) {
+ debug("%s: Aligned buffer is after buffer start\n",
+ __func__);
+ new_buf -= ARCH_DMA_MINALIGN;
+ }
+
printf("%s: Align buffer at %x to %x(swap %d)\n", __func__,
(u32)buf_start, (u32)new_buf, swap);