From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alban Bedel Date: Tue, 24 Feb 2015 18:41:22 +0100 Subject: [U-Boot] [PATCH 1/3] usb: ci_udc: Fix set address to work with older controllers In-Reply-To: <54ECAE3B.8080208@wwwdotorg.org> References: <1424796293-22746-1-git-send-email-alban.bedel@avionic-design.de> <54ECAE3B.8080208@wwwdotorg.org> Message-ID: <20150224184122.5f8341c3@avionic-0020> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 24 Feb 2015 10:00:43 -0700 Stephen Warren wrote: > On 02/24/2015 09:44 AM, Alban Bedel wrote: > > Older controllers don't implement "Device Address Advance" which allow > > to pass the device address to the controller when it is received. > > To support such controller we need to store the requested address and > > only apply it after the next IN transfer completed on EP0. > > > diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c > > > case SETUP(USB_RECIP_DEVICE, USB_REQ_SET_ADDRESS): > > - /* > > - * write address delayed (will take effect > > - * after the next IN txn) > > - */ > > - writel((r.wValue << 25) | (1 << 24), &udc->devaddr); > > + /* The device address must be updated after the next IN > > + * request completed */ > > + controller.set_address = r.wValue; > > Presumably, bit 24 is the "device address advance" feature? Yes, bit 24 is the "device address advance" feature > I'd prefer it if new controllers used the existing code, but we deferred > the write only for older controllers that don't support "device address > advance". That reduces the possibility of regressions on controller HW > that's already working. Presumably, there is some advantage using the > new feature, rather than deferring the address change manually, e.g. it > solves some race condition? I'm no USB expert, but AFAIU it is only a convenience to make the driver code simpler. I though that having less code path and ifdef would make the whole thing easier to maintain. However if that is preferred I can implement it as you suggested. Alban PS: Sorry for the double mail Stephen, I accidentally used the wrong reply button. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: