[U-Boot] [PATCH] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment

Marek Vasut marex at denx.de
Thu Jul 5 21:58:04 CEST 2012


Dear Ilya Yanok,

> Hi Marek,
> 
> On Thu, Jul 5, 2012 at 12:24 AM, Marek Vasut <marex at denx.de> wrote:
> > > -static struct QH qh_list __attribute__((aligned(32)));
> > > +static char __qh_list[ALIGN(sizeof(struct QH), USB_DMA_MINALIGN)]
> > > +                     __attribute__((aligned(USB_DMA_MINALIGN)));
> > > +static struct QH *qh_list = (struct QH *)__qh_list;
> > 
> > Maybe we should create DEFINE_ALIGNED_VARIABLE as a common.h macro?
> 
> Yep. I even thought about this but decided not to do... can't recall why.
> Now I think it's really a good idea.

Like what's in common.h -- ALLOC_CACHE_ALIGN_BUFFER ?

[..]

> Hm.. Maybe. Ideas? ;) Actually I also thought about moving all this stuff
> to a single proper aligned buffer and do flush/invalidate for a whole
> buffer at once. It can save us some space... but it's BSS anyway... Don't
> know if it's worth it...

But if you copy stuff back and forth, it'll cause performance hit.

> Regards, Ilya.

Best regards,
Marek Vasut


More information about the U-Boot mailing list