[U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

Marek Vasut
2013-09-13T16:24:52Z

Dear Wolfgang Denk,

> Dear Robert Hodaszi,
>
> In message <5232F2E7.4050407@digi.com> you wrote:
> > Ok. Then what about if I would use the stack, but align the buffer
> > manually.
>
> Has this been tested? Does it work?
>
> > - uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN);
> > + /* Align the receive buffer */
> > + uchar buff_unaligned[FEC_MAX_PKT_SIZE + (ARCH_DMA_MINALIGN - 1)];
> > + uchar *buff = ((uint32_t)buff_unaligned + (ARCH_DMA_MINALIGN -
> > 1)) & ~(ARCH_DMA_MINALIGN - 1);
>
> You should use the ALIGN() macro here.

We already have this stuff in include/common.h ... ALLOC_CACHE_ALIGNED_BUFFER it
is called IIRC

Best regards,
Marek Vasut