From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Billauer Date: Tue, 18 Mar 2014 23:14:54 +0200 Subject: [U-Boot] [PATCH] fpga: zynqpl: Fixed bug in alignment routine In-Reply-To: <53283941.3070603@monstr.eu> References: <1394916029-12079-1-git-send-email-eli.billauer@gmail.com> <53281DED.8030903@gmail.com> <53283941.3070603@monstr.eu> Message-ID: <5328B74E.4080702@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, We're completely out of sync with our git repositories, but I changed the relevant parts in my zynqpl.c (with the patch of this thread not applied), and it worked well. The alignment went downwards as expected. Regards, Eli On 18/03/14 14:17, Michal Simek wrote: > Does this work for you? If yes, I will send this as regular patch. > > diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c > index 3572bc9..49eef0f 100644 > --- a/drivers/fpga/zynqpl.c > +++ b/drivers/fpga/zynqpl.c > @@ -289,10 +289,11 @@ static int zynq_dma_xfer_init(u32 partialbit) > static u32 *zynq_align_dma_buffer(u32 *buf, u32 len, u32 swap) > { > u32 *new_buf; > - u32 i; > + u32 i, align; > > - if ((u32)buf != ALIGN((u32)buf, ARCH_DMA_MINALIGN)) { > - new_buf = (u32 *)ALIGN((u32)buf, ARCH_DMA_MINALIGN); > + align = ALIGN((u32)(buf - ARCH_DMA_MINALIGN + 1), ARCH_DMA_MINALIGN); > + if ((u32)buf != align) { > + new_buf = (u32 *)align; > >