X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=inline;f=include%2Fusb.h;h=ba3d169ea8cbf977aaaeb8f95e9cf331537d1d58;hb=93691842e8dc86e6b2cb148c7c60a168654bbc34;hp=48e4bcda54640fbf1a0d8c3feecba09236cd2341;hpb=5c877b1ae0a4219ed6bd8d32cf3f7106b81ecb3b;p=u-boot diff --git a/include/usb.h b/include/usb.h index 48e4bcda54..ba3d169ea8 100644 --- a/include/usb.h +++ b/include/usb.h @@ -29,6 +29,16 @@ #include #include +/* + * The EHCI spec says that we must align to at least 32 bytes. However, + * some platforms require larger alignment. + */ +#if ARCH_DMA_MINALIGN > 32 +#define USB_DMA_MINALIGN ARCH_DMA_MINALIGN +#else +#define USB_DMA_MINALIGN 32 +#endif + /* Everything is aribtrary */ #define USB_ALTSETTINGALLOC 4 #define USB_MAXALTSETTING 128 /* Hard limit */ @@ -109,7 +119,9 @@ struct usb_device { int epmaxpacketout[16]; /* OUTput endpoint specific maximums */ int configno; /* selected config number */ - struct usb_device_descriptor descriptor; /* Device Descriptor */ + /* Device Descriptor */ + struct usb_device_descriptor descriptor + __attribute__((aligned(ARCH_DMA_MINALIGN))); struct usb_config config; /* config descriptor */ int have_langid; /* whether string_langid is valid yet */