From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 15 Jul 2012 16:59:56 +0200 Subject: [U-Boot] [PATCH V2 3/8] ehci-hcd.c, musb_core, usb.h: Add USB_DMA_MINALIGN define for cache alignment In-Reply-To: <1342363433-9284-4-git-send-email-ilya.yanok@cogentembedded.com> References: <1342363433-9284-1-git-send-email-ilya.yanok@cogentembedded.com> <1342363433-9284-4-git-send-email-ilya.yanok@cogentembedded.com> Message-ID: <201207151659.56796.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Ilya Yanok, [...] > diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c > index 04300be..59039f4 100644 > --- a/drivers/usb/host/ehci-hcd.c > +++ b/drivers/usb/host/ehci-hcd.c > @@ -34,7 +34,10 @@ struct ehci_hccr *hccr; /* R/O registers, not need for > volatile */ volatile struct ehci_hcor *hcor; > > static uint16_t portreset; > -static struct QH qh_list __attribute__((aligned(32))); > +DEFINE_ALIGN_BUFFER(struct QH, qh_list, 1, USB_DMA_MINALIGN); > + > +#define ALIGN_END_ADDR(type, ptr, size) \ > + ((uint32_t)(ptr) + roundup((size) * sizeof(type), USB_DMA_MINALIGN)) > > static struct descriptor { > struct usb_hub_descriptor hub; > @@ -207,8 +210,9 @@ static int > ehci_submit_async(struct usb_device *dev, unsigned long pipe, void > *buffer, int length, struct devrequest *req) > { > - static struct QH qh __attribute__((aligned(32))); > - static struct qTD qtd[3] __attribute__((aligned (32))); > + /* for some reason this doesn't work with non-static qh */ > + DEFINE_ALIGN_BUFFER(struct QH, qh, 1, USB_DMA_MINALIGN); For some reason this doesn't work, but for obvious reason this is NAK. The rest is OK, but this is not. Let's investigate. > + ALLOC_ALIGN_BUFFER(struct qTD, qtd, 3, USB_DMA_MINALIGN); > int qtd_counter = 0; > > volatile struct qTD *vtd; [...] I'll poke into this hopefully later today, but if you can try finding something until then, that'd be great :)