[U-Boot] [RFC/PATCH] common/usb: use cache-alligned buffers

Mike Frysinger vapier at gentoo.org
Thu Oct 27 00:20:46 CEST 2011


On Wed, Oct 26, 2011 at 23:05, Ilya Yanok wrote:
> What do you think, how should we deal with it? Make all buffers
> alligned or implement bounce-buffering inside host driver?

since this is a common issue to most USB controllers, aligning the
buffers is probably best.  and should be relatively painless.

what's the code size before/after your change ?

> --- a/common/usb.c
> +++ b/common/usb.c
>
> -static struct devrequest setup_packet;
> +static uchar __setup_packet[ALIGN(sizeof(struct devrequest),
> +               ARCH_DMA_MINALIGN)]
> +               __aligned(ARCH_DMA_MINALIGN);
> +static struct devrequest * const setup_packet =
> +               (struct devrequest *)&__setup_packet;

i'm not sure about this.  why won't this work ?
static struct devrequest setup_packet __aligned(ARCH_DMA_MINALIGN);
-mike


More information about the U-Boot mailing list